:root {
  /* Gold/cream theme to match the landing page */
  --brand-1: #d4af37;   /* gold */
  --brand-2: #b5952f;   /* gold dark */
  --gold: #d4af37;
  --ink: #2c3e50;
  --muted: #606f7b;
  --line: #e5e7eb;
  --bg: #fcfcfc;
  --white: #ffffff;
  --footer-bg: #1a1a1a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Nav ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px; background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,.05); position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 48px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 1px; color: #000; line-height: 1; }
.brand-sub { font-size: 9px; color: var(--muted); letter-spacing: 2px; font-weight: 600; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav-links a:not(.btn):hover { color: var(--gold); }
.logout-form { display: inline; margin: 0; }
.nav-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; padding: 8px; margin: -8px; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 9px 22px; border-radius: 50px;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent;
  font-size: .9rem; text-transform: uppercase; letter-spacing: 1px;
  transition: all .3s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #fff; box-shadow: 0 4px 15px rgba(212,175,55,.3); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,.4); color: #fff; }
.btn-secondary, .btn-outline { background: transparent; color: var(--gold); border: 2px solid var(--gold); }
.btn-secondary:hover, .btn-outline:hover { background: var(--gold); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-lg { padding: 13px 30px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---- Hero ---- */
.main { flex: 1; }
.hero {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; text-align: center; padding: 90px 24px 80px;
}
.hero-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 78px; height: 78px; border-radius: 50%; margin-bottom: 24px;
  background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.4);
  font-size: 24px; font-weight: 700; letter-spacing: 1px;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 14px; }
.hero .lead { max-width: 620px; margin: 0 auto 30px; font-size: 1.15rem; opacity: .92; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Features ---- */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px; max-width: 1000px; margin: 56px auto; padding: 0 24px;
}
.feature-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 22px;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--muted); }

/* ---- Auth forms ---- */
.auth { display: flex; justify-content: center; padding: 56px 24px; }
.auth-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px; width: 100%; max-width: 420px; box-shadow: 0 6px 24px rgba(0,0,0,.04);
}
.auth-card h2 { margin-bottom: 22px; text-align: center; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; }
label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 1rem; background: #fff;
}
.form-input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.auth-card form > label { display: block; margin-top: 4px; }
.auth-card .btn-block { margin-top: 10px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); }
.help { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.field-error { color: #dc2626; font-size: .82rem; margin-top: 4px; }

/* ---- Messages ---- */
.messages { max-width: 1000px; margin: 16px auto 0; padding: 0 24px; }
.message { padding: 12px 16px; border-radius: 8px; margin-bottom: 10px; font-size: .92rem; }
.message.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.message.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ---- Dashboard ---- */
.dashboard { max-width: 900px; margin: 48px auto; padding: 0 24px; }
.dashboard h2 { margin-bottom: 4px; }
.muted { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 26px; }
.info-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.info-card h3 { margin-bottom: 14px; font-size: 1.05rem; }
.details { list-style: none; }
.details li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.details li:last-child { border-bottom: none; }
.status { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.status-active { background: #dcfce7; color: #15803d; }
.status-pending { background: #fef9c3; color: #a16207; }
.status-expired { background: #fee2e2; color: #b91c1c; }

/* ---- Footer ---- */
.footer { text-align: center; padding: 28px; color: #aaa; font-size: .85rem; background: var(--footer-bg); }
.footer a { color: var(--gold); }

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .nav { padding: 12px 16px; }
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(255,255,255,.98); backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    padding: 8px 16px 16px;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a, .nav-links .logout-form { width: 100%; }
  .nav-links a, .nav-links .btn { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-links .btn { text-align: center; border-bottom: none; margin-top: 8px; }
  .nav-links .logout-form .btn { width: 100%; }
  /* Animate burger into an X when open */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-rejected { background: #fee2e2; color: #b91c1c; }

/* AI-scan "please wait" banner (shown by uploader.js during OCR) */
.scan-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #92400e, #b45309); color: #fff;
  font-weight: 600; font-size: .95rem; text-align: center;
  padding: 14px 18px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.scan-banner .spinner { border-color: rgba(255,255,255,.55); border-top-color: transparent; }
@media (max-width: 560px) { .scan-banner { font-size: .85rem; padding: 12px 14px; } }

/* While a scan runs, lock every other action so the user can't jump ahead.
   The actively-scanning form keeps its own in-place progress/scan indicators. */
body.scan-locked .profile button,
body.scan-locked .profile a.btn,
body.scan-locked .profile input,
body.scan-locked .profile .dropzone,
body.scan-locked .profile details > summary {
  pointer-events: none;
  opacity: .5;
}
