/* ============================================
   UI v2 - Polish & Brand
   ============================================ */

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brand-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #001f4d 0%, #003d82 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.brand-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-mark { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff6b00, #ff9244);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255,107,0,0.30);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 700; }
.brand-text span { font-size: 0.75rem; color: rgba(255,255,255,0.65); font-weight: 500; }
.brand-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
}
.brand-meta-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.20);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.login-container {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  min-height: calc(100vh - 64px - 50px);
  padding: 2rem 1rem;
}
.login-container::before,
.login-container::after { display: none; }

.login-box {
  max-width: 540px;
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 61, 130, 0.10), 0 1px 3px rgba(0,0,0,0.05);
  padding: 2.5rem 2rem 2rem;
  border: 1px solid var(--color-border);
}

.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.45rem;
  letter-spacing: -0.02em;
}
.login-header p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.55;
}

.tab-nav {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.825rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}
.tab-btn:hover { color: #1e293b; }
.tab-btn.active {
  background: #fff;
  color: #003d82;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tab-icon { font-size: 0.95rem; }
.tab-count {
  background: #e2e8f0;
  color: #475569;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.2rem;
}
.tab-btn.active .tab-count { background: #003d82; color: #fff; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}
.form-control {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.15s ease;
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: #003d82;
  box-shadow: 0 0 0 3px rgba(0,61,130,0.10);
}
.required { color: #ef4444; font-weight: 700; }
.optional { color: #94a3b8; font-weight: 500; font-size: 0.75rem; }

.btn {
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, #003d82, #0056b3);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,61,130,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #002a5c, #003d82);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,61,130,0.30);
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 6px rgba(16,185,129,0.25);
}
.btn-success:hover {
  background: linear-gradient(135deg, #047857, #059669);
}
.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.btn-block { width: 100%; }
.btn-small { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

.auth-secondary-actions {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}
.btn-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  padding: 0.5rem;
}
.btn-link strong { color: #003d82; }
.btn-link:hover { color: #003d82; }

.registrasi-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
}
.registrasi-header { text-align: center; margin-bottom: 1.25rem; }
.registrasi-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.registrasi-header p { font-size: 0.825rem; color: #64748b; }

.registrasi-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.registrasi-actions .btn { flex: 1; }

.success-card { text-align: center; }
.success-icon { margin-bottom: 1rem; display: flex; justify-content: center; }
.success-badge {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(16,185,129,0.30);
}
.kode-login-display {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.kode-login-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.kode-login-value {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0c4a6e;
  letter-spacing: 0.1em;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px dashed #93c5fd;
  margin-bottom: 0.75rem;
  word-break: break-all;
}
.kode-login-meta { font-size: 0.85rem; color: #0c4a6e; margin-bottom: 0.75rem; }
.kode-login-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.kode-login-actions .btn { flex: 1; min-width: 100px; }

.peserta-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.peserta-toolbar .form-control { flex: 1; }

.page-footer {
  text-align: center;
  padding: 1rem;
  color: #64748b;
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* CATATAN (v2.1): link admin versi footer sudah dihapus agar tidak duplikat.
   Sekarang hanya ada satu link "Masuk sebagai Admin", yaitu yang dekat
   dengan form login (class .admin-quick-link). */

/* Link admin versi ringkas, ditaruh dekat dengan form login (bukan di footer jauh) */
.admin-quick-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: rgba(186, 230, 253, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}
.admin-quick-link:hover {
  color: #e0f2fe;
  text-decoration: underline;
}
.admin-quick-link strong {
  color: #fcd34d;
  font-weight: 600;
}

/* ===== Halaman Daftar (daftar.html) ===== */
.halaman-daftar .login-container {
  min-height: calc(100vh - 64px - 50px);
}

.daftar-box {
  max-width: 540px;
}

/* Card sukses di halaman daftar: tampil di bawah form, bukan tab terpisah */
.halaman-daftar .success-card {
  margin: 0 auto;
  max-width: 540px;
}
.halaman-daftar .success-card .registrasi-header h2 {
  color: #fff;
}
.halaman-daftar .success-card .registrasi-header p {
  color: rgba(226, 232, 240, 0.75);
}
.halaman-daftar .success-card .kode-login-display {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.halaman-daftar .success-card .kode-login-meta {
  color: rgba(226, 232, 240, 0.75);
}

/* Tombol success di halaman daftar */
.halaman-daftar .btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.halaman-daftar .btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857, #059669);
}

/* Label required / optional di halaman daftar */
.halaman-daftar .form-group .required { color: #fca5a5; }
.halaman-daftar .form-group .optional {
  color: rgba(226, 232, 240, 0.5);
  font-size: 0.8rem;
  font-weight: 400;
}

/* Alert di halaman daftar */
.halaman-daftar .form-alert.error {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}
.halaman-daftar .form-alert.success {
  background: rgba(6, 78, 59, 0.35);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}
.halaman-daftar .error-msg { color: #fca5a5; }
.halaman-daftar .form-control.error { border-color: #ef4444; }

/* Tombol "Sudah punya akun" di bawah form daftar */
.halaman-daftar .auth-secondary-actions { margin-top: 1.25rem; }

/* ============================================================================
   LOGIN 2 PANEL — PESERTA (kiri) + PORTAL ADMIN (kanan, tersembunyi)
   ----------------------------------------------------------------------------
   TEMA: TERAWANG/BIRU — disamakan dengan dashboard.html, tryout.html,
   dan result.html yang memakai style.css (--color-primary: #003d82).
   Jadi index.html & daftar.html sekarang satu warna dengan halaman ujian.
   ============================================================================ */
.login-container {
  position: relative;
  background: var(--color-bg);
  color: var(--color-text);
}

/* Pola geometris sangat halus (mengikuti nuansa dashboard yang bersih) */
.login-container::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(30deg, rgba(0,61,130,0.04) 12%, transparent 12.5%, transparent 87%, rgba(0,61,130,0.04) 87.5%, rgba(0,61,130,0.04)),
    linear-gradient(150deg, rgba(0,61,130,0.04) 12%, transparent 12.5%, transparent 87%, rgba(0,61,130,0.04) 87.5%, rgba(0,61,130,0.04));
  background-size: 72px 124px;
}
.login-container::after { display: none; }

.login-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== HANDLE SWIPE (mobile/tablet): strip kecil di bawah/atas ===== */
.swipe-handle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  touch-action: pan-y;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.swipe-handle:hover { background: rgba(255, 255, 255, 0.15); }
.swipe-handle-grip {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
}
.swipe-handle-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

/* ===== PANEL ADMIN (drawer dari kanan, default TERSEMBUNYI) ===== */
.admin-portal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  background: linear-gradient(160deg, #0b1b3a 0%, #0e2a5c 55%, #102f6b 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -12px 0 40px rgba(2, 8, 23, 0.45);
  padding: 2rem 1.5rem;
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 90;
  color: #e2e8f0;
}
.admin-portal.open {
  transform: translateX(0);
}

.admin-portal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.admin-portal-close:hover { background: rgba(255, 255, 255, 0.18); }

.admin-portal-head { text-align: center; margin-bottom: 1.25rem; }
.admin-portal-icon { font-size: 2.2rem; line-height: 1; }
.admin-portal-head h2 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}
.admin-portal-head p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

.admin-portal-toggle {
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}
.admin-portal-toggle:hover { background: rgba(255, 255, 255, 0.14); }

/* Tombol "Login sebagai Admin" membuka form (state 2) */
.admin-portal.form-open .admin-portal-toggle {
  display: none;
}
.admin-portal .admin-quick-form { display: none; }
.admin-portal.form-open .admin-quick-form { display: block; }

.admin-quick-form .form-group label {
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.8rem;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
  pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 2.4rem; }
.admin-portal .form-control {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
}
.admin-portal .form-control::placeholder { color: rgba(226, 232, 240, 0.45); }
.admin-portal .form-control:focus {
  background: rgba(255, 255, 255, 0.11);
  border-color: #fbbf24;
  outline: none;
}

.btn-admin {
  background: linear-gradient(135deg, #b45309, #92400e);
  border: 2px solid #f59e0b;
  color: #fff;
  font-weight: 700;
}
.btn-admin:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #fbbf24;
}

.admin-portal-note {
  margin-top: 1.1rem;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.6);
  text-align: center;
}

/* ===== BACKDROP saat admin portal terbuka ===== */
.swipe-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 85;
}
.swipe-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* ===== Desktop besar: dua panel berdampingan (admin tetap bisa dibuka) ===== */
@media (min-width: 1101px) {
  .admin-portal {
    position: sticky;
    top: 88px;
    align-self: flex-start;
    bottom: auto;
    height: auto;
    max-height: calc(100vh - 120px);
    width: 360px;
    transform: none;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow);
    display: none;
  }
  .admin-portal.open { display: block; }
  .swipe-backdrop { display: none; }
}

/* ============================
   DARK THEME untuk area login
   ============================ */

/* Label form di dalam login-box */
.login-box .form-group label {
  color: rgba(226, 232, 240, 0.9);
  font-weight: 600;
}

/* Input di dalam login-box: semi-transparan gelap */
.login-box .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.login-box .form-control::placeholder {
  color: rgba(226, 232, 240, 0.45);
}
.login-box .form-control:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  outline: none;
}

/* CATATAN (v2.1): styling <select>/<option> TIDAK lagi diatur di file ini.
   Semuanya dipindah ke css/theme-light.css (tema terang) supaya:
   1. Tidak ada duplikasi background-image yang bikin panah dropdown ter-tiling.
   2. Warna konsisten dengan halaman dashboard/tryout/result.
   Referensi styling select yang dipakai:
     - css/style.css      (dasar: cursor + panah default)
     - css/theme-light.css (warna terang + panah biru SNBT) */

/* Tombol utama: biru gradient seperti gambar */
.login-box .btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.login-box .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.45);
}

/* Tombol secondary di login-box */
.login-box .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}
.login-box .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Tab button styling (dark) */
.login-box .tab-btn {
  color: rgba(226, 232, 240, 0.75);
  border-radius: 9px;
}
.login-box .tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.login-box .tab-btn.active {
  background: rgba(255, 255, 255, 0.94);
  color: #0b2d5e;
  box-shadow: 0 2px 8px rgba(2, 8, 23, 0.25);
}

/* Link "Daftar sekarang" */
.login-box .btn-link {
  color: #93c5fd;
}
.login-box .btn-link strong { color: #bfdbfe; }

/* Garis pemisah */
.login-box .form-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Peserta list di halaman login */
.login-box .peserta-item,
.registrasi-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.login-box .peserta-nama { color: #fff; }
.login-box .peserta-meta,
.login-box .peserta-time { color: rgba(226, 232, 240, 0.6); }
.login-box .peserta-empty {
  color: rgba(226, 232, 240, 0.55);
}

/* Alert di dalam login-box */
.login-box .form-alert.error {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}
.login-box .form-alert.success {
  background: rgba(6, 78, 59, 0.35);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

/* Field error */
.login-box .error-msg { color: #fca5a5; }
.login-box .form-control.error { border-color: #ef4444; }

/* Registrasi card sukses */
.login-box .kode-login-display {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.login-box .kode-login-meta { color: rgba(226, 232, 240, 0.75); }

/* Judul registrasi */
.login-box .registrasi-header h2 { color: #fff; }
.login-box .registrasi-header p { color: rgba(226, 232, 240, 0.7); }

/* Footer */
.page-footer {
  background: rgba(4, 15, 35, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(226, 232, 240, 0.6);
}

/* Input icon wrapper */
.input-icon-wrap .input-icon { opacity: 0.5; }

@media (max-width: 640px) {
  .brand-bar-inner { padding: 0.65rem 1rem; }
  .brand-text span { display: none; }
  .login-container { padding: 1.5rem 0.75rem; }
  .login-box { padding: 1.5rem 1.25rem; }
  .login-header h1 { font-size: 1.25rem; }
  .tab-btn { font-size: 0.75rem; padding: 0.5rem 0.25rem; }
  .tab-icon { font-size: 0.85rem; }
  .registrasi-actions { flex-direction: column; }
}