/* Brand colors */
:root {
  --brand-navy: #002f59;
  --brand-red: #bb1c29;
  --brand-white: #ffffff;
  --text: #0f1a26;
  --muted: #6b7a8c;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #e5eaf0;
  --success: #1f9d55;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--brand-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.header {
  background: var(--brand-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--brand-navy); }
.logo-mark {
  width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-navy), #004a8a);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; letter-spacing: 0.5px;
}
.logo-img { height: 108px; width: auto; border-radius: 6px; display: block; }
.header { box-shadow: 0 1px 0 var(--border); }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--text); font-weight: 600; }

/* Hero */
.hero {
  background: radial-gradient(1200px 400px at 10% -10%, #0b457e1a, transparent),
              radial-gradient(800px 300px at 90% 0%, #bb1c2914, transparent),
              var(--brand-white);
}
.hero-inner { padding: 64px 0 48px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 12px; color: var(--brand-navy); }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 700; cursor: pointer;
}
.button.primary { background: var(--brand-red); color: #fff; box-shadow: 0 10px 20px rgba(187, 28, 41, 0.25); }
.button.primary:hover { filter: brightness(0.95); }
.button.secondary { background: var(--brand-navy); color: #fff; }
.button.ghost { background: transparent; color: var(--brand-navy); border: 1px solid var(--border); }

.hero-card {
  background: #07243e;
  color: #e8f2ff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 47, 89, 0.25);
}
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 12px 8px; align-items: start; }
.step + .step { border-top: 1px dashed rgba(255,255,255,0.15); }
.badge {
  width: 36px; height: 36px; border-radius: 10px; background: #0c3966; color: #e8f2ff; display: grid; place-items: center; font-weight: 800;
}
.step h3 { margin: 0 0 6px; font-size: 16px; color: #fff; }
.step p { margin: 0; font-size: 14px; color: #b9d4f5; }

/* Cards/Sections */
.section { padding: 56px 0; }
.section h2 { margin: 0 0 16px; color: var(--brand-navy); font-size: 28px; }
.section .sub { color: var(--muted); margin-bottom: 24px; }
.grid { display: grid; gap: 20px; }
.grid.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card h3 { margin-top: 0; }

  .list { margin: 0; padding: 0; list-style: none; }
  .list li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
  .list li:last-child { border-bottom: 0; }

  /* Forms */
  .form { display: grid; gap: 14px; }
  .field { display: grid; gap: 8px; }
  .field.inline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .label { font-weight: 700; color: var(--brand-navy); }
  .input, select, textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 14px; }
  textarea { min-height: 90px; resize: vertical; }
  .help { color: var(--muted); font-size: 12px; }
  .required { color: var(--brand-red); }

  /* Digital Signature Packet */
  .agreement { background: var(--card); }
  .agreement + .agreement { margin-top: 8px; }
  .section-title { margin: 0 0 8px; color: var(--brand-navy); font-size: 22px; }
  .text-block p { margin: 0 0 10px; }
  .text-block ol, .text-block ul { margin: 6px 0 10px 18px; }
  .text-block li { margin: 6px 0; }
  .ack { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
  .token { font-weight: 700; color: var(--text); border-bottom: 1px dashed var(--border); padding-bottom: 1px; }
  .inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
  .conditional { display: none; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; background: #fafcff; margin-top: 8px; }
  .conditional.show { display: block; }
  .signature { margin-top: 10px; }

  .notice { background: #fff5f6; border: 1px solid #ffd5d9; color: #7c1a23; padding: 12px 14px; border-radius: 12px; }
  .success { background: #eefcf3; border: 1px solid #c8f1d9; color: #14532d; padding: 12px 14px; border-radius: 12px; }
  .error { background: #fff4e5; border: 1px solid #ffd7ae; color: #7c411a; padding: 12px 14px; border-radius: 12px; }

.footer { background: var(--brand-navy); color: #d9e6f3; padding: 20px 0; margin-top: 40px; }
.footer a { color: #fff; }
.footer .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Callouts */
.callout { border: 1px solid var(--border); border-left-width: 6px; border-radius: 12px; padding: 14px 16px; background: #fff; }
.callout strong { display: inline-block; margin-bottom: 4px; }
.callout.tip { border-left-color: #0b5fa7; background: #eef6ff; }
.callout.important { border-left-color: var(--brand-red); background: #fff3f4; }

.print-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.print-note { font-size: 12px; color: var(--muted); }

  /* Print styles */
  @media print {
    .header, .footer, .hero, .cta-row, .nav { display: none !important; }
    body { background: #fff; color: #000; }
    .section { padding: 0; }
    .container { max-width: 100%; padding: 0; }
    .card { border: 0; border-radius: 0; box-shadow: none; }
    .agreement { page-break-inside: avoid; margin-bottom: 12px; }
    .token { border-bottom: 1px solid #000; }
  }

  /* Portal auth + chips */
  .auth {
    display: grid; gap: 14px; max-width: 760px; margin: 0 auto; text-align: left;
  }
  /* placeholder removed */
  .auth .sub { margin: 0; color: var(--muted); }
  .auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
  .auth-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .muted-input { opacity: 0.9; }

  /* chips */
  .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12px; color: var(--muted); }
  .chip.done { border-color: #c8f1d9; background: #eefcf3; color: #14532d; }
  .chip.todo { border-color: #ffe1a8; background: #fff9eb; color: #7c411a; }
  .progressbar { height: 8px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
  .progressbar > span { display: block; height: 8px; background: var(--brand-red); width: 0%; transition: width .25s ease; }

/* Disabled helpers */
.button[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.disabled { opacity: 0.5; pointer-events: none; }
.auth-page .section {
  background:
    radial-gradient(700px 260px at 12% -10%, rgba(11, 69, 126, 0.10), transparent),
    radial-gradient(640px 240px at 88% 0%, rgba(187, 28, 41, 0.08), transparent),
    var(--bg);
}
