/* Reset Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #0066cc; /* Biru BPAD */
    --primary-dark: #004c99;
    --secondary: #dc143c; /* Merah Jakarta */
    --success: #28a745;
    --warning: #ffc107;
    --dark: #333;
    --light: #f8f9fa;
    --gray: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--white);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-left: 5px solid var(--secondary);
}

.logo h1 {
    font-size: 1.4rem;
    color: var(--dark);
}

.logo p {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Logo di dashboard admin kecil */
.admin .logo img, .header .logo img {
  height: 60px;
  max-height: 60px;
  max-width: 180px;
  object-fit: contain;
}

/* Card statistik */
.status-card {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.status-card-item {
  flex: 1;
  min-width: 200px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}
.status-card-item h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #6c757d;
}
.status-card-item .count {
  font-size: 2.5rem;
  font-weight: bold;
}
.pending { color: #ffc107; }
.approved { color: #28a745; }
.rejected { color: #dc3545; }

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Login Card */
.login-card {
  max-width: 380px;
  margin: 0 auto;
}

.input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon i {
  position: absolute;
  left: 12px;
  color: var(--primary-dark);
  font-size: 1.1rem;
  pointer-events: none; /* biar icon tidak bisa diklik */
}

.input-icon input {
  padding-left: 42px;
  padding-right: 42px; /* ruang untuk eye toggle di kanan */
  width: 100%;
}

#togglePassword {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

#togglePassword:hover {
  color: var(--primary);
}

.error-msg {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-top: 4px;
  display: block;
  min-height: 18px;
}

.form-message {
  margin-top: 12px;
  font-weight: 500;
  color: var(--secondary);
  min-height: 24px;
  line-height: 1.4;
}

.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary[disabled] {
  cursor: not-allowed;
  background: #004c996e;
}

.btn-primary i.fa-spinner {
  font-size: 1rem;
}

.btn-secondary {
  background: var(--gray);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Card */
.card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light);
}

.card h2 {
    color: var(--primary);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: var(--warning);
    color: var(--dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Form */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light);
    border-radius: var(--radius);
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[disabled],
.form-group textarea[disabled] {
    background: var(--light);
    border-color: var(--gray);
    color: var(--dark);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

/* Tombol */
.btn-whatsapp {
    background: #25D366;
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-pdf {
    background: #dc143c;
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-save {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: var(--gray);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--light);
}

.action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

/* History Table & General Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

tr:hover {
    background: var(--light);
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 5px;
}

.btn-view {
    background: var(--primary);
    color: white;
}

.btn-delete {
    background: var(--secondary);
    color: white;
}

/* Statistik Box */
.statistik-box {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.statistik-box p {
    margin: 5px 0;
    font-weight: 600;
}

/* Preview Undangan */
#undanganPreview img {
    max-width: 200px;
    border-radius: 8px;
}

#undanganPdfPreview, #undanganLink {
    color: var(--primary);
    text-decoration: underline;
}

/* Text Colors */
.text-center {
    text-align: center;
}

.text-gray {
    color: var(--gray);
}

.text-red {
    color: var(--secondary);
}

/* Login header lebih rapi */
.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.login-logo {
  width: auto;
  height: 55px;              /* Tinggi utama */
  max-height: 55px;          /* Batasi agar tidak lebih tinggi */
  max-width: 160px;          /* Batasi lebar */
  object-fit: contain;
  margin-bottom: 12px;
}

.login-logo:hover {
  transform: scale(1.05);
}
.login-header h2 {
  margin: 0 0 6px 0;               /* Hapus margin default, tambah jarak bawah */
  font-size: 1.75rem;              /* Sedikit lebih besar, bold */
  font-weight: 700;
  color: var(--primary);           /* Biru BPAD */
  line-height: 1.2;
  letter-spacing: 0.4px;           /* Spasi huruf sedikit biar elegan */
}
.login-header p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.4;
}

/* Input wrapper lebih bersih */
.input-wrapper {
  position: relative;
}
.input-icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-dark);
  font-size: 1.05rem;
  pointer-events: none;
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  z-index:2;
}
.toggle-password:focus {
  outline: 2px solid var(--primary);
}
.toggle-password:hover {
  color: var(--primary);
}

/* Hilangkan icon mata biru bawaan browser (Chrome autofill) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}
input[type="password"]::-webkit-inner-spin-button,
input[type="password"]::-webkit-textfield-decoration-container {
  display: none;
}

/* Animasi loading di tombol login */
.btn-login {
  position: relative;
}
.btn-loader {
  margin-left: 8px;
}

/* Request Akun Card */
.request-card {
  max-width: 480px;
  margin: 20px auto;
  padding: 32px 28px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 102, 204, 0.12);
  border: 1px solid rgba(0, 102, 204, 0.08);
}

/* Header Request */
.request-header {
  text-align: center;
  margin-bottom: 32px;
}
.request-icon {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.request-header h2 {
  font-size: 1.8rem;
  color: var(--primary);
  margin: 0 0 8px 0;
  font-weight: 700;
}
.request-header p {
  color: var(--gray);
  font-size: 0.95rem;
  margin: 0;
}

/* Form Request */
.request-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Transisi halaman global */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.page-transition.active {
  opacity: 1;
  transform: translateY(0);
}

/* Optional: overlay loading saat transisi (kalau mau lebih pro) */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
      font-size: 1.25rem;       /* judul sedikit mengecil */
    }

    .header .logo img {
    height: 50px;
    max-width: 140px;
    } 

    .logo p {
      font-size: 0.8rem;        /* deskripsi lebih kecil */
      line-height: 1.3;
    }

    .login-logo {
    height: 45px;
    max-width: 130px;
    }
    .login-header h2 {
    font-size: 1.4rem;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    table {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
  .logo img {
    height: 55px;                /* lebih kecil di HP */
    max-width: 140px;
  }
  
  .logo h1 {
    font-size: 1.3rem;
  }
  
  .logo p {
    font-size: 0.8rem;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
.form-group {
  position: relative;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}
.required {
  color: var(--secondary);
  font-size: 0.9rem;
}
input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 2px solid #e0e7ff;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s;
}
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Password Wrapper */
.password-group .password-wrapper {
  position: relative;
}
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.2rem;
  cursor: pointer;
}
.toggle-password:hover {
  color: var(--primary);
}

/* Tombol Submit */
.btn-submit {
  background: linear-gradient(135deg, var(--primary), #004c99);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.25);
}

/* Pesan & Tombol Kembali */
.request-message {
  text-align: center;
  margin: 16px 0;
  font-weight: 500;
  min-height: 24px;
}
.btn-back {
  background: var(--light);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}
.btn-back:hover {
  background: var(--primary);
  color: white;
}


@media (max-width: 480px) {
  .login-card {
    padding: 20px;
  }
  .login-header h2 {
    font-size: 1.3rem;
    text-align: center;
  }
  .form-group label {
    font-size: 0.95rem;
  }
  .btn-primary, .btn-secondary {
    padding: 12px;
    font-size: 0.95rem;
  }
  .input-wrapper input {
    padding: 12px 14px 12px 42px;
    font-size: 0.95rem;
  }
}

/* Pastikan form Request Akun Baru HIDDEN secara default */
#requestAkunSection {
  display: none !important;
}

/* Saat ditampilkan via JS, pakai block dan override shadow/padding jika perlu */
#requestAkunSection.active {
  display: block !important;
}