:root {
  --bg: #0B0E10;
  --bg-2: #0E1316;
  --card: #111619;
  --card-2: #161D21;
  --text: #F4F7F7;
  --muted: #A6B0B4;
  --dim: #6F7B80;
  --accent: #55DEDB;
  --accent-ink: #04201F;
  --accent-soft: rgba(85, 222, 219, 0.12);
  --line: #263239;
  --line-2: #33434A;
  --danger: #FF8A80;
  --warn: #F5C76B;
  --ok: #7EE0A1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --tap: 48px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; font-weight: 800; letter-spacing: 0; }
p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.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; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 22px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 700; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .1s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #7BE8E5; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-soft { background: var(--card-2); border-color: var(--line); color: var(--text); }
.btn-soft:hover { border-color: var(--line-2); }
.btn-wa { background: #1FAF5A; color: #fff; }
.btn-wa:hover { background: #24C466; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- form controls */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 700; font-size: 15px; }
.field .hint { color: var(--muted); font-size: 13px; }
.field .err { color: var(--danger); font-size: 14px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 16px; /* ≥16px prevents iOS zoom */
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[dir="ltr"] { text-align: right; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.chip-warn { background: rgba(245, 199, 107, .12); color: var(--warn); }
.chip-ok { background: rgba(126, 224, 161, .12); color: var(--ok); }
.chip-muted { background: rgba(166, 176, 180, .12); color: var(--muted); }
.chip-danger { background: rgba(255, 138, 128, .12); color: var(--danger); }

.demo-banner {
  background: repeating-linear-gradient(-45deg, #2A2310, #2A2310 12px, #241E0E 12px, #241E0E 24px);
  color: var(--warn); text-align: center; font-weight: 700; font-size: 14px; padding: 8px 16px;
  border-bottom: 1px solid #4A3D17;
}

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; background: rgba(0,0,0,.62); padding: 16px; }
@media (min-width: 640px) { .modal { place-items: center; } }
.modal-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px; }
.modal-card h3 { font-size: 20px; margin-bottom: 8px; }

.toast { position: fixed; inset-inline: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 120; margin: auto; width: max-content; max-width: calc(100% - 32px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); }
.btn-block { white-space: normal; text-align: center; }
@media (max-width: 360px) { .btn { padding-inline: 14px; font-size: 15px; } }
