/* AntiFraud phone app. Dark ink, candy colours, a little terminal. */
:root {
  --ink: #14112b;
  --card: #201c40;
  --card-2: #2b2655;
  --line: #3b3570;
  --text: #f5f2ff;
  --muted: #b9b3de;
  --mint: #5ef0b6;
  --pink: #ff7ac8;
  --sun: #ffd447;
  --sky: #6fd0ff;
  --danger: #ff8d8d;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --tabs: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(60rem 30rem at 110% -10%, rgba(255, 122, 200, 0.16), transparent 60%),
    radial-gradient(50rem 28rem at -20% 10%, rgba(111, 208, 255, 0.14), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.45 var(--sans);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 0.85rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 6px; }
.logo { font: 700 1.15rem var(--mono); letter-spacing: -0.02em; display: flex; align-items: center; }
.prompt { color: var(--mint); margin-right: 6px; }
.cursor { width: 0.6em; height: 1.05em; margin-left: 3px; background: var(--pink); border-radius: 2px; animation: blink 1.1s steps(1) infinite; }
.status { font: 0.75rem var(--mono); color: var(--sun); text-align: right; }
@keyframes blink { 50% { opacity: 0; } }

main { max-width: 34rem; margin: 0 auto; padding: 8px 16px calc(var(--tabs) + env(safe-area-inset-bottom) + 28px); }
.title { font: 800 1.9rem/1.1 var(--sans); letter-spacing: -0.03em; margin: 10px 2px 16px; }
.blip { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(94, 240, 182, 0.7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(94, 240, 182, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 240, 182, 0); } }

.stack { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.hero { margin-top: 12vh; padding: 22px; }
.card h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.card h3 { font-size: 1.1rem; line-height: 1.25; }
.card p + p, .card h3 + p { margin-top: 6px; }
.card.pop { border-color: var(--mint); }

label, legend { display: block; font: 600 0.8rem var(--mono); color: var(--muted); margin: 16px 2px 6px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type="text"], input[type="password"], input[type="datetime-local"], input[type="tel"], input[type="date"], textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 17px; /* 16px or more stops iOS zooming in */
}
textarea { resize: vertical; }
::placeholder { color: #8f88bd; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.drop {
  display: grid; justify-items: center; gap: 2px; margin: 0; padding: 22px 16px; cursor: pointer;
  background: linear-gradient(135deg, rgba(94, 240, 182, 0.12), rgba(111, 208, 255, 0.12));
  border: 2px dashed var(--mint); border-radius: 22px; color: var(--text); font: inherit;
}
.drop:active { transform: scale(0.99); }
.drop-plus { font: 300 2.6rem/1 var(--mono); color: var(--mint); }
.drop-text { font: 700 1.15rem var(--sans); }
.drop-hint { font-size: 0.85rem; color: var(--muted); text-align: center; }
#claim-files:focus-visible + .thumbs, .drop:focus-within { outline: 3px solid var(--sky); outline-offset: 2px; }

.thumbs { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; padding: 0; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font: 0.7rem var(--mono); color: var(--muted); text-align: center; padding: 4px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 0; right: 0; width: 36px; height: 36px; border: 0; background: rgba(20, 17, 43, 0.75); color: var(--text); border-radius: 0 0 0 14px; font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chip {
  min-height: 46px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #221a00; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chip:nth-of-type(2)[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #33001f; }
.chip:nth-of-type(3)[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: #002233; }
.chip:nth-of-type(4)[aria-pressed="true"] { background: var(--mint); border-color: var(--mint); color: #00281a; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; }
.seg { min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sky); }
.when input { margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 18px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card-2); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--mint); border-color: var(--mint); color: #00281a; box-shadow: 0 6px 0 #1f9d72; }
.btn.primary:active { box-shadow: 0 2px 0 #1f9d72; transform: translateY(4px); }
.btn.sure { background: var(--sun); border-color: var(--sun); color: #221a00; box-shadow: 0 6px 0 #b8930f; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.big { width: 100%; min-height: 60px; font-size: 1.2rem; margin-top: 22px; }
form .btn.primary:not(.big) { width: 100%; margin-top: 18px; }
#sign-out { margin-top: 24px; width: 100%; }

.error { color: var(--danger); font-weight: 600; margin-top: 12px; }

.tag { display: inline-block; font: 700 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 9px; border-radius: 999px; background: var(--card-2); color: var(--sky); margin-bottom: 8px; }
.tag.money { color: var(--mint); }
.tag.warm { color: var(--sun); }
.tag.hot { color: var(--pink); }
.meta { font: 0.8rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.amount { font: 800 1.6rem var(--mono); color: var(--mint); letter-spacing: -0.02em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions .btn { flex: 1 1 auto; }
details { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--sky); min-height: 44px; display: flex; align-items: center; }
.letter { margin: 8px 0 0; padding: 14px; max-height: 50vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f4ea; color: #1c1a17; border-radius: 12px; font: 0.85rem/1.5 var(--mono); }
.links { margin: 8px 0 0; padding-left: 18px; }
.links a { color: var(--sky); overflow-wrap: anywhere; }
.empty { text-align: center; padding: 34px 18px; }
.empty .big-mark { font: 800 2.6rem var(--mono); color: var(--mint); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font: 800 1.5rem var(--mono); }
.stat:first-child b { color: var(--sun); }
.stat:last-child b { color: var(--mint); }
.stat span { font-size: 0.8rem; color: var(--muted); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(20, 17, 43, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab { position: relative; min-height: 56px; border: 0; background: transparent; color: var(--muted); font: 600 0.75rem var(--sans); display: grid; justify-items: center; gap: 2px; cursor: pointer; border-radius: 12px; }
.tab-icon { font: 700 1.25rem var(--mono); line-height: 1.1; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .tab-icon { color: var(--mint); }
.badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #33001f; font: 700 0.72rem/20px var(--mono); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); z-index: 6;
  max-width: 32rem; margin: 0 auto; padding: 14px 16px; border-radius: 14px;
  background: var(--mint); color: #00281a; font-weight: 700; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: rise 0.25s ease-out;
}
.toast.bad { background: var(--danger); color: #2b0000; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Me tab */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steps { margin: 10px 0 0; padding-left: 22px; }
.steps li { margin: 8px 0; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 2.2em 1fr; gap: 6px; align-items: start; }
.checks .mark { font: 700 0.9rem var(--mono); }
.checks .ok { color: var(--mint); }
.checks .bad { color: var(--sun); }
.proof-file { margin-top: 8px; }
#view-me:not([hidden]) { display: grid; gap: 14px; }
#view-me .title { margin-bottom: 0; }
#me-box summary { display: list-item; }
#me-box summary .muted { font-weight: 400; }
.saved-line { font-weight: 700; color: var(--mint); margin: 6px 0 4px; }
.okmark { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--mint); color: #00281a; margin-right: 6px; font-size: 0.85rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 14px; }
.kv dt { font: 600 0.8rem var(--mono); color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.proof-thumb { display: block; margin: 10px 0; color: var(--sky); }
.proof-thumb img { display: block; max-width: 100%; max-height: 220px; border-radius: 12px; border: 1.5px solid var(--line); object-fit: cover; object-position: top; }
#details-cancel, #dnc-cancel { width: 100%; margin-top: 10px; }

/* Get-ready checklist */
.ready { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.ready > li { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card-2); }
.ready > li.done { border-color: rgba(94, 240, 182, 0.45); }
.ready-head { display: grid; grid-template-columns: 2em 1fr; gap: 8px; align-items: start; }
.ready-dot { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; border: 2px solid var(--muted); font: 700 0.85rem var(--mono); color: var(--muted); }
.ready > li.done .ready-dot { background: var(--mint); border-color: var(--mint); color: #00281a; }
.ready-head b { display: block; }
.ready-head p { margin: 2px 0 0; }
.ready details { margin-top: 8px; }
.ready summary { color: var(--sky); cursor: pointer; font-weight: 600; }
.ready .steps a { color: var(--sky); }
.ready .actions { margin-top: 10px; }

/* Practice run */
.practice-bar { margin-bottom: 14px; padding: 14px; border-radius: 18px; background: #2a1840; border: 2px dashed var(--pink); box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.practice-bar h3 { margin: 8px 0 4px; }
.practice-bar p { margin: 0; }
.practice-bar .actions { margin-top: 10px; }
body.practice .top { box-shadow: inset 0 -3px 0 var(--pink); }
.practice-link { width: 100%; margin: -4px 0 10px; color: var(--sky); }
.toast { pointer-events: none; }
.chips-note { width: 100%; margin: 6px 2px 0; }
