/* =====================================================================
   Al-Dawaa In-Store Survey – styles
   Fonts: Cairo (Arabic) / Roboto (English)
   Palette: brand navy #002544 + logo gold
   ===================================================================== */

:root {
    --navy:       #002544;
    --navy-700:   #0a3559;
    --navy-500:   #1f4b73;
    --navy-100:   #e4ebf3;
    --navy-050:   #f1f5f9;
    --gold:       #f2b705;
    --gold-400:   #ffd24a;
    --gold-100:   #fff3cc;
    --gold-050:   #fffaea;
    --paper:      #f5f7fa;
    --white:      #ffffff;
    --ink:        #002544;
    --muted:      #5f6f80;
    --line:       #d9e1ea;
    --line-strong:#b9c6d4;
    --danger:     #c8322b;
    --danger-050: #fdecea;
    --success:    #1e8e5a;
    --success-050:#e6f6ee;

    --cx-button-OutlineColor: #002544;

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 20px 50px -24px rgba(0, 37, 68, .35), 0 2px 6px -2px rgba(0, 37, 68, .08);
    --shadow-btn:  0 10px 24px -12px rgba(0, 37, 68, .55);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Roboto', sans-serif;
    --font: var(--font-ar);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[lang="ar"] { --font: var(--font-ar); }
html[lang="en"] { --font: var(--font-en); }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

html[lang="ar"] body { font-size: 17px; }

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------------
   Atmosphere
--------------------------------------------------------------------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg__blob {
    position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
    animation: drift 18s ease-in-out infinite alternate;
}
.bg__blob--gold {
    width: 52vw; height: 52vw; max-width: 620px; max-height: 620px;
    inset-block-start: -18vw; inset-inline-end: -14vw;
    background: radial-gradient(circle at 40% 40%, #ffe27a 0%, #ffd24a 35%, rgba(255, 210, 74, 0) 70%);
}
.bg__blob--navy {
    width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
    inset-block-end: -30vw; inset-inline-start: -22vw;
    background: radial-gradient(circle at 60% 60%, #9db9d6 0%, #c9d8e8 40%, rgba(201, 216, 232, 0) 70%);
    animation-delay: -9s;
}
.bg__grid {
    position: absolute; inset: 0; opacity: .5;
    background-image:
        linear-gradient(rgba(0, 37, 68, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 37, 68, .045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-4vw, 3vw, 0) scale(1.08); }
}

/* ---------------------------------------------------------------------
   Top bar
--------------------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
            backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid rgba(0, 37, 68, .08);
}
.topbar__inner {
    max-width: 1080px; margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand img { height: 40px; width: auto; }

.lang-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--white); color: var(--navy);
    border: 1px solid var(--cx-button-OutlineColor);
    font-weight: 600; font-size: .92rem; line-height: 1;
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.lang-toggle:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }
.lang-toggle__globe { display: inline-flex; }
/* the label always shows the *other* language, in that language's font */
html[lang="ar"] .lang-toggle__label { font-family: var(--font-en); }
html[lang="en"] .lang-toggle__label { font-family: var(--font-ar); font-weight: 700; }

/* ---------------------------------------------------------------------
   Layout
--------------------------------------------------------------------- */
.app {
    flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
    padding: 28px 20px 40px;
}
@media (min-width: 720px) { .app { padding: 44px 24px 56px; } }

.footer { text-align: center; padding: 16px 20px 28px; color: var(--muted); font-size: .82rem; }

.card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 26px 22px 24px;
    overflow: hidden;
}
@media (min-width: 720px) { .card { padding: 40px 44px 36px; } }
.card::before {
    content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 5px;
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 55%, var(--gold) 55%, var(--gold-400) 100%);
}
html[dir="rtl"] .card::before {
    background: linear-gradient(270deg, var(--navy) 0%, var(--navy) 55%, var(--gold) 55%, var(--gold-400) 100%);
}

/* ---------------------------------------------------------------------
   Entrance animation
--------------------------------------------------------------------- */
.fade-up { animation: fadeUp .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------
   Typography helpers
--------------------------------------------------------------------- */
.kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--navy-500);
}
html[lang="ar"] .kicker { letter-spacing: 0; font-size: .9rem; }
.kicker::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--gold); }

.title { font-size: clamp(1.5rem, 2.4vw + 1rem, 2.1rem); font-weight: 800; line-height: 1.25; margin: 8px 0 12px; }
html[lang="en"] .title { font-weight: 700; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 1.02rem; max-width: 60ch; }

/* ---------------------------------------------------------------------
   Welcome / invoice screen
--------------------------------------------------------------------- */
.welcome__meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 26px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--navy-050); border: 1px solid var(--navy-100);
    font-size: .85rem; font-weight: 600; color: var(--navy-700);
}
.chip svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.chip--gold { background: var(--gold-050); border-color: var(--gold-100); }

.invoice-form { margin-top: 8px; }
.invoice-form .field__input { font-size: 1.25rem; letter-spacing: .06em; font-weight: 600; text-align: center; }
html[lang="ar"] .invoice-form .field__input { letter-spacing: .02em; }
.invoice-form .btn { width: 100%; margin-top: 14px; }

/* ---------------------------------------------------------------------
   Fields
--------------------------------------------------------------------- */
.field { display: block; }
.field__label { display: block; font-weight: 700; margin-bottom: 8px; }
.field__hint { display: block; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.field__input {
    width: 100%; padding: 14px 16px;
    border: 1.5px solid var(--line-strong); border-radius: var(--radius-md);
    background: var(--white); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { color: #9aa8b6; font-weight: 400; letter-spacing: 0; }
.field__input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(242, 183, 5, .28); }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(200, 50, 43, .18); }
textarea.field__input { min-height: 110px; resize: vertical; line-height: 1.55; }
input.field__input[type="tel"] { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* phone control is always LTR (number convention), whatever the page direction */
.phone-wrap { position: relative; display: block; direction: ltr; }
.phone-wrap .field__input { padding-left: 64px; }
.phone-wrap__prefix {
    position: absolute; top: 0; bottom: 0; left: 0; width: 56px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--navy-500); border-right: 1px solid var(--line);
    pointer-events: none; font-size: .95rem; font-family: var(--font-en);
}

/* ---------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 12px 26px;
    border-radius: 999px;
    border: 1px solid var(--cx-button-OutlineColor);
    font-weight: 700; font-size: 1rem; line-height: 1; text-decoration: none;
    background: var(--white); color: var(--navy);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, opacity .2s;
    user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-btn); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-700); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--navy-050); }
.btn--gold { background: var(--gold); color: var(--navy); border-color: var(--cx-button-OutlineColor); }
.btn--gold:hover { background: var(--gold-400); }
.btn--lg { min-height: 56px; font-size: 1.06rem; }

html[dir="rtl"] .btn__arrow { transform: scaleX(-1); }

/* ---------------------------------------------------------------------
   Alerts
--------------------------------------------------------------------- */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: var(--radius-md);
    font-size: .95rem; line-height: 1.5;
    animation: fadeUp .35s var(--ease) both;
}
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert--error { background: var(--danger-050); color: #8a1f1a; border: 1px solid rgba(200, 50, 43, .25); }
.alert--info  { background: var(--navy-050); color: var(--navy-700); border: 1px solid var(--navy-100); }
.alert--success { background: var(--success-050); color: #145d3b; border: 1px solid rgba(30, 142, 90, .25); }
.alert--mt { margin-top: 18px; }
.alert--mb { margin-bottom: 18px; }

/* ---------------------------------------------------------------------
   Progress
--------------------------------------------------------------------- */
.progress { margin-bottom: 26px; }
.progress__top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; font-size: .86rem; color: var(--muted);
}
.progress__invoice {
    display: inline-flex; align-items: center; gap: 6px;
    font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy-700);
    background: var(--gold-050); border: 1px solid var(--gold-100);
    padding: 3px 10px; border-radius: 999px; direction: ltr;
}
.progress__bar { display: flex; gap: 6px; }
.progress__seg {
    flex: 1; height: 8px; border-radius: 99px; background: var(--navy-100);
    position: relative; overflow: hidden;
}
.progress__seg::after {
    content: ""; position: absolute; inset: 0;
    background: var(--navy); border-radius: inherit;
    transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
html[dir="rtl"] .progress__seg::after { transform-origin: right; }
.progress__seg.is-done::after { transform: scaleX(1); }
.progress__seg.is-active::after {
    transform: scaleX(1);
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy-500) 60%, var(--gold) 100%);
}
html[dir="rtl"] .progress__seg.is-active::after {
    background: linear-gradient(270deg, var(--navy) 0%, var(--navy-500) 60%, var(--gold) 100%);
}
.progress__labels { display: flex; gap: 6px; margin-top: 8px; }
.progress__labels span { flex: 1; font-size: .78rem; color: var(--muted); text-align: center; font-weight: 600; }
.progress__labels span.is-active { color: var(--navy); }
@media (max-width: 480px) { .progress__labels span:not(.is-active) { visibility: hidden; } }

/* ---------------------------------------------------------------------
   Section header
--------------------------------------------------------------------- */
.section-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }
.section-head .title { margin-bottom: 0; font-size: clamp(1.35rem, 2vw + .9rem, 1.8rem); }

/* ---------------------------------------------------------------------
   Questions
--------------------------------------------------------------------- */
.q { padding: 6px 0 26px; margin-bottom: 4px; scroll-margin-top: 90px; }
.q + .q { border-top: 1px solid var(--navy-050); padding-top: 26px; }
.q--hidden { display: none; }
.q--conditional { position: relative; }

.q__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.q__num {
    flex: none; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--navy); color: var(--gold-400);
    font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
    font-family: var(--font-en);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}
.q__text { font-weight: 700; font-size: 1.08rem; line-height: 1.45; margin: 4px 0 0; }
.q__hint { display: block; color: var(--muted); font-size: .88rem; font-weight: 500; margin-top: 4px; }
.q__hint--optional { color: var(--navy-500); }
.q__error {
    display: none; margin-top: 10px; font-size: .88rem; color: var(--danger); font-weight: 600;
    align-items: center; gap: 6px;
}
.q__error svg { width: 16px; height: 16px; flex: none; }
.q.has-error .q__error { display: flex; animation: fadeUp .3s var(--ease) both; }
.q.has-error .q__num { background: var(--danger); color: #fff; }
.q.has-error .opt { border-color: rgba(200, 50, 43, .35); }

/* option lists ------------------------------------------------------- */
.opts { display: grid; gap: 10px; }
.opts--inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) {
    .opts--inline { grid-template-columns: repeat(2, minmax(0, 220px)); }
}

.opt {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: var(--radius-md);
    border: 1.5px solid var(--line); background: var(--white);
    cursor: pointer; transition: border-color .18s, background .18s, transform .18s var(--ease), box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: var(--navy-500); transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(0, 37, 68, .4); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt__mark {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--line-strong); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.opt__mark--box { border-radius: 6px; }
.opt__mark svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s var(--ease); }
.opt__text { flex: 1; font-weight: 500; line-height: 1.45; }
.opt input:focus-visible ~ .opt__mark { box-shadow: 0 0 0 4px rgba(242, 183, 5, .35); }
.opt.is-checked { border-color: var(--navy); background: linear-gradient(0deg, var(--gold-050), var(--gold-050)); }
.opt.is-checked .opt__mark { border-color: var(--navy); background: var(--navy); transform: scale(1.05); }
.opt.is-checked .opt__mark svg { opacity: 1; transform: scale(1); }
.opt.is-checked .opt__text { font-weight: 700; color: var(--navy); }

.opts--inline .opt { justify-content: center; text-align: center; padding: 14px 12px; }

.other-input { grid-column: 1 / -1; margin-top: -2px; animation: fadeUp .3s var(--ease) both; }
.other-input .field__input { padding: 12px 14px; }

/* scale --------------------------------------------------------------- */
.scale { display: grid; gap: 12px; }
.scale__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .scale__row { gap: 12px; } }
.scale__btn {
    position: relative; aspect-ratio: 1 / 1; max-height: 74px; width: 100%;
    border-radius: 16px; border: 1.5px solid var(--line); background: var(--white);
    font-family: var(--font-en); font-weight: 700; font-size: 1.3rem; color: var(--navy);
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .18s, background .18s, color .18s, transform .18s var(--ease), box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
}
.scale__btn:hover { border-color: var(--navy-500); transform: translateY(-2px); box-shadow: 0 10px 20px -14px rgba(0, 37, 68, .5); }
.scale__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.scale__btn.is-selected {
    background: var(--navy); color: #fff; border-color: var(--navy);
    box-shadow: 0 0 0 4px var(--gold-100), 0 14px 24px -14px rgba(0, 37, 68, .6);
    transform: translateY(-2px) scale(1.04);
}
.scale__btn.is-selected::after {
    content: ""; position: absolute; inset-block-end: 7px; width: 18px; height: 3px; border-radius: 2px; background: var(--gold);
}
.scale__ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 600; }
.scale__pick {
    min-height: 26px; text-align: center; font-weight: 700; color: var(--navy);
    font-size: .95rem; transition: opacity .2s;
}
.scale__pick:empty { opacity: 0; }

/* ---------------------------------------------------------------------
   Navigation row
--------------------------------------------------------------------- */
.nav {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--navy-050);
}
.nav__spacer { flex: 1; }
@media (max-width: 480px) {
    .nav { flex-direction: column-reverse; align-items: stretch; }
    .nav .btn { width: 100%; }
    .nav__spacer { display: none; }
}

/* ---------------------------------------------------------------------
   Thank-you
--------------------------------------------------------------------- */
.thanks { text-align: center; padding-block: 12px; }
.thanks__badge {
    width: 92px; height: 92px; margin: 4px auto 22px; border-radius: 50%;
    background: var(--navy); display: grid; place-items: center;
    box-shadow: 0 0 0 10px var(--gold-100), 0 24px 40px -20px rgba(0, 37, 68, .6);
    animation: pop .6s var(--ease) both;
}
.thanks__badge svg { width: 44px; height: 44px; }
.thanks__badge--muted { background: var(--navy-100); box-shadow: 0 0 0 10px var(--navy-050); }
.thanks__badge--muted svg { color: var(--navy-500); stroke: var(--navy-500); }
.thanks__badge path { stroke: var(--gold-400); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; fill: none;
    stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .6s .35s var(--ease) forwards; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks .title { margin-bottom: 8px; }
.thanks__brand { font-weight: 800; color: var(--navy); font-size: 1.15rem; margin-top: 22px; }
.thanks__tagline { color: var(--navy-500); font-weight: 600; letter-spacing: .04em; }
html[lang="ar"] .thanks__tagline { letter-spacing: 0; }
.thanks__ref {
    display: inline-flex; gap: 8px; align-items: center; margin-top: 18px;
    padding: 6px 14px; border-radius: 999px; font-size: .85rem;
    background: var(--navy-050); border: 1px solid var(--navy-100); color: var(--navy-700);
}
.thanks__ref b { font-family: var(--font-en); direction: ltr; }
.thanks__terms { margin-top: 24px; color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------------
   Loading
--------------------------------------------------------------------- */
.loading { display: grid; place-items: center; gap: 16px; padding: 40px 0 28px; color: var(--muted); font-weight: 600; }
.spinner {
    width: 44px; height: 44px; border-radius: 50%;
    border: 4px solid var(--navy-100); border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}
.spinner--sm { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.is-busy { pointer-events: none; }

/* ---------------------------------------------------------------------
   Dev ribbon (only when config mock=true)
--------------------------------------------------------------------- */
.mock-ribbon {
    position: fixed; inset-block-end: 12px; inset-inline-start: 12px; z-index: 30;
    font-family: var(--font-en); font-size: .7rem; font-weight: 700; letter-spacing: .08em;
    background: var(--gold); color: var(--navy); padding: 4px 10px; border-radius: 6px;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .3); opacity: .9;
}

/* ---------------------------------------------------------------------
   Terms & Conditions – consent row + modal
--------------------------------------------------------------------- */
.q--consent { padding-top: 6px; }
.consent { align-items: flex-start; }
.consent .opt__mark { margin-top: 2px; }
.consent__text { font-weight: 500; }
.consent__link, .thanks__terms-link {
    color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--gold); text-decoration-thickness: 2px;
}
.consent__link:hover, .thanks__terms-link:hover { color: var(--navy-500); text-decoration-color: var(--navy-500); }
.consent__link:focus-visible, .thanks__terms-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.q.has-error .consent { border-color: var(--danger); }

body.has-modal { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 37, 68, .55); backdrop-filter: blur(3px); animation: fadeIn .2s both; }
.modal__dialog {
    position: relative; width: min(720px, 100%); max-height: min(88vh, 88dvh);
    display: flex; flex-direction: column;
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    animation: modalIn .28s var(--ease) both; outline: none; overflow: hidden;
}
.modal__head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
}
.modal__title { margin: 0; flex: 1; font-size: 1.1rem; font-weight: 800; color: var(--navy); line-height: 1.4; }
.modal__close {
    flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line);
    background: var(--white); color: var(--navy); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background .18s, border-color .18s;
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: var(--navy-050); border-color: var(--navy-500); }
.modal__close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.modal__body { flex: 1; overflow-y: auto; padding: 16px 22px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal__foot {
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    padding: 14px 22px 18px; border-top: 1px solid var(--line); background: var(--navy-050);
}
.modal__foot .btn { min-height: 46px; }
.terms-list { margin: 0; padding-inline-start: 24px; display: grid; gap: 12px; font-size: .95rem; line-height: 1.7; color: var(--ink); }
.terms-list li { padding-inline-start: 4px; }
.terms-list li::marker { font-weight: 700; color: var(--navy-500); }
@media (min-width: 720px) {
    .modal__head { padding: 24px 28px 16px; }
    .modal__body { padding: 20px 28px; }
    .modal__foot { padding: 16px 28px 20px; }
    .modal__title { font-size: 1.2rem; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   Motion preferences
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .fade-up { animation: none; }
    .bg__blob { animation: none; }
}
