/* my.perkonova.com — portal styles.
 *
 * Tokens come from lib/theme.dart (BrandTheme) and the Flutter screens they
 * replace. The results view (card + offers) lives in card.css, transcribed
 * from functions/src/utils/cardAppPage.ts.
 *
 * Self-hosted Inter (OFL — fonts/OFL.txt). Nothing here is fetched from a
 * Google CDN: Privacy Policy §6 names reCAPTCHA as the only thing that is. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-greek-ext.woff2) format('woff2'); unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-muted: #F1F5F9;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --muted: #64748B;
  --accent: #F97316;
  --danger: #C62828;
  --error-bg: #FFDAD6;
  --error-ink: #410002;
  --brand-gradient: linear-gradient(135deg, #FB923C, #EA580C);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.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; }
svg.icon { display: block; flex: 0 0 auto; fill: currentColor; }

/* ── Page frame ─────────────────────────────────────────────── */
.band { position: absolute; top: 0; left: 0; right: 0; height: 220px;
  background: rgba(249, 115, 22, .06); pointer-events: none; }
.page { position: relative; max-width: 480px; margin: 0 auto;
  padding: calc(64px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.back { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; z-index: 5;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text); text-decoration: none; }
.back:hover { background: rgba(15, 23, 42, .06); }
.back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hdr { text-align: center; margin: 0 0 24px; }
.hdr h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.3px;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; }
.hdr p { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.hdr.compact h1 { font-size: 24px; }

.box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04); padding: 20px; }
.box + .box, .stack > * + * { margin-top: 16px; }

/* ── Fields ─────────────────────────────────────────────────── */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px; }
.field input { display: block; width: 100%; padding: 13px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); outline: none; }
.field input::placeholder { color: rgba(71, 85, 105, .6); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 .6px var(--accent); }
.field input[aria-invalid='true'] { border-color: var(--danger); }
.field .err { display: block; margin-top: 5px; font-size: 11.5px; color: var(--danger); }
.field.code input { text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 700;
  letter-spacing: 6px; padding: 11px 12px; }
.field.code input::placeholder { font-family: inherit; font-size: 14px; letter-spacing: 6px; }
.field.otp input { text-align: center; font-size: 20px; letter-spacing: 8px; font-weight: 600; }

/* ── Messages ───────────────────────────────────────────────── */
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.4; margin: 0 0 14px; }
.alert .icon { margin-top: 1px; }
.alert.error { background: var(--error-bg); color: var(--error-ink); }
.alert.info { background: rgba(249, 115, 22, .10); color: var(--text); }
.alert.info .icon { color: var(--accent); }
.note { font-size: 13px; line-height: 1.5; color: var(--text-2); margin: 14px 0 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 600; text-decoration: none; background: var(--accent); color: #fff;
  transition: transform .12s ease, opacity .12s ease; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn[disabled] { cursor: default; }
.btn[aria-busy='true'] { opacity: .7; }
.btn[disabled]:not([aria-busy='true']) { opacity: .5; }
.btn.plain { background: transparent; color: var(--accent); min-height: 40px; width: auto;
  margin: 10px auto 0; font-weight: 600; }
.btn.plain:active { transform: none; }
.btn.secondary { background: var(--surface-muted); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.outline-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.small { min-height: 40px; font-size: 14px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(249, 115, 22, .25); border-top-color: var(--accent); }
.spinner.big { width: 28px; height: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: flex; justify-content: center; padding: 48px 0; }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-3);
  font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── App Check panel (widgets/app_check_error_panel.dart) ───── */
.appcheck { text-align: left; }
.appcheck .shield { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; background: rgba(249, 115, 22, .12); color: var(--accent); margin: 0 0 14px; }
.appcheck h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.appcheck p { margin: 0 0 14px; color: var(--text-2); line-height: 1.5; }
.appcheck ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.appcheck li { position: relative; padding: 0 0 12px 34px; counter-increment: step; }
.appcheck li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px;
  border-radius: 50%; background: var(--surface-muted); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; }
.appcheck li b { display: block; margin-bottom: 2px; }
.appcheck li span { color: var(--text-2); line-height: 1.5; }

/* ── Footer links ───────────────────────────────────────────── */
.legal-foot { margin: 26px 0 0; text-align: center; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.legal-foot a { color: var(--accent); font-weight: 600; }

/* ── Landing (screens/landing_screen.dart) ──────────────────── */
.landing { min-height: 100vh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); }
.landing .grow3 { flex: 3; } .landing .grow4 { flex: 4; } .landing .grow5 { flex: 5; }
.wordmark { margin: 0; text-align: center; font-size: 36px; line-height: 1; font-weight: 800;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; padding: 4px 0; }
.tagline { margin: 10px 0 0; text-align: center; font-size: 15px; color: var(--text-2); }
.cta { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text);
  transition: background .12s ease; }
.cta + .cta { margin-top: 16px; }
.cta:hover { background: #FCFDFE; }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta .badge { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; background: rgba(249, 115, 22, .12); color: var(--accent); flex: 0 0 auto; }
.cta .txt { flex: 1; min-width: 0; }
.cta b { display: block; font-size: 16px; font-weight: 700; }
.cta small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--text-2); }
.cta .chev { color: var(--text-2); }
.landing-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px 14px; font-size: 13px; color: var(--text-2); }
.landing-foot a { color: var(--text-2); }
/* Discreet version line (the Flutter _VersionLine): helps support, never a feature. */
.version { margin: 6px 0 8px; text-align: center; font-size: 11px; color: var(--text-3); }
.rise { animation: rise .5s cubic-bezier(.215, .61, .355, 1) both; }
.rise.d1 { animation-delay: .09s; } .rise.d2 { animation-delay: .18s; } .rise.d3 { animation-delay: .27s; }
.rise.d4 { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .btn { transition: none; } }

/* ── Lookup: shop picker (widgets/email_lookup_card.dart) ───── */
.shops { list-style: none; margin: 0; padding: 0; }
.shop { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin: 0 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  text-align: left; }
.shop:disabled { cursor: default; }
.shop.dim { opacity: .45; }
.shop .logo { height: 36px; width: 36px; object-fit: contain; flex: 0 0 auto; }
.shop .logo.wide { width: 48px; } .shop .logo.landscape { width: 64px; }
.shop .initial { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: flex;
  align-items: center; justify-content: center; background: rgba(249, 115, 22, .12);
  color: var(--accent); font-weight: 700; }
.shop .txt { flex: 1; min-width: 0; }
.shop b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.shop small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.shop .chev { color: var(--text-2); }

/* ── Join (screens/join_screen.dart) ────────────────────────── */
.joining { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 16px;
  border-radius: 12px; background: rgba(249, 115, 22, .08); color: var(--text); font-size: 14px; }
.joining .icon { color: var(--accent); }
.joining code { font-family: var(--mono); font-weight: 600; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.consent .text { font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.consent .text a { color: var(--accent); font-weight: 600; }
.required { display: inline-block; margin: -6px 0 14px 30px; font-size: 11px; font-weight: 700;
  color: var(--danger); text-transform: uppercase; letter-spacing: .6px; }
/* The age question: three server-labelled chips, nothing selected at first. The
 * selected chip keeps dark text (white on the accent fails contrast at 15px). */
.age { margin: 0; padding: 0; border: 0; min-width: 0; }
.age:not(:last-child) { margin-bottom: 18px; }
/* Floated, a legend lays out as an ordinary block (its margin then works in Safari too). */
.age legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: 15px; font-weight: 700;
  color: var(--text); }
.age legend + * { clear: both; }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.chip[aria-pressed='true'], .chip.on { border-color: var(--accent); background: rgba(249, 115, 22, .10);
  box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chip:disabled { cursor: default; }
.age-stop { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.handoff { text-align: center; }
.handoff .code { margin: 8px 0 16px; font-family: var(--mono); font-size: 44px; font-weight: 800;
  letter-spacing: 4px; color: var(--text); overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface-muted); font-size: 13px; color: var(--text-2); }
.pill .spinner { width: 14px; height: 14px; border-width: 2px; }
.success-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; background: rgba(249, 115, 22, .12); color: var(--accent); margin: 0 auto 12px; }

/* ── My data (screens/my_data_screen.dart + widgets) ────────── */
.biz { padding: 0; overflow: hidden; }
.biz + .biz { margin-top: 14px; }
.biz .head { padding: 16px 16px 12px; }
.biz h3 { margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.biz .since { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.biz .row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.biz .row .txt { flex: 1; min-width: 0; }
.biz .row b { display: block; font-size: 14px; font-weight: 600; }
.biz .row small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.biz .slot { width: 52px; display: flex; justify-content: flex-end; }
.biz .actions { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.biz .actions .btn { flex: 1; }
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #CBD5E1; transition: background .15s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .15s; }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(18px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--text); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled ~ .track { opacity: .6; }

/* ── Modal dialogs ──────────────────────────────────────────── */
dialog.modal { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px;
  border: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .55); }
dialog.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 750; line-height: 1.3; }
dialog.modal p { margin: 0 0 12px; color: var(--text-2); line-height: 1.5; }
dialog.modal ul { margin: 0 0 12px; padding-left: 20px; color: var(--text); line-height: 1.5; }
dialog.modal li + li { margin-top: 4px; }
dialog.modal .opts { display: grid; gap: 10px; margin: 6px 0 14px; }
dialog.modal .opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
dialog.modal .opt:hover { border-color: var(--accent); }
dialog.modal .opt .badge { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; background: rgba(249, 115, 22, .12); color: var(--accent); flex: 0 0 auto; }
dialog.modal .opt b { display: block; font-size: 15px; }
dialog.modal .opt small { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.35; }
dialog.modal .opt .chev { margin-left: auto; color: var(--text-2); }
dialog.modal .check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; cursor: pointer; }
dialog.modal .check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--danger); }
dialog.modal .check.accent input { accent-color: var(--accent); }
dialog.modal .btns { display: flex; gap: 10px; flex-wrap: wrap; }
dialog.modal .btns .btn { flex: 1 1 140px; }

/* ── Legal (screens/legal_screen.dart) ──────────────────────── */
.legal { max-width: 760px; margin: 0 auto;
  padding: calc(56px + env(safe-area-inset-top)) 20px calc(48px + env(safe-area-inset-bottom)); }
.legal > h1.title { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.4px; }
.legal .updated { margin: 8px 0 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.legal .doc { margin-top: 28px; font-size: 16px; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.doc p { margin: 0 0 12px; }
.doc h1 { font-size: 24px; font-weight: 700; line-height: 1.3; margin: 32px 0 8px; }
.doc h2 { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 28px 0 6px; }
.doc h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin: 18px 0 4px; }
.doc h4, .doc h5, .doc h6 { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 16px 0 4px; }
.doc strong { font-weight: 700; }
.doc em { font-style: italic; color: var(--text-2); }
.doc a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.doc code { font-family: var(--mono); font-size: .85em; background: var(--surface-muted);
  border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; }
.doc pre { background: var(--surface-muted); border-radius: 8px; padding: 12px; overflow-x: auto; }
.doc pre code { background: none; padding: 0; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin: 0 0 6px; padding-left: 4px; }
.doc li > p { margin: 0 0 6px; }
.doc li > ul, .doc li > ol { margin: 6px 0 0; }
.doc blockquote { margin: 0 0 12px; padding: 8px 12px; border-radius: 4px; background: #E3EEF9;
  font-size: 14px; line-height: 1.6; }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.doc .tablewrap { overflow-x: auto; margin: 0 0 14px; }
.doc table { border-collapse: collapse; font-size: 14px; line-height: 1.5; min-width: 100%; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px 12px; vertical-align: top; text-align: left; }
.doc th { font-weight: 600; text-align: center; background: var(--surface-muted); }
.doc .al-center { text-align: center; } .doc .al-right { text-align: right; } .doc .al-left { text-align: left; }
.attribution { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12px; line-height: 1.5; color: var(--text-2); }
.attribution a { color: var(--accent); font-weight: 600; }
.legal .state { max-width: 420px; margin: 24px auto 0; }
