:root {
  --ink: #10252b;
  --ink-soft: #315158;
  --paper: #f5f8f7;
  --panel: #ffffff;
  --line: #d8e4e0;
  --muted: #647876;
  --teal: #57c8bd;
  --teal-dark: #12766e;
  --teal-pale: #e7f6f3;
  --gold: #d6a849;
  --danger: #b74343;
  --shadow: 0 24px 70px rgba(16, 37, 43, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(87, 200, 189, .45); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.gate-view { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 40px 20px; background: radial-gradient(circle at 15% 12%, rgba(87, 200, 189, .16), transparent 30%), linear-gradient(145deg, #10252b, #183f45); color: #fff; }
.brand-mark { position: absolute; top: 35px; left: 5vw; font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark span, .brand span { color: var(--teal); }
.gate-card { width: min(100%, 480px); padding: 42px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(255,255,255,.08); box-shadow: 0 30px 90px rgba(0,0,0,.18); backdrop-filter: blur(16px); }
.gate-card h1 { margin: 0 0 14px; font-size: clamp(42px, 8vw, 68px); letter-spacing: -.06em; line-height: .98; }
.eyebrow { margin: 0 0 14px; color: var(--teal-dark); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.gate-card .eyebrow { color: var(--teal); }
.lede { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.gate-card .lede { color: #c6dcda; }
.stack-form { display: grid; gap: 10px; margin-top: 30px; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.gate-card label { color: #e9f5f3; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s; }
input:hover, textarea:hover { border-color: #a9c8c1; }
input:focus, textarea:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 4px rgba(87, 200, 189, .14); outline: 0; }
.input-with-action { display: flex; position: relative; }
.input-with-action input { padding-right: 70px; }
.icon-button { position: absolute; right: 7px; top: 6px; bottom: 6px; border: 0; border-radius: 5px; padding: 0 9px; color: var(--teal-dark); background: var(--teal-pale); font-size: 12px; font-weight: 800; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 8px; padding: 0 17px; font-size: 13px; font-weight: 850; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: var(--ink); background: var(--teal); }
.button.primary:hover { background: #76d8cf; }
.button.secondary { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.button.secondary:hover { border-color: #9fc1b9; background: #f8fcfb; }
.form-error { margin: 1px 0 4px; color: #ffb9b9; font-size: 12px; }
.privacy-note { display: flex; gap: 8px; align-items: center; margin: 26px 0 0; color: #a8c3c0; font-size: 11px; }
.lock-icon { color: var(--teal); font-size: 17px; }
.footer-note { margin: 30px 0 0; color: #9cb4b1; font-size: 11px; }

.workflow-view { min-height: 100vh; background: var(--paper); }
.topbar { height: 75px; display: flex; align-items: center; justify-content: space-between; padding: 0 6vw; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.brand { color: var(--ink); font-size: 17px; font-weight: 850; text-decoration: none; letter-spacing: -.035em; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.secure-status { color: var(--muted); font-size: 11px; font-weight: 750; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #56ae72; box-shadow: 0 0 0 4px rgba(86,174,114,.13); }
.text-button { border: 0; padding: 4px 0; color: var(--teal-dark); background: transparent; font-size: 12px; font-weight: 850; }
.text-button:hover { color: var(--ink); }
.page-wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 75px 0 70px; }
.intro-row { display: flex; justify-content: space-between; gap: 40px; align-items: end; }
.intro-row h1 { max-width: 740px; margin: 0 0 18px; font-size: clamp(40px, 6vw, 68px); line-height: .99; letter-spacing: -.06em; }
.intro-row .lede { max-width: 660px; }
.time-card { flex: 0 0 190px; padding: 20px; border-left: 2px solid var(--teal); background: #edf8f5; }
.time-card strong { display: block; font-size: 28px; letter-spacing: -.05em; }
.time-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.stepper { display: flex; align-items: center; margin: 55px 0 26px; }
.step { display: flex; align-items: center; gap: 10px; border: 0; padding: 0; color: #829491; background: transparent; font-size: 12px; text-align: left; }
.step span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #c3d3cf; border-radius: 50%; font-weight: 850; }
.step strong { font-weight: 750; }
.step.active, .step.complete { color: var(--ink); }
.step.active span, .step.complete span { color: var(--ink); border-color: var(--teal); background: var(--teal); }
.step-line { height: 1px; flex: 1; max-width: 110px; margin: 0 15px; background: var(--line); }
.panel, .success-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.step-panel { padding: 34px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.panel-heading h2, .success-panel h2 { margin: 0; font-size: 31px; line-height: 1.08; letter-spacing: -.045em; }
.required-note { color: var(--muted); font-size: 11px; }
.details-form, .sign-form { display: grid; gap: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.full-width { grid-column: 1 / -1; }
textarea { resize: vertical; min-height: 86px; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.helper { margin: 0; color: var(--muted); font-size: 12px; }
.prefilled-intro { display: grid; gap: 11px; margin: 0 0 22px; padding: 18px 20px; border: 1px solid #cdebe4; border-radius: 9px; background: var(--teal-pale); }
.prefilled-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.prefilled-badge { color: var(--teal-dark); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.prefilled-party { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.prefilled-continue { margin-top: 4px; }
.party-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -5px 0 28px; }
.summary-cell { min-width: 0; padding: 13px 15px; border-radius: 8px; background: #f4f8f7; }
.summary-cell span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.summary-cell strong { display: block; overflow: hidden; margin-top: 4px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.document-shell { overflow: hidden; border: 1px solid #cbd9d5; border-radius: 9px; background: #f5f7f6; }
.document-toolbar { display: flex; justify-content: space-between; gap: 20px; padding: 12px 16px; border-bottom: 1px solid #cbd9d5; color: var(--muted); background: #eef4f2; font-size: 11px; font-weight: 750; }
.document { max-height: 590px; overflow-y: auto; padding: 44px clamp(25px, 7vw, 90px); color: #253b3d; background: #fff; font-family: Georgia, "Times New Roman", serif; }
.document h3 { margin: 0 0 22px; color: var(--ink); font-family: Inter, ui-sans-serif, sans-serif; font-size: 21px; text-align: center; letter-spacing: .06em; }
.document h4 { margin: 25px 0 7px; color: var(--ink); font-family: Inter, ui-sans-serif, sans-serif; font-size: 13px; }
.document p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; }
.document .placeholder { padding: 2px 5px; border-radius: 3px; color: #956b18; background: #fff5d9; font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; font-weight: 750; }
.document .signature-script { color: #183e47; font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 18px; font-style: italic; }
.document .text-signatory { color: #253b3d; font-family: Georgia, "Times New Roman", serif; font-size: 14px; }
.signature-entry { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 18px; }
.review-footer { margin-top: 25px; }
.signing-callout { display: flex; gap: 13px; margin-bottom: 28px; padding: 18px 20px; border: 1px solid #cdebe4; border-radius: 9px; background: var(--teal-pale); }
.callout-icon { width: 26px; height: 26px; display: grid; flex: 0 0 26px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--teal); font-weight: 900; }
.signing-callout strong { font-size: 14px; }
.signing-callout p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.checkbox-row { display: flex; grid-template-columns: none; align-items: start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; font-size: 12px; font-weight: 600; line-height: 1.5; }
.checkbox-row input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; accent-color: var(--teal-dark); }
.compact-grid { max-width: 700px; }
.prototype-warning { margin: 26px 0 0; padding: 13px 15px; border-left: 3px solid var(--gold); color: #70603d; background: #fff9ea; font-size: 11px; line-height: 1.55; }
.success-panel { max-width: 760px; margin: 30px auto 0; padding: 55px; text-align: center; }
.success-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 23px; border-radius: 50%; color: var(--ink); background: var(--teal); font-size: 24px; font-weight: 900; }
.success-panel .eyebrow { margin-bottom: 13px; }
.success-panel .lede { max-width: 590px; margin: 17px auto 0; font-size: 15px; }
.success-meta { display: inline-flex; gap: 12px; margin: 28px auto; padding: 11px 15px; border-radius: 7px; color: var(--muted); background: #f2f7f5; font-size: 12px; }
.success-meta strong { color: var(--ink); }
.success-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.delivery-status { max-width: 620px; margin: 0 auto 22px; padding: 12px 15px; border-radius: 8px; font-size: 13px; }
.delivery-success { color: #185b4f; background: #e6f7f1; }
.delivery-warning { color: #76551a; background: #fff5d9; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 30px; color: #82918e; font-size: 11px; }
.creator-shell { min-height: 100vh; background: var(--paper); }
.creator-topbar { margin-bottom: 0; }
.creator-wrap { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0; }
.creator-heading { max-width: 720px; margin-bottom: 36px; }
.creator-heading h1 { margin: 0 0 18px; font-size: clamp(42px, 6vw, 66px); line-height: .99; letter-spacing: -.06em; }
.creator-panel, .generated-panel { padding: 34px; }
.generated-panel { margin-top: 22px; }
.generated-field { display: grid; gap: 8px; margin-bottom: 15px; }
.generated-field span { color: var(--ink-soft); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.generated-field input { background: #f5f9f7; font-size: 12px; }
.generated-link { display: inline-flex; width: fit-content; align-items: center; padding: 12px 15px; border: 1px solid #9ccfc4; border-radius: 8px; color: var(--ink); background: #f5f9f7; font-size: 14px; font-weight: 800; text-decoration: none; }
.generated-link:hover, .generated-link:focus-visible { border-color: var(--teal); background: #eaf7f3; text-decoration: underline; }
.generated-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

@media (max-width: 720px) {
  .gate-card { padding: 30px 24px; }
  .brand-mark { left: 24px; }
  .topbar { padding: 0 20px; }
  .secure-status { display: none; }
  .page-wrap { width: min(100% - 28px, 1120px); padding-top: 42px; }
  .intro-row { display: block; }
  .intro-row h1 { font-size: 47px; }
  .time-card { width: 100%; margin-top: 25px; }
  .stepper { margin-top: 40px; }
  .step strong { display: none; }
  .step-line { margin: 0 8px; }
  .step-panel { padding: 24px 18px; }
  .panel-heading { display: block; }
  .panel-heading .text-button, .required-note { display: inline-block; margin-top: 15px; }
  .form-grid, .party-summary, .prefilled-party { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .document { padding: 30px 22px; }
  .document p { font-size: 13px; }
  .success-panel { padding: 36px 22px; }
  .site-footer { display: block; }
  .site-footer span { display: block; margin: 5px 0; }
  .creator-wrap { width: min(100% - 28px, 920px); padding-top: 42px; }
  .creator-panel, .generated-panel { padding: 24px 18px; }
}

@media print {
  .topbar, .stepper, .panel:not(#reviewPanel), .site-footer, .document-toolbar, .review-footer { display: none !important; }
  .page-wrap { width: 100%; padding: 0; }
  .document-shell { border: 0; }
  .document { max-height: none; overflow: visible; padding: 20px; }
  .party-summary { margin-top: 20px; }
  body { background: white; }
}
