/* SCI Portal — Premium Dark Theme
   Matches landing page palette per Bible §5 */

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-light: #1a1a25;
  --gold: #d4a843;
  --gold-bright: #f0c850;
  --gold-dim: #8a6f2d;
  --text: #e8e8f0;
  --text-dim: #6a6a80;
  --green: #3dd68c;
  --red: #ff5555;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Space Grotesk', sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

.gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }

/* ═══ LOGIN ═══ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  padding: 48px 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-wordmark {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  line-height: 1.4;
}

.login-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.3em;
  margin-top: 12px;
}

.login-error {
  background: rgba(255, 85, 85, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.btn-gold {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.btn-gold:hover {
  background: var(--gold-bright);
  color: var(--bg);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══ PORTAL NAV ═══ */
.portal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.nav-divider {
  color: var(--text-dim);
}

.nav-tier {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 4px 12px;
  border-radius: 3px;
  font-weight: 700;
}

.tier-apprentice { background: rgba(212, 168, 67, 0.15); color: var(--gold); }
.tier-journeyman { background: rgba(61, 214, 140, 0.15); color: var(--green); }
.tier-operator { background: rgba(240, 200, 80, 0.25); color: var(--gold-bright); }
.tier-grace { background: rgba(255, 85, 85, 0.15); color: var(--red); }
.tier-dropped { background: rgba(255, 85, 85, 0.1); color: var(--text-dim); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-email {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.nav-logout {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-logout:hover { color: var(--red); }

/* ═══ DASHBOARD LAYOUT ═══ */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.dashboard-main {
  flex: 7;
  padding: 32px;
  overflow-y: auto;
}

.dashboard-sidebar {
  flex: 3;
  padding: 32px 24px;
  background: var(--surface);
  border-left: 1px solid var(--surface-light);
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}

/* ═══ TAB NAVIGATION ═══ */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--surface-light);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 12px 20px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-link.tab-operator { color: var(--gold-dim); }
.tab-link.tab-operator.active { color: var(--gold-bright); }

/* Dropdown for Intel Drops */
.tab-dropdown { position: relative; }
.tab-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 4px;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tab-dropdown:hover .tab-dropdown-content { display: block; }

.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--surface-light);
  text-transform: capitalize;
}

.dropdown-item:hover {
  color: var(--gold);
  background: rgba(212, 168, 67, 0.05);
}

/* ═══ WELCOME TAB ═══ */
.welcome-tab { max-width: 800px; }

.welcome-header {
  margin-bottom: 40px;
}

.welcome-greeting {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-email {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.next-unlock-card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
}

.next-unlock-card.graduated {
  border-color: var(--gold-dim);
}

.next-unlock-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.countdown-display {
  margin-bottom: 16px;
}

.countdown-number {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.countdown-unit {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-left: 8px;
}

.next-unlock-title {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

/* ═══ PAYMENTS TABLE ═══ */
.recent-payments h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
}

.payments-table th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--surface-light);
}

.payments-table td {
  font-size: 0.85rem;
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-light);
}

/* ═══ SIDEBAR ═══ */
.sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 24px;
}

/* Progress bar */
.progress-section {
  margin-bottom: 28px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.progress-amount { color: var(--gold); }

.progress-bar {
  height: 6px;
  background: var(--surface-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
  margin-bottom: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--surface-light);
}

.timeline-item {
  position: relative;
  padding: 8px 0 8px 16px;
}

.timeline-dot {
  position: absolute;
  left: -17px;
  top: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-light);
  border: 2px solid var(--surface);
}

.timeline-item.unlocked .timeline-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 214, 140, 0.4);
}

.timeline-item.marquee .timeline-dot {
  width: 11px;
  height: 11px;
  left: -18px;
}

.timeline-item.marquee.unlocked .timeline-dot {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
}

.operator-dot {
  background: var(--gold-dim) !important;
  width: 13px;
  height: 13px;
  left: -19px !important;
}

.operator-milestone.unlocked .operator-dot {
  background: var(--gold-bright) !important;
  box-shadow: 0 0 16px rgba(240, 200, 80, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(240, 200, 80, 0.3); }
  50% { box-shadow: 0 0 20px rgba(240, 200, 80, 0.7); }
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.timeline-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.timeline-item.unlocked .timeline-title { color: var(--text); }
.timeline-item.unlocked .timeline-title a { color: var(--text); }
.timeline-item.unlocked .timeline-title a:hover { color: var(--gold); }

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* Sidebar indicator */
.sidebar-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-top: 1px solid var(--surface-light);
  margin-bottom: 20px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.indicator-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 214, 140, 0.5);
}

.indicator-dot.inactive {
  background: var(--red);
}

/* Pay-in-full */
.pay-full-section { text-align: center; }
.btn-pay-full { display: inline-block; width: auto; padding: 12px 24px; font-size: 0.75rem; }
.pay-full-note { font-size: 0.7rem; color: var(--text-dim); margin-top: 8px; }

/* ═══ CONTENT TABS ═══ */
.content-tab { max-width: 800px; }

.content-header, .marquee-header {
  margin-bottom: 32px;
}

.content-heading {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.content-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.content-description {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

.drop-badge, .marquee-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.drop-badge {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
}

.marquee-badge {
  background: rgba(240, 200, 80, 0.15);
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
}

/* PDF Cards */
.pdf-list, .pdf-bundle { display: flex; flex-direction: column; gap: 12px; }

.pdf-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 6px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.pdf-card:hover { border-color: var(--gold-dim); }

.pdf-icon {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.pdf-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdf-title {
  font-size: 0.9rem;
  color: var(--text);
}

.pdf-description {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.btn-download {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold);
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-download:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ═══ RESEARCH TAB ═══ */
.research-tab { max-width: 800px; }

.tab-heading {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}

.tab-description {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.research-section {
  margin-bottom: 32px;
}

.research-type-header {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.research-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.research-dot.active { background: var(--green); }

.research-list { display: flex; flex-direction: column; gap: 8px; }

.research-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 4px;
}

.research-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 90px;
}

.research-title { flex: 1; font-size: 0.85rem; }
.research-empty { color: var(--text-dim); font-size: 0.85rem; font-style: italic; }

/* ═══ OPERATOR TAB ═══ */
.operator-tab { max-width: 800px; }

.operator-header { text-align: center; margin-bottom: 40px; }

.graduation-badge { margin-bottom: 20px; }
.badge-img { width: 120px; height: 120px; }

.operator-title {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.operator-subtitle {
  color: var(--text-dim);
  margin-top: 12px;
}

.operator-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.operator-content h3, .token-notice h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 16px;
}

.operator-pdfs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }

.token-notice {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 24px;
}

.token-notice p { color: var(--text-dim); font-size: 0.9rem; }
.wallet-address { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold); margin-top: 12px; }

/* ═══ ERROR PAGES ═══ */
.error-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-container { text-align: center; }

.error-code {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1;
  margin-bottom: 16px;
}

.error-message {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--text);
  margin-bottom: 12px;
}

.error-detail {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .dashboard-layout { flex-direction: column; }
  .dashboard-sidebar {
    position: static;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--surface-light);
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .operator-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .portal-nav { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .nav-email { display: none; }
  .dashboard-main { padding: 20px 16px; }
  .dashboard-sidebar { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 32px 24px; }
  .tab-nav { overflow-x: auto; flex-wrap: nowrap; }
  .countdown-number { font-size: 3rem; }
  .pdf-card { flex-wrap: wrap; }
  .research-item { flex-wrap: wrap; }
  .research-date { width: auto; }
}
