:root {
  --navy: #1f3a5f;
  --navy-dark: #182f4e;
  --gold: #c9a24a;
  --gold-dark: #b08c3c;
  --ink: #121c2b;
  --muted: #6b7480;
  --line: #e3e2dc;
  --bg: #f7f7f4;
  --card: #ffffff;
  --error: #c0392b;
  --ok: #1f7a4d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
button, input { font: inherit; }
a { color: var(--navy); }

/* Header */
.site-header {
  background: var(--navy);
  padding: 14px 16px;
  display: flex;
  justify-content: center;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { width: 26px; height: 26px; }
.logo-text { font-size: 1.35rem; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.logo-accent { color: var(--gold); }

/* Auth layout */
.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 56px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 8px 30px rgba(18, 28, 43, 0.06);
}
.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--navy-dark);
}
.auth-sub {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.auth-form { margin-top: 24px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: #a3a9b3; opacity: 1; }
.field input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12); }
.field input.invalid { border-color: var(--error); }
.field-error { display: none; color: var(--error); font-size: 0.82rem; }
.field-error.show { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Password field with eye toggle */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: #8a909b; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.eye:hover { color: var(--navy); background: #f3f3f0; }
.eye svg { width: 20px; height: 20px; }
.eye .eye-closed { display: none; }
.eye.showing .eye-open { display: none; }
.eye.showing .eye-closed { display: block; }

/* Remember me / forgot row */
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); font-size: 0.88rem; cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* Subtle back button */
.back-btn {
  display: inline-flex; align-items: center; gap: 2px;
  margin: -8px 0 10px -8px; padding: 6px 10px 6px 6px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.back-btn:hover { color: var(--navy); background: #f3f3f0; }
.back-btn svg { width: 18px; height: 18px; }
.btn-icon { width: 20px; height: 20px; flex: none; }

.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.7; cursor: wait; }
.btn-primary { background: var(--gold); color: var(--navy-dark); text-decoration: none; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-google { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-google:hover { background: #f3f3f0; }
.btn-google svg { width: 20px; height: 20px; flex: none; }
.btn-link { background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font-size: 0.9rem; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-note {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.auth-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.auth-status.error { background: #fdecea; color: var(--error); }
.auth-status.ok { background: #e8f5ee; color: var(--ok); }

/* "Check your email" state */
.sent-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%; background: #e8f5ee; color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.sent-email { font-weight: 600; color: var(--ink); }

/* Signed-in placeholder */
.account { display: grid; gap: 10px; text-align: center; }
.account .email { font-weight: 600; word-break: break-all; }

/* App header variant with a right-side action */
.site-header-app { justify-content: space-between; padding-left: 20px; padding-right: 20px; }
.header-link { background: none; border: 0; color: rgba(255,255,255,0.85); font-size: 0.88rem; font-weight: 500; cursor: pointer; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.header-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Wizard */
.wizard { max-width: 560px; }
.wizard-progress { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin: -6px 0 14px; }
.wizard-bar { height: 100%; background: var(--gold); width: 0; transition: width 0.3s; }
.wizard-step { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-title.left, .auth-sub.left { text-align: left; }
.auth-sub.left { margin-bottom: 4px; }
.wizard-fields { margin-top: 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid .field { grid-column: 1 / -1; }
.field-grid .field.half { grid-column: span 1; }
.field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 1rem; outline: none; resize: vertical; font-family: inherit;
}
.chip, .header-link, .btn-ghost { font-family: inherit; }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%236b7480' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field textarea:focus, .field select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12); }
.field textarea::placeholder { color: #a3a9b3; }
.optional { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: 0.9rem; cursor: pointer; transition: all 0.12s; text-align: left;
}
.chip:hover { border-color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.wizard-actions { display: flex; gap: 10px; margin-top: 22px; }
.wizard-actions .btn { width: auto; flex: 1; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f3f3f0; }
.upload-box { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; margin-top: 18px; display: grid; gap: 12px; text-align: center; transition: border-color 0.15s, background 0.15s; }
.upload-box.over { border-color: var(--gold); background: #fdf8ec; }
.upload-box .field { text-align: left; }
.upload-box .btn { width: auto; justify-self: center; min-width: 200px; }
.small { font-size: 0.8rem; }
.doc-list { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.doc-list li div { display: grid; gap: 2px; min-width: 0; }
.doc-list strong { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list li.muted { border-style: dashed; justify-content: center; }

/* Dashboard */
.dash { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 16px 48px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head .muted { font-size: 0.9rem; }
.dash-title { font-size: 1.7rem; color: var(--navy-dark); line-height: 1.15; }
.status-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #eef0f3; color: var(--muted); }
.status-pill.amber { background: #fdf3dc; color: #8a6412; }
.status-pill.blue { background: #e4ecf7; color: var(--navy); }
.status-pill.green { background: #e8f5ee; color: var(--ok); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 10px; align-content: start; }
.card h2 { font-size: 1.05rem; color: var(--navy-dark); }
.card .btn { margin-top: 6px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-muted { background: #fbfbf9; }
.card .big { font-size: 1.05rem; font-weight: 600; }
.steps { list-style: none; display: grid; gap: 8px; margin-top: 6px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.steps .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: #fff; flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now .dot { border-color: var(--gold); background: var(--gold); }
.meter-wide { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter-wide span { display: block; height: 100%; background: var(--gold); width: 0; transition: width 0.3s; }
.bullets { padding-left: 18px; display: grid; gap: 6px; font-size: 0.9rem; }

@media (max-width: 480px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .field.half { grid-column: 1 / -1; }
  .wizard-actions { flex-direction: column-reverse; }
}

.site-footer {
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 18px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .auth-main { padding: 24px 14px 40px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 14px; }
  .auth-title { font-size: 1.4rem; }
}
