:root {
  --primary: #8b1a3a;
  --primary-dark: #6b1230;
  --primary-light: #fdf2f4;
  --accent: #c9a227;
  --text: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #7c7c96;
  --border: #e8e8f0;
  --border-light: #f0f0f5;
  --bg: #f7f7fa;
  --surface: #ffffff;
  --footer: #1a1a2e;
  --footer-text: #c7c7d1;
  --footer-muted: #9ca3af;
  --shadow: 0 8px 24px rgba(26, 26, 46, 0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header — matches frontend AuthHeader */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.logo-accent {
  color: var(--text);
  font-weight: 600;
}

.logo-accent-light {
  color: rgba(255, 255, 255, 0.95);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.header-btn-primary {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Hero */
.hero {
  padding: 48px 0 24px;
}

.hero-inner {
  text-align: center;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1 {
  margin: 0 0 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--text);
}

.hero-lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Portal cards */
.portal-grid {
  padding: 24px 0 64px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26, 26, 46, 0.12);
  border-color: rgba(139, 26, 58, 0.2);
}

.portal-card-alt {
  background: linear-gradient(180deg, #fff 0%, #fdf8fa 100%);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-icon-alt {
  background: #fef9e7;
  color: var(--accent);
}

.portal-card h2 {
  margin: 0 0 4px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  color: var(--text);
}

.card-url {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.portal-card p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-points {
  margin: 0 0 24px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.card-points li + li {
  margin-top: 6px;
}

.btn {
  margin-top: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--text);
  color: #fff;
}

.btn-secondary:hover {
  background: #2a2a42;
}

.btn-hint {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

/* Footer — matches frontend SiteFooter */
.site-footer {
  background: var(--footer);
  color: var(--footer-text);
  padding: 48px 0 24px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  gap: 32px;
  align-items: start;
}

.footer-directory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-link-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.footer-directory-col .footer-link-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer-link-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-link-cols li + li {
  margin-top: 4px;
}

.footer-link-cols a {
  font-size: 13px;
  color: var(--footer-text);
  line-height: 1.5;
}

.footer-link-cols a:hover,
.footer-link-accent:hover {
  color: #fff;
}

.footer-link-accent {
  font-weight: 600;
  color: #f9fafb;
}

.footer-view-all {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #f9fafb;
}

.footer-view-all:hover {
  color: #fff;
  text-decoration: underline;
}

.logo-light .logo-text {
  color: #fff;
}

.footer-tagline {
  margin: 12px 0 8px;
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 600;
}

.footer-copy {
  margin: 0 0 12px;
  max-width: 280px;
  font-size: 13px;
  color: var(--footer-muted);
  line-height: 1.5;
}

.footer-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.footer-auth a:hover {
  color: #fff;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--footer-muted);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li + li {
  margin-top: 4px;
}

.footer-col a {
  font-size: 13px;
  color: var(--footer-text);
  line-height: 1.5;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  margin: 0;
  font-size: 12px;
  color: var(--footer-muted);
}

/* Responsive */
@media (max-width: 1100px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-directory {
    grid-template-columns: 1fr;
  }

  .footer-directory-col .footer-link-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 32px;
  }

  .portal-card {
    padding: 24px;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-directory-col .footer-link-cols,
  .footer-link-cols {
    grid-template-columns: 1fr;
  }
}

/* 404 page */
.error-page {
  padding: 64px 0 80px;
}

.error-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.error-code {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  font-weight: 700;
  color: var(--primary);
}

.error-card h1 {
  margin: 0 0 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  color: var(--text);
}

.error-message {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.error-path {
  margin: 0 0 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.error-path code {
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.error-actions .btn {
  width: 100%;
  text-align: center;
  align-items: center;
}

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.error-links a {
  color: var(--primary);
  font-weight: 600;
}

.error-links a:hover {
  text-decoration: underline;
}

.error-dot {
  color: var(--text-muted);
}
