/* ============================================================
   Supreme Court of Ohio · Auth & Dashboard Styles (Institutional Judicial Theme)
   ============================================================ */

/* ── Header: mobile menu toggle + user/auth area ───────────── */
.header-inner { position: relative; }

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-auth-guest {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.header-auth-guest .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* User menu */
/* Theme Toggle Button & Dropdown */
.theme-menu-wrap {
  position: relative;
  display: inline-flex;
}
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  line-height: 1;
  padding: 0;
}
.theme-toggle-btn:hover {
  background: var(--surface3);
  border-color: var(--primary);
  transform: scale(1.08);
}
.theme-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-dropdown.open {
  display: flex;
}
.theme-dropdown-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.25rem;
}
.theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
  width: 100%;
}
.theme-dropdown-item:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.theme-dropdown-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.theme-dropdown-item .theme-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.theme-dropdown-item .theme-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.theme-dropdown-item .theme-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-deep);
}
.theme-dropdown-item.active .theme-name {
  color: var(--primary);
}
.theme-dropdown-item .theme-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.theme-dropdown-item .theme-check {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  opacity: 0;
}
.theme-dropdown-item.active .theme-check {
  opacity: 1;
}

/* Settings Theme Picker Cards */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.theme-card-option {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.theme-card-option:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.theme-card-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}
.theme-card-preview {
  height: 48px;
  border-radius: 8px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.25rem;
}
.theme-card-preview .swatch-main { flex: 2; height: 100%; }
.theme-card-preview .swatch-accent { flex: 1; height: 100%; }
.theme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.theme-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-deep);
}
.theme-card-option.active .theme-card-title {
  color: var(--primary);
}
.theme-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.theme-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  display: none;
}
.theme-card-option.active .theme-card-badge {
  display: inline-block;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.user-menu-trigger:hover {
  background: var(--surface3);
  border-color: var(--border-dark);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0052cc 60%, #072752 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 82, 204, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.user-avatar.lg {
  width: 90px;
  height: 90px;
  font-size: 2rem;
  box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}
.user-menu-name { font-size: 0.875rem; font-weight: 700; color: var(--primary-deep); }
.user-menu-caret { color: var(--text-muted); font-size: 0.65rem; transition: transform 0.15s; }
.user-menu.open .user-menu-caret { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 290px;
  min-width: 290px;
  max-width: calc(100vw - 2rem);
  background: var(--surface, #ffffff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 48px -6px rgba(11, 35, 65, 0.22), 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 0.75rem;
  z-index: 99999;
  display: none;
  white-space: normal !important;
  box-sizing: border-box;
  animation: userMenuPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-menu.open .user-menu-dropdown { display: block; }
@keyframes userMenuPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-menu-header {
  padding: 0.8rem 0.95rem;
  background: var(--surface2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box;
}
.user-menu-header-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary-deep, #0b2341);
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.user-menu-header-email {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  white-space: normal !important;
  word-break: break-all !important;
  line-height: 1.3;
}
.user-menu-role-tag {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #bae6fd;
}

.user-menu-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-menu-box,
.user-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  text-decoration: none;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.user-menu-box:hover,
.user-menu-item:hover {
  background: var(--surface2, #f1f5f9);
  border-color: #cbd5e1;
  color: var(--primary, #0052cc);
  transform: translateX(3px);
  box-shadow: 0 3px 8px rgba(0, 82, 204, 0.08);
}

.user-menu-box-label {
  flex: 1;
}
.user-menu-box-arrow {
  font-size: 0.85rem;
  color: #94a3b8;
  transition: transform 0.16s ease, color 0.16s ease;
  font-weight: 700;
  margin-left: 0.5rem;
}
.user-menu-box:hover .user-menu-box-arrow,
.user-menu-item:hover .user-menu-box-arrow {
  color: var(--primary, #0052cc);
  transform: translateX(2px);
}

.user-menu-box.admin-box,
.user-menu-item.admin-item {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
}
.user-menu-box.admin-box:hover,
.user-menu-item.admin-item:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}
.user-menu-box-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: #2563eb;
  color: #ffffff;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-menu-divider {
  height: 1px;
  background: var(--border, #e2e8f0);
  margin: 0.55rem 0;
}

.user-menu-box.danger,
.user-menu-item.danger {
  background: #fff8f8;
  border: 1px solid #fee2e2;
  color: #dc2626;
  font-weight: 600;
}
.user-menu-box.danger:hover,
.user-menu-item.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  transform: translateX(3px);
}

/* Mobile nav */
.mobile-menu-btn {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-btn span, .mobile-menu-btn::before, .mobile-menu-btn::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--primary-deep); border-radius: 2px;
  position: relative; transition: transform 0.2s;
}
.mobile-menu-btn::before { position: absolute; transform: translateY(-6px); }
.mobile-menu-btn::after { position: absolute; transform: translateY(6px); }

@media (max-width: 860px) {
  .header-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    padding: 0.65rem;
    gap: 0.2rem;
    display: none;
  }
  .header-nav.open { display: flex; }
  .nav-link { padding: 0.75rem 1rem; width: 100%; }
  .nav-dropdown { width: 100%; flex-direction: column; align-items: flex-start; }
  .nav-dropdown-trigger { width: 100%; justify-content: space-between; padding: 0.75rem 1rem; }
  .nav-dropdown-menu {
    position: static;
    transform: none !important;
    width: 100%;
    box-shadow: none;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
  }
  .mobile-menu-btn { display: flex; }
  .header-auth-desktop-name { display: none; }
}

/* ── Auth pages (login/signup/forgot) ───────────────────────── */
.auth-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  background: var(--bg);
  position: relative;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 320px;
  background: radial-gradient(ellipse at center, var(--primary-light) 0%, transparent 70%);
  opacity: 0.8;
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.25rem;
  position: relative;
  z-index: 1;
}
.auth-logo-row {
  display: flex; align-items: center; gap: 0.65rem;
  justify-content: center; margin-bottom: 1.5rem; text-decoration: none;
}
.auth-title { font-size: 1.55rem; font-weight: 800; color: var(--primary-deep); text-align: center; letter-spacing: -0.03em; }
.auth-sub { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin-top: 0.35rem; margin-bottom: 2rem; }

.form-field { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 0.45rem; }
.form-input-wrap { position: relative; }
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input.has-error { border-color: var(--incorrect); }
.form-input[type="password"] { padding-right: 2.75rem; }
.form-error-text { display: none; font-size: 0.78rem; color: var(--incorrect); margin-top: 0.35rem; font-weight: 500; }
.form-error-text.show { display: block; }
.form-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.35rem; }

.password-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--primary);
  font-size: 0.8rem; font-weight: 700; padding: 0.25rem 0.4rem; font-family: inherit;
}
.password-toggle:hover { color: var(--primary-dark); }

.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.link-inline { color: var(--primary); font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.link-inline:hover { text-decoration: underline; color: var(--primary-dark); }

/* ── Custom Searchable Select Dropdown ────────────────────────── */
.custom-select-wrap {
  position: relative;
  width: 100%;
}
.custom-select-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}
.custom-select-btn:hover {
  border-color: var(--primary);
  background: var(--surface2);
}
.custom-select-wrap.open .custom-select-btn,
.custom-select-btn:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
  background: var(--surface);
}
.custom-select-btn.is-placeholder .custom-select-value {
  color: var(--text-muted);
}
.custom-select-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-arrow {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.custom-select-wrap.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 48px -4px rgba(11, 35, 65, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: 99999;
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  max-height: 360px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: selectDropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes selectDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.custom-select-wrap.open .custom-select-dropdown {
  display: flex;
}

.custom-select-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.custom-select-search-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.6;
}
.custom-select-search-input {
  width: 100%;
  padding: 0.55rem 1.8rem 0.55rem 2.05rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.custom-select-search-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}
.custom-select-clear-search {
  position: absolute;
  right: 0.55rem;
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.custom-select-clear-search:hover {
  background: var(--surface3);
  color: var(--text);
}

.custom-select-options {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--surface2);
}
.custom-select-options::-webkit-scrollbar {
  width: 8px;
}
.custom-select-options::-webkit-scrollbar-track {
  background: var(--surface2);
  border-radius: 4px;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
  cursor: pointer;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
.custom-select-option {
  padding: 0.58rem 0.75rem;
  border-radius: 8px;
  font-size: 0.87rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}
.custom-select-option:hover,
.custom-select-option.is-focused {
  background: var(--surface2);
  color: var(--primary);
}
.custom-select-option.is-selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.custom-select-option mark {
  background: rgba(251, 191, 36, 0.35);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 700;
}
.custom-select-check {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}
.custom-select-no-results {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer-line { text-align: center; font-size: 0.88rem; color: var(--text-muted); margin-top: 1.75rem; }

.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.auth-alert.show { display: flex; }
.auth-alert.error { background: var(--incorrect-bg); border: 1px solid var(--incorrect-border); color: #991b1b; }
.auth-alert.success { background: var(--correct-bg); border: 1px solid var(--correct-border); color: #065f46; }

.auth-success-state { text-align: center; display: none; }
.auth-success-state.show { display: block; }
.auth-success-icon {
  width: 60px; height: 60px; border-radius: 50%; background: var(--correct-bg); border: 2px solid var(--correct-border);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 1.25rem;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.15);
}

/* ── Dashboard ───────────────────────────────────────────────── */
.dash-welcome { margin-bottom: 2rem; }
.dash-welcome h1 { font-size: 1.65rem; font-weight: 800; color: var(--primary-deep); letter-spacing: -0.03em; }
.dash-welcome p { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.35rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 2rem;
}
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.25rem 1.35rem; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card-value { font-size: 1.65rem; font-weight: 800; color: var(--primary-deep); letter-spacing: -0.02em; }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.progress-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-sm); padding: 1.75rem; margin-bottom: 2rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.progress-ring-wrap { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--surface3); stroke-width: 10; }
.progress-ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.progress-ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: var(--primary-deep);
}
.progress-hero-info { flex: 1; min-width: 220px; }
.progress-hero-info h2 { font-size: 1.15rem; font-weight: 800; color: var(--primary-deep); margin-bottom: 0.4rem; }
.progress-hero-info p { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }

.continue-card {
  background: linear-gradient(135deg, #07172c 0%, #0b2341 60%, #0d3460 100%);
  border-radius: 16px; padding: 1.65rem 1.85rem; margin-bottom: 2rem;
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.continue-card-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7dd3fc; font-weight: 800; margin-bottom: 0.4rem; }
.continue-card-title { font-size: 1.2rem; font-weight: 800; color: #ffffff; }
.continue-card-sub { font-size: 0.88rem; color: #cbd5e1; margin-top: 0.3rem; }

/* ── Module Progress List ────────────────────────────────────── */
.module-progress-list { display: flex; flex-direction: column; gap: 0.85rem; }
.module-progress-row {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.module-progress-row:hover { border-color: var(--border-dark); background: var(--surface2); }
.module-progress-row.done { border-color: var(--correct-border); background: var(--correct-bg); }
.module-progress-row.locked { opacity: 0.65; }
.module-progress-num {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #004ea8);
  color: #fff; font-weight: 800; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 96, 214, 0.25);
}
.module-progress-row.done .module-progress-num { background: var(--correct); }
.module-progress-row.locked .module-progress-num { background: #64748b; box-shadow: none; }
.module-progress-body { flex: 1; min-width: 0; }
.module-progress-title { font-size: 0.95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-progress-bar-track { height: 7px; background: var(--surface3); border-radius: 999px; overflow: hidden; margin-top: 0.55rem; }
.module-progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width 0.4s ease; }
.module-progress-row.done .module-progress-bar-fill { background: var(--correct); }
.module-progress-status { font-size: 0.82rem; font-weight: 700; flex-shrink: 0; }
.done-text { color: var(--correct); }
.locked-text { color: var(--text-muted); }
.progress-text { color: var(--primary); }

/* ── Score Table ─────────────────────────────────────────────── */
.score-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.score-table th {
  background: var(--surface2); color: var(--primary-deep); font-weight: 800;
  text-align: left; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--border);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.score-table td { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.score-table tr:last-child td { border-bottom: none; }
.score-table tr:hover td { background: var(--surface2); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge-green { background: var(--correct-bg); color: var(--correct); border: 1px solid var(--correct-border); }
.badge-amber { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(0, 96, 214, 0.3); }
.badge-gray { background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.75rem 1.5rem; color: var(--text-muted); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state-title { font-size: 1.05rem; font-weight: 700; color: var(--primary-deep); margin-bottom: 0.3rem; }
.empty-state-sub { font-size: 0.85rem; color: var(--text-muted); }

/* ── Skeletons ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #edf2f7 25%, #f7fafc 50%, #edf2f7 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 16px; margin-bottom: 6px; border-radius: 4px; }

/* ── Profile page ────────────────────────────────────────────── */
.profile-header-card { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.profile-header-name { font-size: 1.3rem; font-weight: 800; color: var(--primary-deep); }
.profile-header-email { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.2rem; }
.profile-header-meta { font-size: 0.8rem; color: var(--text-light); margin-top: 0.35rem; }
.profile-data-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.profile-data-row:last-child { border-bottom: none; }
.profile-data-label { color: var(--text-muted); font-weight: 600; }
.profile-data-value { font-weight: 700; color: var(--primary-deep); }

/* ── 404 page ────────────────────────────────────────────────── */
.notfound-wrap {
  min-height: calc(100vh - 68px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.5rem;
}
.notfound-code {
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), #0284c7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}
.notfound-title { font-size: 1.75rem; font-weight: 800; color: var(--primary-deep); margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.notfound-sub { color: var(--text-muted); font-size: 1rem; max-width: 480px; margin-bottom: 2rem; line-height: 1.6; }
.notfound-actions { display: flex; gap: 0.85rem; flex-wrap: wrap; justify-content: center; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--primary-deep); color: #fff;
  padding: 0.85rem 1.35rem; border-radius: 12px;
  font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  z-index: 500;
  display: flex; align-items: center; gap: 0.6rem;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Prevent FOUC on auth-guarded pages ──────────────────────── */
body[data-auth-checking] main,
body[data-auth-checking] .page-hero,
body[data-auth-checking] .site-header {
  visibility: hidden;
}

/* ============================================================
   STARTUP SPLASH SCREEN / INTRO ANIMATION
   ============================================================ */
.cfe-splash-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, #0d284c 0%, #07172c 70%, #030b17 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cfe-splash-overlay.fade-out {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.cfe-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  max-width: 440px;
}

.cfe-splash-icon-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.cfe-splash-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0060d6 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(0, 96, 214, 0.6), 0 0 60px rgba(2, 132, 199, 0.3);
  animation: splashIconPop 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  z-index: 2;
}

.cfe-splash-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 26px;
  background: rgba(0, 96, 214, 0.3);
  animation: splashPulseRing 1.8s infinite cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

.cfe-splash-title {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
  animation: splashTextIn 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cfe-splash-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: splashSubIn 0.8s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin-bottom: 1.75rem;
}

.cfe-splash-loader {
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.cfe-splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0060d6, #38bdf8);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  animation: splashProgressFill 1.1s 0.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes splashIconPop {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes splashPulseRing {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}

@keyframes splashTextIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splashSubIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splashProgressFill {
  0% { width: 0%; }
  60% { width: 70%; }
  100% { width: 100%; }
}

/* ============================================================
   ACHIEVEMENT UNLOCKED POP-UP MODAL
   ============================================================ */
.achievement-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 35, 65, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.achievement-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.achievement-card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  padding: 2.75rem 2.25rem;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  color: #ffffff;
}
.achievement-modal-overlay.show .achievement-card {
  transform: scale(1) translateY(0);
}
.achievement-confetti {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  animation: bounceTrophy 1s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}
@keyframes bounceTrophy {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.08); }
}
.achievement-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d95a1e, #ea580c);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(217, 90, 30, 0.3);
}
.achievement-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff !important;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.achievement-sub {
  font-size: 0.95rem;
  color: #cbd5e1 !important;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}
.achievement-sub strong {
  color: #38bdf8 !important;
}
.achievement-email-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  color: #34d399;
  font-size: 0.86rem;
  color: #14532d;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  line-height: 1.45;
  margin-bottom: 1.75rem;
}
.achievement-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Authorized Use Disclaimer & Agreement Box ──────────────── */
.disclaimer-wrap {
  margin-top: 1.15rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.disclaimer-wrap.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: disclaimerShake 0.4s ease;
}
@keyframes disclaimerShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.disclaimer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--surface3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.disclaimer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--primary-deep);
  font-weight: 700;
}
.disclaimer-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.disclaimer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.disclaimer-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.disclaimer-body {
  max-height: 95px;
  overflow-y: auto;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) var(--surface2);
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.disclaimer-wrap.expanded .disclaimer-body {
  max-height: 240px;
}
.disclaimer-body::-webkit-scrollbar {
  width: 6px;
}
.disclaimer-body::-webkit-scrollbar-track {
  background: var(--surface2);
}
.disclaimer-body::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
}
.disclaimer-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.disclaimer-body p {
  margin: 0 0 0.5rem 0;
}
.disclaimer-body p:last-child {
  margin-bottom: 0;
}
.disclaimer-body p strong {
  color: var(--text);
}
.agreement-row {
  margin-bottom: 1.25rem;
  padding: 0.2rem 0.1rem;
}
.agreement-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.agreement-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}
.agreement-row.has-error .agreement-label {
  color: #ef4444;
}

/* ── Email Multi-Factor Authentication (OTP) Styles ── */
.otp-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 20px;
}
.otp-digit {
  width: 48px;
  height: 58px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text, #0b2341);
  background: var(--surface2, #f8fafc);
  border: 2px solid var(--border-dark, #cbd5e1);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.otp-digit:focus {
  border-color: var(--primary, #0060d6);
  background: var(--surface, #ffffff);
  box-shadow: 0 0 0 4px rgba(0, 96, 214, 0.15);
  transform: translateY(-2px);
}
.otp-digit.filled {
  border-color: var(--primary, #0060d6);
  background: var(--surface3, #eff6ff);
}
.otp-digit.error {
  border-color: #dc2626;
  background: #fef2f2;
  animation: otpShake 0.4s ease-in-out;
}
@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.resend-box {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted, #64748b);
}
.btn-resend {
  background: none;
  border: none;
  color: var(--primary, #0060d6);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: underline;
}
.btn-resend:hover:not(:disabled) {
  color: var(--primary-hover, #004099);
  background: rgba(0, 96, 214, 0.08);
}
.btn-resend:disabled {
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  cursor: not-allowed;
}
.notice-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}


