/* TappyTippy web: same tokens as the iPhone app (ios/TappyTippy/Design.swift). */
:root {
  --background: #ffffff;
  --canvas: #f7f7f9;
  --ink: #0d1117;
  --secondary: #666a75;
  --line: #e6e7eb;
  --accent: #6950f3;
  --accent-soft: #f0edfe;
  --success: #06764d;
  --success-soft: #e6f6ef;
  --danger: #c62838;
  --danger-soft: #fdecee;
  --warning: #a95703;
  --warning-soft: #fff4e5;
  --radius-card: 16px;
  --radius-control: 14px;
  --shadow: 0 8px 24px rgba(13, 17, 23, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--background); color: var(--ink); line-height: 1.5; font-size: 16px; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The "Skip to content" link appears when it gets keyboard focus (WCAG 2.4.7). */
a.visually-hidden:focus, a.visually-hidden:focus-visible { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; overflow: visible; padding: 8px 12px; background: var(--background); color: var(--ink); outline: 2px solid var(--ink); border-radius: 8px; z-index: 1000; }

/* Layout */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
header.site { border-bottom: 1px solid var(--line); background: var(--background); position: sticky; top: 0; z-index: 10; }
header.site .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.4px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
nav.site { display: flex; align-items: center; gap: 6px; }
nav.site a { text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 420px) { nav.site a { padding: 8px 8px; } .brand { font-size: 17px; } }
nav.site a:hover { background: var(--canvas); color: var(--ink); }
main { padding: 32px 0 64px; }
footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--secondary); font-size: 14px; }
footer.site .container { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer.site a { color: var(--secondary); }

/* Type */
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -1.5px; margin: 0 0 16px; font-weight: 800; }
h2 { font-size: 28px; letter-spacing: -0.6px; margin: 0 0 8px; line-height: 1.2; }
h3 { font-size: 18px; margin: 0 0 4px; }
.lede { font-size: 19px; color: var(--secondary); margin: 0 0 28px; max-width: 560px; }
.muted { color: var(--secondary); }
.small { font-size: 14px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: opacity 0.12s, transform 0.12s; }
.button:hover { color: #fff; opacity: 0.88; }
.button:active { transform: scale(0.985); }
.button.secondary { background: var(--background); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { color: var(--ink); background: var(--canvas); }
.button.danger { background: var(--background); color: var(--danger); border-color: var(--line); }
.button.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.button.block { width: 100%; }
.button[disabled], .button[aria-disabled="true"] { background: var(--line); border-color: var(--line); color: var(--secondary); cursor: not-allowed; opacity: 1; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cards and badges */
.card { background: var(--background); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.card + .card { margin-top: 16px; }
.canvas { background: var(--canvas); border-radius: 24px; }
.badge.warning { background: var(--warning-soft); color: var(--warning); vertical-align: middle; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--canvas); color: var(--secondary); white-space: nowrap; }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* Notices */
.notice { border-radius: var(--radius-control); padding: 14px 16px; background: var(--canvas); margin: 0 0 16px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.success { background: var(--success-soft); color: var(--success); }
.notice.warning { background: var(--warning-soft); color: var(--ink); }
.notice:empty { display: none; }

/* Forms */
form { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 700; font-size: 18px; margin-bottom: 12px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--secondary); }
.field .error-text { font-size: 13px; color: var(--danger); min-height: 0; }
.field .error-text:empty { display: none; }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line);
  background: var(--background); font: inherit; color: var(--ink); }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:not([type="checkbox"]):not([type="radio"])[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-control); font-weight: 600; cursor: pointer; text-align: center; }
.choice input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 13px; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input[aria-invalid="true"] + span { border: 2px solid var(--danger); padding: 13px; }

/* Stepper */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.steps li.done, .steps li.current { background: var(--accent); }
.step-title { font-size: 13px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }

/* Lists */
.rows { border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.row + .row { border-top: 1px solid var(--line); }
dl.summary { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 8px 24px; margin: 0; }
dl.summary dt { color: var(--secondary); }
dl.summary dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 24px 0 48px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.mock { padding: 40px 32px; display: grid; place-items: center; }
.mock .card { width: 100%; max-width: 320px; box-shadow: var(--shadow); text-align: center; }
.mock .amount { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin: 2px 0 14px; }
.mock .tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mock .tip { border: 1px solid var(--line); border-radius: 12px; padding: 10px 0; font-weight: 700; font-size: 15px; }
.mock .tip.selected { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 9px 0; }
.mock .tap { background: var(--ink); color: #fff; border-radius: 999px; padding: 12px; font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.features > .card { margin-top: 0; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature p { margin-bottom: 0; }
.feature .icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.how { counter-reset: how; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.how li { counter-increment: how; display: flex; gap: 14px; align-items: flex-start; }
.how p { margin: 2px 0 0; }
.how h3 { margin-top: 4px; }
.how li::before { content: counter(how); flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--secondary); font-size: 14px; }
section { margin-top: 56px; }
.prose h2 { margin-top: 32px; font-size: 22px; }
.prose p, .prose li { color: #2a2f38; }
.draft-banner { background: var(--warning-soft); border-radius: var(--radius-control); padding: 12px 16px; margin-bottom: 24px; font-weight: 600; }
[hidden] { display: none !important; }

/* Fees and agreement */
#fees-card { margin-top: 16px; }
#fees-card ul, .notice ul { padding-left: 20px; margin: 8px 0 0; }
#clauses { margin-top: 20px; }
#clauses h3 { font-size: 1rem; margin: 16px 0 4px; }
#clauses p { margin: 0; }
.card details { margin-top: 12px; }
.card details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.strong { font-weight: 600; color: var(--ink); }
.card > .button-row { margin-top: 12px; align-items: center; }

/* SSN and account numbers: masked text fields, not password fields, so password managers never offer to save them
   (or replace the real password with them). Hidden with text-security where supported; "Show" reveals. */
input.masked { -webkit-text-security: disc; }
input.masked.revealed { -webkit-text-security: none; }
.reveal { margin-top: 4px; }

/* Continue with Apple / Google (each provider's own colours and mark) */
.providers { display: grid; gap: 12px; }
.button.provider { gap: 10px; }
.button.provider.apple { background: #000; border-color: #000; color: #fff; }
.button.provider.google { background: #fff; border-color: #747775; color: #1f1f1f; }
.button.provider.google:hover { color: #1f1f1f; background: #f8f9fa; opacity: 1; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--secondary); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
