/* Zboone — shared tokens and components. All spacing/alignment uses logical properties so any RTL/LTR language works. */
:root {
  --bg: #fafaf8; --surface: #fff; --app-bg: #f2f2f8;
  --ink: #15151b; --ink-2: #464651; --muted: #6a6a76;
  --line: #e4e4ec; --line-2: #eeeef4;
  --lav: #eeeff8; --lav-2: #e3e5f4; --lav-3: #f6f6fb;
  --peach: #fbe2bd; --butter: #fff1a6; --mint: #cdebdc; --sky: #bfe3ef;
  --focus: #3d6df2;
  --ok: #17734f; --ok-bg: #dcf2e6;
  --warn: #7a5200; --warn-bg: #fff0c4;
  --bad: #a8322b; --bad-bg: #fde3e0;
  --info: #2a4fb4; --info-bg: #e4ebfb;
  --wa: #25d366;
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgb(20 20 40 / .05), 0 22px 44px -22px rgb(20 20 40 / .22);
  --font: "Readex Pro", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  --track: -0.02em; --lh-d: 1.08;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
[dir="rtl"] { --track: 0; --lh-d: 1.32; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html:not([data-ready]) body { opacity: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: var(--track); text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--butter); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .ltr { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
[dir="rtl"] .flip { transform: scaleX(-1); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; font-size: 0.95rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .2s var(--ease), background-color .2s, opacity .2s; }
.btn:hover { background: #2a2a33; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-soft { background: var(--lav); color: var(--ink); }
.btn-soft:hover { background: var(--lav-2); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--lav); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: #fbd0cb; }
.btn-wa { background: var(--wa); color: #05301a; }
.btn-wa:hover { background: #1fbf5b; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* Forms */
.field { display: grid; gap: 8px; min-width: 0; }
.field > label, .label { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 0.8rem; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.textarea { padding: 14px 16px; min-height: 150px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: #cfcfda; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(61 109 242 / .18); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6a76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
[dir="rtl"] .select { background-position: left 14px center; }
.phone { display: flex; align-items: stretch; direction: ltr; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.phone:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgb(61 109 242 / .18); }
.phone[data-invalid="true"] { border-color: var(--bad); }
.phone .cc { display: flex; align-items: center; padding: 0 14px; background: var(--lav-3); border-inline-end: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: .95rem; white-space: nowrap; }
.phone .input { border: 0; border-radius: 0; box-shadow: none; text-align: left; letter-spacing: .02em; }
.phone .input:focus-visible { box-shadow: none; }
.phone .wa-mark { flex: none; display: grid; place-items: center; padding: 0 14px; color: var(--wa); }
.phone .wa-mark img { width: 20px; min-width: 20px; height: 20px; flex: none; align-self: center; border-radius: 50%; }
.field-error { color: var(--bad); font-size: 0.82rem; }
.field-error:empty { display: none; }
.input[type="file"] { padding-top: 12px; cursor: pointer; }
.check { width: 20px; height: 20px; accent-color: var(--ink); cursor: pointer; margin: 0; }

/* Chips and notes */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 500; background: var(--lav); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip .icon { width: 14px; height: 14px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--info-bg); color: #1d3a86; font-size: .92rem; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note .icon { margin-top: 2px; }
.note a, .note button.link { color: inherit; font-weight: 600; }
button.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* Dialog */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: #fff; color: var(--ink); width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgb(20 20 40 / .45); }
dialog::backdrop { background: rgb(21 21 27 / .4); }
dialog[open] { animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg { padding: 28px; display: grid; gap: 14px; }
.dlg h2 { font-size: 1.3rem; }
.dlg p { color: var(--ink-2); }
.dlg .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }

/* Toast */
.toasts { position: fixed; inset-inline: 0; bottom: 24px; display: grid; justify-items: center; gap: 10px; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: .92rem; box-shadow: var(--shadow); animation: pop .3s var(--ease); pointer-events: auto; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* Language switcher */
.lang { position: relative; display: inline-flex; align-items: center; }
.lang .icon { position: absolute; inset-inline-start: 12px; pointer-events: none; width: 16px; height: 16px; color: var(--ink-2); }
.lang select { appearance: none; min-height: 38px; padding: 0 14px 0 34px; padding-inline: 34px 14px; border: 0; border-radius: 999px; background: var(--lav); font-size: .85rem; font-weight: 500; cursor: pointer; color: var(--ink); }
.lang select:hover { background: var(--lav-2); }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; text-decoration: none; letter-spacing: var(--track); }
.orb { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 30% 28%, #fff 0 12%, transparent 13%), conic-gradient(from 200deg, var(--peach), var(--butter), var(--mint), var(--sky), var(--peach)); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .8), 0 3px 10px -3px rgb(60 90 140 / .5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- Confirm-it's-you dialog ---- */
.stepup .dlg { justify-items: center; text-align: center; padding: 32px 28px 24px; }
.stepup .dlg > * { min-width: 0; }
.stepup .dlg > :not(.su-orb) { width: 100%; }
.su-orb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--butter), var(--mint) 55%, var(--sky)); }
.su-orb .icon { width: 24px; height: 24px; }
.su-code { min-height: 64px; text-align: center; direction: ltr; font-size: 1.9rem; font-weight: 600; letter-spacing: .5em; padding-inline: .5em 0; font-variant-numeric: tabular-nums; }
.su-code::placeholder { color: #c9c9d6; }
.su-err { text-align: center; }
.stepup .dlg .actions { justify-content: center; }
.su-resend { justify-self: center; width: auto !important; }
.chip-btn { border: 0; cursor: pointer; font: inherit; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn svg { width: 14px; height: 14px; }
.cf-box { position: fixed; inset: auto 0 24px; display: flex; justify-content: center; z-index: 200; }
