/* ==========================================================================
   Afghan TopUp - design system: Claymorphism + Vibrant & Block-based
   Soft 3D "clay" surfaces (chunky borders, outer + inner shadows, big radii)
   set on bold colour blocks. Mobile-first; logical properties so RTL works.
   Shadows only offset on the Y axis so nothing needs mirroring in RTL.
   Tokens mirror what a native/Flutter app should use.
   ========================================================================== */

:root {
    /* Brand */
    --blue: #1677F2;
    --blue-press: #0F66D6;
    --blue-block: #1260D6;          /* hero block: white body text passes 4.5:1 */
    --blue-deep: #0B3D91;
    --blue-tint: #EAF3FF;
    --blue-line: #C9DEFC;

    /* Vibrant block palette (tints carry ink text; "strong" for icons/accents) */
    --sun: #FFE27A;
    --sun-strong: #FFC21A;
    --mint: #C6F3E1;
    --mint-strong: #0FA878;
    --coral: #FFD6CF;
    --coral-strong: #F2553F;
    --lilac: #E4DDFF;
    --lilac-strong: #6A4DF4;
    --sky: #DCEBFF;

    /* Neutrals */
    --bg: #F2F6FD;
    --surface: #FFFFFF;
    --field: #F6F9FF;
    --ink: #172B4D;
    --ink-2: #55657F;
    --line: #DFE8F6;
    --green: #0E7C55;
    --green-tint: #E3F6EE;
    --red: #C4320A;
    --red-tint: #FFEEE9;
    --amber: #8A5200;
    --amber-tint: #FFF3D6;

    /* Type scale (ui-ux-pro-max: 12 14 16 18 20 24 32) */
    --text-xs: .75rem;
    --text-sm: .875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-display: clamp(2rem, 1.6rem + 1.6vw, 2.5rem);

    /* Spacing: 4pt scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-14: 56px;

    /* Type */
    --font-ui: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
    --font-num: "Nunito", system-ui, sans-serif;

    /* Clay */
    --r-sm: 14px;
    --r-md: 20px;
    --r-lg: 28px;
    --r-xl: 36px;
    --border: 3px;
    --clay-out: 0 18px 32px -16px rgba(16, 64, 150, .38);
    --clay-in: inset 0 -6px 0 rgba(16, 64, 150, .07), inset 0 4px 8px rgba(255, 255, 255, .95);
    --clay: var(--clay-out), var(--clay-in);
    --clay-sm: 0 8px 16px -8px rgba(16, 64, 150, .32), inset 0 -4px 0 rgba(16, 64, 150, .07), inset 0 2px 4px rgba(255, 255, 255, .9);
    --clay-pressed: inset 0 4px 10px rgba(16, 64, 150, .16), inset 0 -2px 0 rgba(255, 255, 255, .7);
    --bounce: cubic-bezier(.34, 1.56, .64, 1);
    --focus: 0 0 0 3px #fff, 0 0 0 6px var(--blue);

    --gutter: 16px;
    --header-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --dots: radial-gradient(rgba(255, 255, 255, .16) 2px, transparent 2.6px) 0 0 / 22px 22px;

    color-scheme: light;
}

[dir="rtl"] {
    --font-ui: "Vazirmatn", "Nunito", Tahoma, sans-serif;
    --font-display: "Vazirmatn", Tahoma, sans-serif;
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 28px);
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--ink);
    font: 400 var(--text-base)/1.55 var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

[dir="rtl"] body { line-height: 1.75; }

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -60px;
    z-index: 100;
    padding: 12px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container-narrow { max-width: 760px; }

.icon { flex: none; }
.nowrap { white-space: nowrap; }

@media (min-width: 375px) { :root { --gutter: 20px; } }

/* ---------- Buttons (clay: raised, press down on tap) ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 28px 4px;
    border: 0;
    border-radius: var(--r-md);
    font: 700 var(--text-lg)/1.2 var(--font-ui);
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s var(--bounce), box-shadow .2s ease-out, background-color .2s;
    -webkit-tap-highlight-color: transparent;
}
.button:active { transform: translateY(3px); }
.button-block { display: flex; width: 100%; }
.button-small { min-height: 44px; padding: 0 16px 3px; font-size: var(--text-base); border-radius: var(--r-sm); }

.button-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 12px 20px -10px rgba(22, 119, 242, .8), inset 0 -5px 0 rgba(0, 0, 0, .2), inset 0 3px 0 rgba(255, 255, 255, .22);
}
.button-primary:hover { background: var(--blue-press); }
.button-primary:active { box-shadow: 0 4px 10px -6px rgba(22, 119, 242, .8), inset 0 -2px 0 rgba(0, 0, 0, .2), inset 0 2px 0 rgba(255, 255, 255, .2); }
.button-primary:disabled { background: #9CC0F2; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); cursor: not-allowed; transform: none; }

.button-secondary {
    background: var(--surface);
    color: var(--blue-deep);
    box-shadow: var(--clay-sm);
    border: var(--border) solid var(--blue-tint);
}
.button-secondary:hover { background: var(--blue-tint); }
.button-secondary:active { box-shadow: var(--clay-pressed); }

.button .spinner { display: none; }
.button.is-busy .spinner {
    display: block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 44px; height: 44px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.icon-button:hover { background: var(--blue-tint); }

/* ---------- Header ---------- */

/* Floating glass pill: sits over the page (negative margin) and stays put on scroll. */
.site-header {
    --header-gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: var(--header-gap) var(--gutter) 0;
    margin-bottom: calc(-1 * (var(--header-h) + var(--header-gap)));
    pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.glass {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .8);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 16px 32px -16px rgba(11, 61, 145, .4), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -2px 0 rgba(16, 64, 150, .05);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--header-h);
    max-width: 1140px;
    padding-inline: 12px 8px;
    border-radius: 999px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}
.brand-mark { flex: none; border-radius: 11px; box-shadow: 0 6px 12px -6px rgba(22, 119, 242, .8); }
.brand-name {
    font: 600 var(--text-xl)/1 "Fredoka", "Nunito", system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-nav { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}

/* Language switcher */
.lang { position: relative; }
.lang-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    border: var(--border) solid var(--blue-tint);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--clay-sm);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.lang-button::-webkit-details-marker { display: none; }
.lang-chevron { transition: transform .2s var(--bounce); }
.lang[open] .lang-chevron { transform: rotate(180deg); }
.lang-current { display: none; }

.lang-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    min-width: 176px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--surface);
    border: var(--border) solid #fff;
    border-radius: var(--r-md);
    box-shadow: var(--clay);
}
.lang-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}
.lang-menu a:hover { background: var(--bg); }
.lang-menu a[aria-current] { background: var(--blue-tint); color: var(--blue-deep); }
.lang-menu a[lang="ps"], .lang-menu a[lang="fa"] { font-family: "Vazirmatn", Tahoma, sans-serif; }

/* The help icon and the account controls stay hidden on phones; the mobile menu carries both. */
.header-help { display: none; }

/* Mobile menu */
.header-menu-button .when-open { display: none; }
.header-menu-button[aria-expanded="true"] .when-open { display: block; }
.header-menu-button[aria-expanded="true"] .when-closed { display: none; }

.mobile-menu {
    max-width: 1140px;
    margin: 8px auto 0;
    padding: 8px 16px 20px;
    border-radius: var(--r-lg);
}
.mobile-menu .container { padding: 0; }
.mobile-menu .container > a {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding-inline: 12px;
    border-bottom: 2px solid var(--bg);
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}
.mobile-menu .container > a[aria-current="page"] {
    margin-block: 4px;
    border-bottom-color: transparent;
    border-radius: var(--r-sm);
    background: #fff;
    box-shadow: var(--clay-sm);
    color: var(--blue-deep);
}
/* Secondary links (about + legal): smaller two-up chips */
.mobile-menu-more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}
.mobile-menu-more a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 12px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .6);
    color: var(--ink-2);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}
.mobile-menu-more a[aria-current="page"] { background: #fff; color: var(--blue-deep); box-shadow: var(--clay-sm); }
.mobile-menu-langs,
.footer-langs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.mobile-menu-langs { margin-top: 20px; }
.mobile-menu-langs a,
.footer-langs a {
    display: grid;
    place-items: center;
    min-height: 46px;
    border-radius: var(--r-sm);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}
.mobile-menu-langs a { background: var(--bg); box-shadow: var(--clay-sm); }
.mobile-menu-langs a[aria-current] { background: var(--blue); color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.mobile-menu-langs a[lang="ps"], .mobile-menu-langs a[lang="fa"],
.footer-langs a[lang="ps"], .footer-langs a[lang="fa"] { font-family: "Vazirmatn", Tahoma, sans-serif; }

@media (min-width: 480px) {
    .lang-current { display: inline; }
}

@media (min-width: 860px) {
    :root { --header-h: 72px; }
}

/* Desktop nav: brand, links, "more" dropdown, CTA and language must share one row,
   so it only appears once there is room for all of them (Pashto/Farsi included). */
.header-nav > a,
.nav-more-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .2s, box-shadow .2s;
}
.header-nav > a:hover,
.nav-more-button:hover { background: rgba(255, 255, 255, .7); }
.header-nav > a[aria-current="page"],
.nav-more.is-active .nav-more-button {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--clay-sm);
}

.nav-more { position: relative; }
.nav-more-button { cursor: pointer; list-style: none; user-select: none; }
.nav-more-button::-webkit-details-marker { display: none; }
.nav-more-chevron { transition: transform .2s var(--bounce); }
.nav-more[open] .nav-more-chevron { transform: rotate(180deg); }
.nav-more[open] .nav-more-button { background: #fff; box-shadow: var(--clay-pressed); }
.nav-more-menu {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% + 10px);
    min-width: 232px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--surface);
    border: var(--border) solid #fff;
    border-radius: var(--r-md);
    box-shadow: var(--clay);
}
.nav-more-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--ink);
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}
.nav-more-menu a:hover { background: var(--bg); }
.nav-more-menu a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-deep); }

/* ---------- Header account (log in / sign up / account menu) ---------- */

/* Desktop only (shown from 960px); on phones the mobile menu carries these. */
.header-auth { display: none; align-items: center; gap: 4px; }
.header-login.button-small { gap: 6px; padding-inline: 14px 18px; white-space: nowrap; }
.header-login[aria-current="page"] { background: var(--blue-press); }
/* Quieter text button next to Log in (tighter padding until 1120px). */
.header-signup {
    display: none;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--blue-deep);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .2s, box-shadow .2s;
}
.header-signup:hover { background: rgba(255, 255, 255, .7); }
.header-signup[aria-current="page"] { background: #fff; box-shadow: var(--clay-sm); }

.account-menu { position: relative; }
.account-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding-inline: 3px 10px;
    border: var(--border) solid var(--blue-tint);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--clay-sm);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: box-shadow .2s, border-color .2s;
}
.account-button::-webkit-details-marker { display: none; }
.account-button:hover { border-color: var(--blue-line); }
.account-menu.is-active .account-button { border-color: var(--blue-line); color: var(--blue-deep); }
.account-menu[open] .account-button { box-shadow: var(--clay-pressed); }
.account-avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font: 600 var(--text-sm)/1 var(--font-display);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .22);
}
.account-name {
    max-width: 12ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-chevron { transition: transform .2s var(--bounce); }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.account-menu-panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    width: max-content;
    min-width: 232px;
    max-width: 288px;
    padding: 8px;
    background: var(--surface);
    border: var(--border) solid #fff;
    border-radius: var(--r-md);
    box-shadow: var(--clay);
}
.account-menu-who {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
    padding: 8px 12px 12px;
    border-bottom: 2px solid var(--bg);
    line-height: 1.3;
}
.account-menu-name,
.account-menu-email,
.mobile-menu-user-name,
.mobile-menu-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu-name { font-weight: 800; }
.account-menu-email { color: var(--ink-2); font-size: var(--text-sm); text-align: start; unicode-bidi: plaintext; }
.account-menu-panel a,
.account-menu-panel button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.3;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}
.account-menu-panel form { margin: 0; }
.account-menu-panel a:hover,
.account-menu-panel button:hover { background: var(--bg); }
.account-menu-panel a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-deep); }
.account-menu-panel .icon { color: var(--ink-2); }
[dir="rtl"] .icon-logout { transform: scaleX(-1); }

/* Mobile menu: account block above the page links. */
.mobile-menu-account {
    display: grid;
    gap: 8px;
    padding-block: 8px 16px;
    border-bottom: 2px solid var(--bg);
}
.mobile-menu-account .button { min-height: 48px; }
.mobile-menu-account .button[aria-current="page"] { box-shadow: var(--clay-pressed); }
.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 4px 12px;
}
.mobile-menu-user .account-avatar { width: 40px; height: 40px; font-size: var(--text-lg); }
.mobile-menu-user-text { display: grid; min-width: 0; line-height: 1.3; }
.mobile-menu-user-name { font-weight: 800; }
.mobile-menu-user-email { color: var(--ink-2); font-size: var(--text-sm); text-align: start; unicode-bidi: plaintext; }
.mobile-menu-account-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mobile-menu-account-links form { display: grid; margin: 0; }
.mobile-menu-account-links a,
.mobile-menu-account-links button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 4px 12px;
    border: 0;
    border-radius: var(--r-sm);
    background: #fff;
    box-shadow: var(--clay-sm);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.3;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}
.mobile-menu-account-links a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-deep); }
.mobile-menu-account-links .icon { color: var(--ink-2); }

@media (min-width: 960px) {
    .header-nav {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-inline-start: 16px;
    }
    .header-auth { display: flex; }
    .header-signup { display: inline-flex; }
    .account-name { max-width: 9ch; }
    .header-actions { gap: 8px; }
    /* Language button shrinks to icon + chevron until there is room for its label. */
    .header-actions .lang-current { display: none; }
    .header-menu-button { display: none; }
    .mobile-menu { display: none !important; }
}

@media (min-width: 1120px) {
    .header-nav { gap: 8px; margin-inline-start: 24px; }
    .header-nav > a, .nav-more-button { padding-inline: 16px; }
    .header-actions .lang-current { display: inline; }
    .header-signup { padding-inline: 12px; }
    .account-name { max-width: 12ch; }
}

/* ---------- Hero: the form on a blue clay band ---------- */

.hero {
    position: relative;
    isolation: isolate;
    padding: calc(var(--header-h) + 40px) 0 40px;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: -2;
    height: calc(var(--header-h) + 232px);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    background: var(--dots), var(--blue-block);
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .08);
}

.hero-inner { position: relative; }
.hero-inner .topup-card { max-width: 560px; margin-inline: auto; }

.hero-shapes { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.shape {
    position: absolute;
    display: block;
    box-shadow: 0 14px 22px -10px rgba(5, 25, 70, .55), inset 0 -6px 0 rgba(0, 0, 0, .12), inset 0 5px 8px rgba(255, 255, 255, .55);
}
.shape-sun { width: 84px; height: 84px; border-radius: 50%; background: var(--sun-strong); top: -30px; inset-inline-end: -24px; }
.shape-mint { width: 30px; height: 30px; border-radius: 10px; background: #3DDBA6; top: calc(var(--header-h) + 28px); inset-inline-start: 6px; transform: rotate(18deg); }
.shape-coral { width: 70px; height: 28px; border-radius: 999px; background: #FF7A66; top: calc(var(--header-h) + 164px); inset-inline-end: -30px; transform: rotate(-14deg); }

@media (min-width: 960px) {
    .hero { padding: calc(var(--header-h) + 64px) 0 72px; }
    .hero::before { inset: 0 20px auto; height: calc(var(--header-h) + 400px); border-radius: 0 0 56px 56px; }
    .shape-sun { width: 150px; height: 150px; top: calc(var(--header-h) + 72px); inset-inline-end: auto; inset-inline-start: calc(50% - 470px); }
    .shape-mint { width: 52px; height: 52px; top: calc(var(--header-h) + 260px); inset-inline-start: calc(50% - 380px); }
    .shape-coral { width: 130px; height: 46px; top: calc(var(--header-h) + 132px); inset-inline-end: calc(50% - 470px); }
}

/* ---------- Top-up card ---------- */

.topup-card {
    position: relative;
    padding: 8px 12px 12px;
    background: var(--surface);
    border: 4px solid #fff;
    border-radius: var(--r-xl);
    box-shadow: 0 28px 48px -22px rgba(16, 64, 150, .45), inset 0 -8px 0 rgba(16, 64, 150, .05);
}

/* The recipient pass: a sun-yellow clay block */
.pass {
    position: relative;
    isolation: isolate;
    padding: 20px 20px 16px;
    border-radius: var(--r-lg);
    background: linear-gradient(160deg, #FFDB5C 0%, var(--sun-strong) 100%);
    color: var(--ink);
    overflow: hidden;
    box-shadow: inset 0 -6px 0 rgba(150, 90, 0, .16), inset 0 4px 6px rgba(255, 255, 255, .55);
}
.pass-ridge {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: -1;
    width: 100%;
    height: 60px;
    color: #C98A00;
}
.pass-signal {
    position: absolute;
    top: 48px;
    inset-inline-end: 14px;
    z-index: -1;
    color: rgba(23, 43, 77, .16);
}
.pass-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--text-sm);
    font-weight: 700;
}
.pass-country { display: inline-flex; align-items: center; gap: 8px; }
.pass .country-badge { background: rgba(255, 255, 255, .6); color: var(--ink); }
.pass-operator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    color: rgba(23, 43, 77, .7);
    font-size: var(--text-sm);
    font-weight: 700;
    transition: background-color .2s, transform .3s var(--bounce);
}
.pass-operator::before {
    content: "";
    width: 9px; height: 9px;
    border-radius: 50%;
    background: rgba(23, 43, 77, .3);
}
.pass-operator.is-set { background: #fff; color: var(--ink); box-shadow: 0 4px 10px -4px rgba(120, 70, 0, .45); }
.pass-operator.is-set::before { background: var(--op); }
.pass-label {
    margin-top: 16px;
    color: rgba(23, 43, 77, .72);
    font-size: var(--text-sm);
    font-weight: 700;
}
.pass-number {
    margin-top: 2px;
    font: 700 clamp(1.5rem, 1.1rem + 2vw, 1.9rem)/1.2 var(--font-num);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    text-align: start;
    white-space: nowrap;
}
[dir="rtl"] .pass-number { text-align: end; }
.pass-number.is-empty { color: rgba(23, 43, 77, .38); }
.pass-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: var(--text-base);
    font-weight: 700;
}
.pass-bottom small { display: block; font-weight: 700; color: rgba(23, 43, 77, .72); font-size: var(--text-sm); }
.pass-total { font: 700 var(--text-2xl)/1 var(--font-num); }

.country-badge {
    display: inline-grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 10px;
    background: var(--blue-tint);
    color: var(--blue-deep);
    font: 700 var(--text-xs)/1 var(--font-num);
    letter-spacing: .02em;
}

/* The form */
.topup-form {
    display: grid;
    gap: 24px;
    padding: 20px 8px 16px;
}
@media (min-width: 375px) { .topup-form { padding-inline: 12px; } }
@media (min-width: 960px) { .topup-form { padding: 24px 16px 16px; } }

.topup-title { font: 600 var(--text-2xl)/1.2 var(--font-display); }
[dir="rtl"] .topup-title { font-weight: 700; }

.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label {
    padding: 0;
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: 700;
}
.field-msg {
    min-height: 1.25em;
    color: var(--ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.45;
}
.field-msg:empty { min-height: 0; }
.field.has-error .field-msg { color: var(--red); font-weight: 700; }
.field-msg.is-success { color: var(--green); }

/* Inputs: pressed-in clay wells */
.input,
.phone-input {
    width: 100%;
    min-height: 58px;
    border: var(--border) solid var(--line);
    border-radius: var(--r-md);
    background: var(--field);
    box-shadow: inset 0 3px 6px rgba(16, 64, 150, .07);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input { padding: 0 16px; font-size: var(--text-lg); font-weight: 700; }
.input:focus, .phone-input:focus-within {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(22, 119, 242, .16);
}
.field.has-error .input,
.field.has-error .phone-input { border-color: var(--red); background: #FFF8F6; }
.field.has-error .phone-input:focus-within { box-shadow: 0 0 0 5px rgba(196, 50, 10, .12); }

.phone-input { display: flex; align-items: center; overflow: hidden; }
.phone-prefix {
    display: flex;
    align-items: center;
    align-self: stretch;
    margin: 8px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    background: #fff;
    box-shadow: var(--clay-sm);
    color: var(--ink);
    font: 700 var(--text-lg)/1 var(--font-num);
}
.phone-input input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    font: 700 var(--text-xl)/1 var(--font-num);
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
}
.phone-input input:focus { outline: none; box-shadow: none; }
.phone-input input::placeholder { color: #A3B1C7; font-weight: 700; }
.phone-operator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: stretch;
    margin: 8px;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: var(--r-sm);
    background: #fff;
    box-shadow: var(--clay-sm);
    color: var(--ink-2);
    font: 700 var(--text-sm)/1 var(--font-ui);
    cursor: pointer;
    animation: pop .35s var(--bounce);
    -webkit-tap-highlight-color: transparent;
}
.phone-operator[aria-expanded="true"] { box-shadow: var(--clay-pressed); background: var(--blue-tint); }
.phone-operator[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.phone-operator > .icon { transition: transform .2s var(--bounce); }
.phone-operator-name { display: none; color: var(--ink); }
@media (min-width: 480px) { .phone-operator-name { display: inline; } }
/* A logo already carries the operator's name, so the badge shows just the logo, kept compact. */
.phone-operator .op-mark.has-logo { max-width: 58px; }
.phone-operator .has-logo ~ .phone-operator-name { display: none; }
/* Small phones: tighten the box so all 9 digits stay visible next to "+93" and the operator badge. */
@media (max-width: 419px) {
    .phone-input input { padding: 0 8px; font-size: var(--text-lg); letter-spacing: 0; }
    .phone-prefix { margin: 4px; padding: 0 8px; font-size: var(--text-base); }
    .phone-operator { margin: 4px; padding: 0 4px 0 4px; gap: 2px; }
}
@media (max-width: 359px) {
    .phone-input input { font-size: var(--text-base); }
    .phone-operator { padding-inline: 2px; }
    .phone-operator .op-mark.has-logo { max-width: 46px; padding-inline: 3px; }
    .topup-card { padding-inline: 8px; }
    .topup-form { padding-inline: 4px; }
}
@keyframes pop { from { transform: scale(.4); } }

/* Selection tiles: raised clay; selected = pressed in, tinted blue */
.operator-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
@media (min-width: 420px) { .operator-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.operator-chip,
.segment,
.product {
    position: relative;
    border: var(--border) solid #fff;
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--clay-sm), 0 0 0 1px var(--line);
    cursor: pointer;
    transition: transform .25s var(--bounce), box-shadow .2s ease-out, background-color .2s, border-color .2s;
    -webkit-tap-highlight-color: transparent;
}
.operator-chip:active,
.segment:active,
.product:active { transform: scale(.96); }

.operator-chip input,
.segment input,
.product input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.operator-chip:has(input:checked),
.segment:has(input:checked),
.product:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-tint);
    box-shadow: var(--clay-pressed);
}
.operator-chip:has(input:focus-visible),
.segment:has(input:focus-visible),
.product:has(input:focus-visible) { box-shadow: var(--focus); }

.operator-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 8px 12px;
}
.operator-name { font-size: var(--text-base); font-weight: 700; line-height: 1.2; }
/* The logo already shows the name: centre it and keep the text for screen readers only. */
.operator-chip:has(.has-logo) { justify-content: center; }
.operator-chip .has-logo + .operator-name {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.field.has-error .operator-chip { box-shadow: var(--clay-sm), 0 0 0 2px #F6B8A6; }

.op-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--op-size);
    height: var(--op-size);
    border-radius: 32%;
    background: color-mix(in srgb, var(--op) 16%, #fff);
    color: var(--op);
    font: 700 calc(var(--op-size) * .46)/1 "Fredoka", "Nunito", sans-serif;
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--op) 22%, transparent), inset 0 2px 3px rgba(255, 255, 255, .9);
    overflow: hidden;
}
/* Logos keep their own shape on a white plate; the plate is as tall as the mark would be. */
.op-mark.has-logo {
    width: auto;
    min-width: var(--op-size);
    max-width: calc(var(--op-size) * 2.6);
    padding: calc(var(--op-size) * .12) calc(var(--op-size) * .18);
    border-radius: calc(var(--op-size) * .3);
    background: #fff;
    box-shadow: inset 0 -3px 0 rgba(16, 64, 150, .06), 0 0 0 1px var(--line);
}
.op-mark img { display: block; width: auto; height: calc(var(--op-size) * .76); max-width: 100%; object-fit: contain; }

/* Service */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.segment {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 68px;
    padding: 12px;
    color: var(--blue);
}
.segment > .icon {
    padding: 8px;
    width: 34px; height: 34px;
    border-radius: 11px;
    background: var(--blue-tint);
}
.segment strong { display: block; color: var(--ink); font-size: var(--text-base); font-weight: 700; line-height: 1.25; }
.segment small { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--text-sm); font-weight: 400; line-height: 1.35; }
.segment:has(input:checked) > .icon { background: var(--blue); color: #fff; }
/* Phones: icon above the text so the label and hint get the card's full width. */
@media (max-width: 479px) { .segment { flex-direction: column; gap: 8px; } }

/* Products */
.products { min-height: 96px; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.product {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 92px;
    padding: 16px;
    text-align: start;
}
.product-title { font: 700 var(--text-xl)/1.2 var(--font-num); color: var(--ink); }
[dir="rtl"] .product-title { font-family: var(--font-ui); }
.product-detail { color: var(--ink-2); font-size: var(--text-sm); font-weight: 400; line-height: 1.35; }
.product-price {
    justify-self: start;
    margin-top: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--sky);
    color: var(--blue-deep);
    font: 700 var(--text-base)/1 var(--font-num);
}
.product:has(input:checked) .product-price { background: var(--blue); color: #fff; }
.product-check {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    display: none;
    place-items: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
    animation: pop .35s var(--bounce);
}
.product:has(input:checked) .product-check { display: grid; }

.skeleton {
    min-height: 92px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, #E9F0FA 0%, #F6F9FF 50%, #E9F0FA 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.products-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: var(--r-md);
    background: var(--field);
    box-shadow: inset 0 3px 8px rgba(16, 64, 150, .07);
    color: var(--ink-2);
    font-size: var(--text-base);
    font-weight: 500;
    text-align: center;
}
.products-state .icon {
    padding: 12px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--blue);
    box-shadow: var(--clay-sm);
}
.products-state.is-error { background: var(--red-tint); color: var(--red); }
.products-state.is-error .icon { color: var(--red); }
.products-state .button { margin-top: 4px; }

/* Summary */
.summary {
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--sky);
    box-shadow: inset 0 -5px 0 rgba(16, 64, 150, .06), inset 0 3px 6px rgba(255, 255, 255, .8);
}
.summary h3 { font: 600 var(--text-lg)/1.2 var(--font-display); }
[dir="rtl"] .summary h3 { font-weight: 700; }
.summary-empty { margin-top: 8px; color: #3E5578; font-size: var(--text-base); font-weight: 400; }
.summary-list { display: grid; gap: 0; margin: 12px 0 0; }
.summary-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-block: 8px;
}
.summary-list dt { color: #3E5578; font-size: var(--text-base); font-weight: 500; }
.summary-list dd {
    margin: 0;
    min-width: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: end;
    overflow-wrap: anywhere;
}
.summary-total {
    margin-top: 8px;
    padding: 16px 16px !important;
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: var(--clay-sm);
}
.summary-total dt { color: var(--ink); font-weight: 700; font-size: var(--text-base); }
.summary-total dd { font: 700 var(--text-2xl)/1 var(--font-num); color: var(--blue-deep); }

/* Notices */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.45;
}
.notice .icon { margin-top: 1px; }
.notice strong { display: block; margin-bottom: 2px; }
.notice-info { background: var(--sky); color: #1A4890; }
.notice-error { background: var(--red-tint); color: var(--red); }
.notice-warn { background: var(--amber-tint); color: var(--amber); }

/* ---------- Sections: colour blocks ---------- */

.section { padding-block: 32px; }
.section-title {
    font-family: var(--font-display);
    font-size: var(--text-display);
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
    text-wrap: balance;
}
[dir="rtl"] .section-title { line-height: 1.4; font-weight: 600; }
.section-lead { margin-top: 8px; color: var(--ink-2); font-size: var(--text-lg); font-weight: 400; }

.block {
    padding: 28px 20px;
    border: 4px solid rgba(255, 255, 255, .7);
    border-radius: var(--r-xl);
    box-shadow: var(--clay);
}
.block-lilac { background: var(--lilac); }

@media (min-width: 960px) {
    .section { padding-block: 56px; }
    .block { padding: 56px; border-radius: 48px; }
}

/* Benefits: one vibrant clay block each */
.benefits {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.benefit {
    --tint: var(--sky);
    --strong: var(--blue);
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 16px;
    row-gap: 2px;
    padding: 20px;
    border: 4px solid rgba(255, 255, 255, .75);
    border-radius: var(--r-lg);
    background: var(--tint);
    box-shadow: var(--clay);
}
.benefit:nth-child(2) { --tint: var(--mint); --strong: var(--mint-strong); }
.benefit:nth-child(3) { --tint: var(--sun); --strong: #B07800; }
.benefit:nth-child(4) { --tint: var(--coral); --strong: var(--coral-strong); }
.benefit-icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 18px;
    background: #fff;
    color: var(--strong);
    box-shadow: var(--clay-sm);
}
.benefit h3 { padding-top: 4px; font: 600 var(--text-xl)/1.25 var(--font-display); }
[dir="rtl"] .benefit h3 { font-weight: 700; }
.benefit p { color: #33476A; font-size: var(--text-base); font-weight: 400; }

@media (min-width: 640px) { .benefits { grid-template-columns: 1fr 1fr; gap: 20px; } }
@media (min-width: 1024px) {
    .benefits { grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 32px; }
    .benefit { grid-template-columns: 1fr; row-gap: 8px; padding: 28px; min-height: 250px; align-content: start; }
    .benefit-icon { grid-row: auto; margin-bottom: 16px; width: 64px; height: 64px; }
}

/* Steps: numbered clay coins on the lilac block */
.steps {
    display: grid;
    gap: 16px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.step {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    align-items: start;
    padding: 16px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--clay-sm);
}
.step-number {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font: 600 var(--text-2xl)/1 "Fredoka", "Nunito", sans-serif;
    box-shadow: 0 8px 14px -6px rgba(22, 119, 242, .7), inset 0 -4px 0 rgba(0, 0, 0, .2), inset 0 3px 0 rgba(255, 255, 255, .25);
}
.step:nth-child(2) .step-number { background: var(--coral-strong); box-shadow: 0 8px 14px -6px rgba(242, 85, 63, .7), inset 0 -4px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .25); }
.step:nth-child(3) .step-number { background: var(--mint-strong); box-shadow: 0 8px 14px -6px rgba(15, 168, 120, .7), inset 0 -4px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .25); }
.step h3 { padding-top: 4px; font: 600 var(--text-xl)/1.25 var(--font-display); }
[dir="rtl"] .step h3 { font-weight: 700; }
.step p { margin-top: 2px; color: var(--ink-2); font-size: var(--text-base); font-weight: 400; }

@media (min-width: 860px) {
    .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
    .step { grid-template-columns: 1fr; gap: 16px; padding: 24px; }
    .step-number { width: 60px; height: 60px; font-size: var(--text-3xl); }
}

/* Operators: an endless strip of logo tiles */
.operator-marquee {
    margin-top: 24px;
    padding-block: 24px 36px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.operator-track {
    display: flex;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
    animation: marquee 26s linear infinite;
}
[dir="rtl"] .operator-track { animation-name: marquee-rtl; }
.operator-marquee:hover .operator-track,
.operator-marquee:focus-within .operator-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

.operator-logo {
    position: relative;
    display: grid;
    place-items: center;
    width: 190px;
    height: 120px;
    /* spacing as margin, not gap, so each half of the track is exactly 50% wide */
    margin-inline-end: 16px;
    border: 4px solid rgba(255, 255, 255, .85);
    border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--op) 8%, #fff);
    box-shadow: var(--clay);
}
.operator-logo .op-mark.has-logo { box-shadow: none; background: transparent; max-width: 150px; }
.operator-logo {
    transition: transform .4s var(--bounce), box-shadow .3s ease-out, background-color .3s;
    -webkit-tap-highlight-color: transparent;
}
.operator-logo .op-mark { transition: transform .4s var(--bounce); }
/* Hover (or tap on phones): the tile springs up and the logo gives a little wiggle. */
.operator-logo:hover,
.operator-logo:active {
    transform: translateY(-12px) scale(1.04);
    background: color-mix(in srgb, var(--op) 16%, #fff);
    box-shadow: 0 32px 40px -18px rgba(16, 64, 150, .5), var(--clay-in);
}
.operator-logo:hover .op-mark,
.operator-logo:active .op-mark {
    transform: scale(1.1);
    animation: logo-wiggle .6s var(--bounce);
}
@keyframes logo-wiggle {
    0% { transform: scale(1) rotate(0); }
    30% { transform: scale(1.16) rotate(-6deg); }
    60% { transform: scale(1.1) rotate(4deg); }
    100% { transform: scale(1.1) rotate(0); }
}
.operator-logo-name {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (min-width: 960px) {
    .operator-marquee { margin-top: 32px; }
    .operator-logo { width: 220px; height: 136px; margin-inline-end: 24px; }
}

/* No motion: a still, centred row of the five logos. */
@media (prefers-reduced-motion: reduce) {
    .operator-marquee { -webkit-mask-image: none; mask-image: none; }
    .operator-track { flex-wrap: wrap; justify-content: center; gap: 16px; width: auto; padding-inline: var(--gutter); animation: none; }
    .operator-logo { margin: 0; }
    .operator-logo[aria-hidden="true"] { display: none; }
}

/* FAQ: stacked clay pills */
.faq { display: grid; gap: 12px; margin-top: 24px; }
.faq-item {
    border: var(--border) solid #fff;
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--clay-sm);
    transition: box-shadow .2s;
}
.faq-item[open] { box-shadow: var(--clay); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 16px 20px;
    font-weight: 700;
    font-size: var(--text-lg);
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon {
    padding: 8px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--blue-tint);
    color: var(--blue);
    transition: transform .3s var(--bounce), background-color .2s;
}
.faq-item[open] summary .icon { transform: rotate(180deg); background: var(--blue); color: #fff; }
.faq-item p { max-width: 64ch; padding: 0 20px 20px; color: var(--ink-2); font-weight: 400; }

/* ---------- Inner pages ---------- */

.page { padding-block: calc(var(--header-h) + 36px) 56px; }
@media (min-width: 960px) { .page { padding-block: calc(var(--header-h) + 64px) 96px; } }

.panel,
.order-card {
    background: var(--surface);
    border: 4px solid #fff;
    border-radius: var(--r-xl);
    box-shadow: var(--clay);
    overflow: hidden;
}
.order-card { padding: 12px; }
.panel { padding: 28px 20px; }
@media (min-width: 640px) { .panel { padding: 40px; } }
.page-title { font: 600 var(--text-3xl)/1.15 var(--font-display); }
[dir="rtl"] .page-title { line-height: 1.4; font-weight: 700; }
.page-lead { margin-top: 8px; color: var(--ink-2); font-weight: 400; }
.stack { display: grid; gap: 20px; margin-top: 24px; }

.prose p { max-width: 64ch; margin-top: 16px; color: #3D4F6E; font-weight: 400; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink) !important; }

.order-body { display: grid; gap: 20px; padding: 24px 12px 12px; }
@media (min-width: 640px) { .order-body { padding: 28px 24px 20px; } }
.order-title { font: 600 var(--text-3xl)/1.2 var(--font-display); }
.order-ref {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 16px;
    border-radius: var(--r-md);
    background: var(--sky);
    box-shadow: inset 0 -4px 0 rgba(16, 64, 150, .06);
}
.order-ref > span { flex-basis: 100%; color: #3E5578; font-size: var(--text-sm); font-weight: 700; }
.order-ref strong { font: 700 var(--text-2xl)/1.2 var(--font-num); letter-spacing: .04em; color: var(--blue-deep); }
.order-ref .button { margin-inline-start: auto; }

.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--amber-tint);
    color: var(--amber);
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06);
}
.status-paid, .status-processing { background: var(--blue-tint); color: var(--blue-deep); }
.status-completed { background: var(--green-tint); color: var(--green); }
.status-failed, .status-cancelled { background: var(--red-tint); color: var(--red); }

/* ---------- Footer: deep blue block ---------- */

.site-footer {
    margin-top: 32px;
    padding-block: 44px calc(28px + var(--safe-bottom));
    background: var(--dots), var(--blue-deep);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    color: #CFE0FA;
}
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.footer-brand { grid-column: 1 / -1; display: grid; gap: 12px; }
.footer-brand p { max-width: 36ch; font-size: var(--text-base); font-weight: 400; }
.footer-col { display: grid; align-content: start; gap: 2px; }
.footer-col h2 { margin-bottom: 8px; color: #fff; font: 600 var(--text-lg)/1.3 var(--font-display); }
[dir="rtl"] .footer-col h2 { font-weight: 700; }
.footer-col a {
    display: flex;
    align-items: center;
    min-height: 42px;
    color: #CFE0FA;
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: 500;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
    display: grid;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(255, 255, 255, .12);
    font-size: var(--text-sm);
    font-weight: 400;
}
.footer-langs a { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.footer-langs a[aria-current] { background: var(--sun-strong); color: var(--ink); box-shadow: inset 0 -4px 0 rgba(140, 80, 0, .25); }

@media (min-width: 860px) {
    .site-footer { border-radius: 48px 48px 0 0; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .footer-brand { grid-column: auto; align-content: start; }
    .footer-bottom { grid-template-columns: 1fr auto; align-items: center; }
    .footer-langs { grid-template-columns: repeat(3, auto); }
    .footer-langs a { padding-inline: 20px; }
}

/* ---------- Sticky mobile CTA ---------- */

.sticky-cta {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
    background: rgba(255, 255, 255, .95);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px -12px rgba(16, 64, 150, .35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: rise .3s var(--bounce);
}
@keyframes rise { from { transform: translateY(100%); } }
@media (min-width: 960px) { .sticky-cta { display: none !important; } }

/* ---------- Motion preferences ---------- */

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

/* ---------- Error pages (errors/branded.blade.php) ---------- */

/* Same blue clay band as the homepage hero; top padding clears the floating header. */
.error-hero {
    position: relative;
    isolation: isolate;
    padding: calc(var(--header-h) + 40px) 0 40px;
    overflow: hidden;
}
.error-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: -2;
    height: calc(var(--header-h) + 200px);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    background: var(--dots), var(--blue-block);
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .08);
}
.error-shapes { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.error-shape-sun { width: 84px; height: 84px; border-radius: 50%; background: var(--sun-strong); top: -28px; inset-inline-end: -20px; }
.error-shape-mint { width: 28px; height: 28px; border-radius: 8px; background: #3DDBA6; top: calc(var(--header-h) + 24px); inset-inline-start: 8px; transform: rotate(18deg); }
.error-shape-coral { width: 64px; height: 28px; border-radius: 999px; background: #FF7A66; top: calc(var(--header-h) + 140px); inset-inline-end: -24px; transform: rotate(-14deg); }

.error-card {
    max-width: 560px;
    margin-inline: auto;
    padding: 32px 20px 24px;
    background: var(--surface);
    border: 4px solid #fff;
    border-radius: var(--r-xl);
    box-shadow: 0 28px 48px -22px rgba(16, 64, 150, .45), inset 0 -8px 0 rgba(16, 64, 150, .05);
    text-align: center;
}
.error-code {
    font: 600 clamp(4.5rem, 3.5rem + 5vw, 7rem)/1 var(--font-display);
    color: var(--blue);
    letter-spacing: .02em;
    /* a chunky clay "extrusion": Y-only so nothing needs mirroring */
    text-shadow: 0 6px 0 var(--sky), 0 12px 16px rgba(16, 64, 150, .2);
}
.error-title {
    margin-top: 20px;
    font: 600 var(--text-3xl)/1.15 var(--font-display);
    text-wrap: balance;
}
[dir="rtl"] .error-title { line-height: 1.4; font-weight: 700; }
.error-text {
    max-width: 44ch;
    margin: 12px auto 0;
    color: var(--ink-2);
    font-size: var(--text-lg);
    font-weight: 400;
}
.error-actions {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}
.error-actions .button { padding-inline: 20px; }

@media (min-width: 480px) {
    .error-card { padding: 40px 32px 32px; }
    .error-actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
    .error-hero { padding: calc(var(--header-h) + 64px) 0 72px; }
    .error-hero::before { inset: 0 20px auto; height: calc(var(--header-h) + 280px); border-radius: 0 0 56px 56px; }
    .error-card { padding: 48px 40px 40px; }
    .error-shape-sun { width: 140px; height: 140px; top: calc(var(--header-h) + 48px); inset-inline-end: auto; inset-inline-start: calc(50% - 460px); }
    .error-shape-mint { width: 48px; height: 48px; top: calc(var(--header-h) + 220px); inset-inline-start: calc(50% - 380px); }
    .error-shape-coral { width: 120px; height: 44px; top: calc(var(--header-h) + 112px); inset-inline-end: calc(50% - 460px); }
}

/* Small phones: keep the full brand name visible next to the language and menu buttons. */
@media (max-width: 399px) {
    .brand { gap: 8px; }
    .brand-name { font-size: var(--text-lg); }
}
@media (max-width: 359px) {
    .brand-name { font-size: var(--text-base); }
    .lang-button { padding-inline: 10px; }
    .lang-button .lang-chevron { display: none; }
}
@media (min-width: 960px) and (max-width: 1119px) {
    .brand-name { font-size: var(--text-lg); }
}
