/* Briefee — base, chrome (navbars, footers), update modal, toasts.
   Page sections live in landing.css. */

:root {
    --bg:        #F7F7F5;
    --bg-2:      #EFEFEC;
    --navy:      #0A1155;
    --navy-2:    #141c6b;
    --navy-3:    #1d2680;
    --coral:     #F24535;
    --coral-2:   #d93a2b;
    --coral-soft:#FDE6E3;
    --text:      #6B6B73;
    --line:      #E6E6E6;
    --white:     #FFFFFF;

    --font: "Nunito", "Tajawal", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 20px;
    --shadow-sm: 0 1px 2px rgba(10, 17, 85, .05), 0 4px 12px rgba(10, 17, 85, .05);
    --shadow: 0 1px 2px rgba(10, 17, 85, .04), 0 12px 32px rgba(10, 17, 85, .08);
    --shadow-lg: 0 2px 4px rgba(10, 17, 85, .04), 0 24px 60px rgba(10, 17, 85, .14);
    --ease: cubic-bezier(.16, 1, .3, 1);

    --nav-h: 64px;     /* desktop floating nav height */
    --bar-h: 68px;     /* mobile bottom bar height */
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

h1, h2, h3, h4 { color: var(--navy); line-height: 1.12; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
a { color: var(--navy); }
img { max-width: 100%; height: auto; display: block; }
code { font-size: .88em; background: var(--line); color: var(--navy); padding: .1em .4em; border-radius: 6px; }
.icon { flex-shrink: 0; }
:focus-visible { outline: 3px solid rgba(242, 69, 53, .45); outline-offset: 3px; border-radius: 8px; }

.hl { color: var(--coral); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* Device switch: both chromes are rendered, the body class picks one */
.device-mobile  .only-desktop { display: none !important; }
.device-desktop .only-mobile  { display: none !important; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
    color: var(--coral); font-size: 12.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: currentColor; }

.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding-block: 7px; padding-inline: 8px 14px; border-radius: 999px;
    background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    color: var(--navy); font-size: 13.5px; font-weight: 800;
}
.chip__flag {
    display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg); font-size: 14px; line-height: 1;
}

/* ── Main + page transition ──────────────────────────────────── */
.app-main { flex: 1; outline: none; overflow-x: clip; transition: opacity .18s ease; }
.app-main.is-loading { opacity: .45; pointer-events: none; }
.app-main.is-entering { animation: pageIn .4s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.nav-progress {
    position: fixed; top: 0; inset-inline-start: 0; z-index: 200;
    height: 3px; width: 0; background: var(--coral);
    opacity: 0; transition: width .3s ease, opacity .3s ease;
}
.nav-progress.is-active { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
.nav-progress.is-done { opacity: 0; width: 100%; transition: width .2s ease, opacity .3s ease .2s; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 22px; border: 1.5px solid transparent; border-radius: 999px;
    font: 800 15px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--lg { padding: 16px 26px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy > .icon { animation: busy .8s linear infinite; }
@keyframes busy { 50% { opacity: .2; } }
.btn:disabled { cursor: default; }

.btn--primary { background: var(--coral); color: var(--white); box-shadow: 0 6px 18px rgba(242, 69, 53, .28); }
.btn--primary:hover { background: var(--coral-2); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(242, 69, 53, .34); }

.btn--ghost { background: transparent; color: var(--navy); border-color: rgba(10, 17, 85, .16); }
.btn--ghost:hover { border-color: var(--navy); background: var(--white); }
.btn--ghost .icon { transition: transform .2s var(--ease); }
.btn--ghost:hover .icon { transform: translateX(3px); }

.btn--light { background: rgba(255, 255, 255, .08); color: var(--white); border-color: rgba(255, 255, 255, .22); }
.btn--light:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }

/* ================================================================
   DESKTOP CHROME
   ================================================================ */

/* Floating pill navbar */
.fnav {
    position: fixed; top: 16px; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: center; padding: 0 24px;
    pointer-events: none;
}
.fnav__pill {
    pointer-events: auto;
    display: flex; align-items: center; gap: 24px;
    width: 100%; max-width: 1132px; height: var(--nav-h);
    padding-block: 0; padding-inline: 20px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 1px 2px rgba(10, 17, 85, .04), 0 8px 30px rgba(10, 17, 85, .06);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    transition: max-width .45s var(--ease), height .35s var(--ease), box-shadow .3s, background .3s;
}
.fnav.is-scrolled .fnav__pill {
    max-width: 1040px; height: 58px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 1px 2px rgba(10, 17, 85, .05), 0 16px 40px rgba(10, 17, 85, .12);
}

.fnav__brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--navy); font-size: 20px; font-weight: 900; letter-spacing: -.02em; }
.fnav__brand img { width: 26px; }

.fnav__links { display: flex; gap: 2px; margin: 0 auto; }
.fnav__link {
    position: relative; padding: 9px 14px; border-radius: 999px;
    color: var(--navy); font-size: 14.5px; font-weight: 700; text-decoration: none;
    transition: background .2s, color .2s;
}
.fnav__link:hover { background: rgba(10, 17, 85, .05); }
.fnav__link.is-active { background: var(--navy); color: var(--white); }

.fnav__actions { display: flex; align-items: center; gap: 6px; }
.fnav__icon {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    color: var(--navy); transition: background .2s, color .2s;
}
.fnav__icon:hover { background: var(--coral-soft); color: var(--coral); }

/* Store link: stands out from the section links */
.fnav__store {
    display: inline-flex; align-items: center; gap: 7px; margin-inline-start: 6px;
    padding: 9px 15px; border-radius: 999px;
    background: var(--coral-soft); color: var(--coral);
    font-size: 14.5px; font-weight: 900; text-decoration: none;
    transition: background .2s, color .2s, transform .2s var(--ease);
}
.fnav__store:hover { background: var(--coral); color: var(--white); transform: translateY(-1px); }
.fnav__store.is-active { background: var(--coral); color: var(--white); }
.fnav__storebtn.is-active { box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--coral); }

/* Account control */
.acct { position: relative; }
.acct__signin {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px;
    border-radius: 999px; border: 1.5px solid rgba(10, 17, 85, .14);
    color: var(--navy); font-size: 14px; font-weight: 800; text-decoration: none;
    transition: border-color .2s, background .2s;
}
.acct__signin:hover, .acct__signin.is-active { border-color: var(--navy); background: var(--white); }
.acct__menu summary { list-style: none; }
.acct__menu summary::-webkit-details-marker { display: none; }
.acct__btn {
    display: inline-flex; align-items: center; gap: 8px; height: 42px; padding-block: 0; padding-inline: 4px 12px;
    border-radius: 999px; cursor: pointer; color: var(--navy); font-size: 14px; font-weight: 800;
    transition: background .2s;
}
.acct__btn:hover, .acct__menu[open] .acct__btn { background: rgba(10, 17, 85, .06); }
.acct__menu[open] .acct__btn svg { transform: rotate(180deg); }
.acct__btn svg { transition: transform .25s var(--ease); }
.acct__drop {
    position: absolute; inset-inline-end: 0; top: calc(100% + 12px); z-index: 120; width: 280px; padding: 10px;
    background: var(--white); border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    animation: dropIn .25s var(--ease);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.acct__who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct__who strong { display: block; color: var(--navy); font-size: 15px; font-weight: 900; line-height: 1.25; }
.acct__who div { min-width: 0; }
.acct__who div span { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; max-width: 180px; white-space: nowrap; }
.acct__drop .role-badge { margin: 0 10px 6px; }
.acct__item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 14px;
    background: none; color: var(--navy); font: 700 14.5px var(--font); text-decoration: none; cursor: pointer; text-align: start;
    transition: background .2s, color .2s;
}
.acct__item:hover { background: var(--bg); }
.acct__item--out { color: var(--coral); }
.acct__item--out:hover { background: var(--coral-soft); }

.avatar {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--navy); color: var(--white); font-size: 13px; font-weight: 900; letter-spacing: .02em;
}
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; background: var(--coral); }
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }
.avatar--xl { width: 64px; height: 64px; font-size: 22px; background: var(--coral); }
.role-badge {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
    background: var(--navy); color: var(--white); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.role-badge--student { background: var(--coral-soft); color: var(--coral); }

/* Narrower windows: shed section links progressively, keep Store + account. */
.fnav__link, .fnav__store, .acct__signin, .fnav__actions .btn { white-space: nowrap; }
@media (max-width: 1280px) {
    .fnav__links .fnav__link:nth-child(3) { display: none; } /* How it works */
    .fnav__links .fnav__link:nth-child(1) { display: none; } /* What you get */
}
@media (max-width: 1080px) {
    .fnav__links .fnav__link { display: none; }
    .fnav__store { margin-inline-start: 0; }
}
@media (max-width: 760px) {
    .fnav__pill { gap: 12px; }
    .fnav__actions .btn--sm { padding: 10px 12px; }
}

/* Desktop footer */
.dfoot { padding: 0 16px 16px; margin-top: 40px; }
.dfoot__card {
    position: relative; overflow: hidden;
    max-width: 1300px; margin: 0 auto; padding: 64px 56px 28px;
    background: var(--navy); color: rgba(255, 255, 255, .62);
    border-radius: 36px;
}
.dfoot__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; gap: 36px; }
.dfoot__logo { display: inline-flex; align-items: center; gap: 12px; color: var(--white); font-size: 24px; font-weight: 900; text-decoration: none; letter-spacing: -.02em; margin-bottom: 16px; }
.dfoot__mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--white); }
.dfoot__mark img { width: 26px; }
.dfoot__brand p { max-width: 320px; font-size: 15px; line-height: 1.65; }
.dfoot__social { display: flex; gap: 8px; margin-top: 18px; }
.dfoot__social a {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255, 255, 255, .08); color: var(--white); transition: background .2s, transform .2s var(--ease);
}
.dfoot__social a:hover { background: var(--coral); transform: translateY(-2px); }
.dfoot__col { display: flex; flex-direction: column; gap: 11px; }
.dfoot__col h4 { color: var(--white); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.dfoot__col a, .dfoot__col span {
    display: inline-flex; align-items: center; gap: 8px; width: fit-content;
    color: rgba(255, 255, 255, .62); font-size: 15px; font-weight: 600; text-decoration: none; transition: color .2s;
}
.dfoot__col a:hover { color: var(--white); }

.dfoot__giant {
    position: relative; z-index: 0;
    margin: 36px -10px -28px; text-align: center; white-space: nowrap;
    font-size: clamp(120px, 19vw, 260px); font-weight: 900; letter-spacing: -.06em; line-height: .9;
    color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .1);
    background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 85%);
    -webkit-background-clip: text; background-clip: text;
    user-select: none; pointer-events: none;
}
.dfoot__bottom {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px;
}
.dfoot__top { display: inline-flex; align-items: center; gap: 6px; color: var(--white); font-weight: 800; text-decoration: none; }
.dfoot__top:hover { color: var(--coral); }
.dfoot__ver { font-variant-numeric: tabular-nums; opacity: .55; }

@media (max-width: 960px) {
    .dfoot__card { padding: 48px 32px 24px; }
    .dfoot__grid { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   MOBILE CHROME
   ================================================================ */
.device-mobile .app-main { padding-bottom: 0; }

/* Slim floating top bar */
.mtop {
    position: fixed; z-index: 100;
    top: calc(10px + var(--safe-t)); left: 12px; right: 12px;
    display: flex; align-items: center; justify-content: space-between;
    height: 54px; padding-block: 0; padding-inline: 16px 6px; border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 6px 24px rgba(10, 17, 85, .07);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    transition: box-shadow .3s, background .3s;
}
.mtop.is-scrolled { background: rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(10, 17, 85, .12); }
.mtop__brand { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-size: 19px; font-weight: 900; text-decoration: none; letter-spacing: -.02em; }
.mtop__brand img { width: 22px; }
.mtop__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--navy); background: var(--bg); }

/* Floating bottom navbar */
.mbar {
    position: fixed; z-index: 100;
    left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
    display: flex; align-items: stretch;
    height: var(--bar-h); padding: 0 6px; border-radius: 26px;
    background: rgba(10, 17, 85, .94);
    box-shadow: 0 14px 36px rgba(10, 17, 85, .32);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.mbar__item, .mbar__book {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: rgba(255, 255, 255, .55); font-size: 10.5px; font-weight: 800; text-decoration: none;
    -webkit-tap-highlight-color: transparent; transition: color .2s;
}
.mbar__item .icon { transition: transform .25s var(--ease); }
.mbar__item.is-active { color: var(--white); }
.mbar__item.is-active .icon { transform: translateY(-1px); color: var(--coral); }
.mbar__item:active .icon { transform: scale(.9); }
.mbar__item .avatar--sm { width: 24px; height: 24px; }
.mbar__item.is-active .avatar--sm { box-shadow: 0 0 0 2px var(--white); }

.mbar__book { color: var(--white); justify-content: flex-end; padding-bottom: 9px; }
.mbar__book-btn {
    display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; margin-bottom: 2px;
    border-radius: 50%; background: var(--coral); color: var(--white);
    border: 4px solid var(--bg);
    box-shadow: 0 8px 20px rgba(242, 69, 53, .45);
    transition: transform .2s var(--ease);
}
.mbar__book:active .mbar__book-btn { transform: scale(.92); }
.mbar__book.is-active .mbar__book-btn { background: var(--white); color: var(--coral); border-color: var(--coral); }

/* Mobile footer */
.mfoot { padding: 0 12px; margin-bottom: calc(var(--bar-h) + var(--safe-b) + 22px); }
.mfoot__card { padding: 30px 22px 18px; border-radius: 28px; background: var(--navy); color: rgba(255, 255, 255, .62); }
.mfoot__card .dfoot__logo { font-size: 21px; margin-bottom: 12px; }
.mfoot__card .dfoot__mark { width: 40px; height: 40px; border-radius: 12px; }
.mfoot__card .dfoot__mark img { width: 22px; }
.mfoot__card p { font-size: 14.5px; }
.mfoot__links { display: grid; gap: 8px; margin: 18px 0 20px; }
.mfoot__links a {
    display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px;
    background: rgba(255, 255, 255, .07); color: var(--white); font-weight: 800; text-decoration: none; font-size: 15px;
}
.mfoot__links a .icon { color: var(--coral); }
.mfoot__bottom { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; }
.device-mobile .app-main + .dfoot + .mfoot,
.device-mobile .mfoot { margin-top: 8px; }

/* ================================================================
   TOASTS — one system for the whole site (assets/js/notify.js)
   Desktop: top-right under the navbar. Phone: top, under the top bar.
   ================================================================ */
.toast-stack {
    position: fixed; z-index: 8500; top: calc(var(--nav-h) + 32px); inset-inline-end: 24px;
    display: flex; flex-direction: column; gap: 10px; width: 360px; pointer-events: none;
}
.toast {
    position: relative; overflow: hidden; pointer-events: auto;
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 16px;
    background: var(--white); border: 1px solid var(--line); border-radius: 20px;
    box-shadow: 0 2px 4px rgba(10, 17, 85, .05), 0 18px 44px rgba(10, 17, 85, .16);
    animation: toastIn .5s var(--ease);
    transition: transform .3s var(--ease), opacity .3s ease;
    touch-action: pan-y;
}
.toast__icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0;
    background: var(--navy); color: var(--white);
}
.toast--success .toast__icon { background: var(--navy); }
.toast--error .toast__icon { background: var(--coral); }
.toast--info .toast__icon { background: var(--coral-soft); color: var(--coral); }
.toast__text { flex: 1; min-width: 0; padding-top: 1px; }
.toast__text strong { display: block; color: var(--navy); font-size: 14.5px; font-weight: 900; line-height: 1.3; }
.toast__text span { display: block; color: var(--text); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.toast__close {
    display: grid; place-items: center; width: 28px; height: 28px; margin-block: -2px 0; margin-inline: 0 -2px; flex-shrink: 0;
    border: 0; border-radius: 9px; background: none; color: #a0a0a8; cursor: pointer; transition: background .2s, color .2s;
}
.toast__close:hover { background: var(--bg); color: var(--navy); }
.toast__life {
    position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: 100%;
    background: var(--navy); transform-origin: left;
    animation: toastLife var(--life, 4200ms) linear forwards;
}
.toast--error .toast__life { background: var(--coral); }
.toast--info .toast__life { background: var(--coral); opacity: .5; }
.toast.is-paused .toast__life { animation-play-state: paused; }
.toast.is-leaving { opacity: 0; transform: translateX(40px) scale(.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastLife { to { transform: scaleX(0); } }

.device-mobile .toast-stack { top: calc(74px + var(--safe-t)); left: 12px; right: 12px; width: auto; }
.device-mobile .toast { border-radius: 18px; }
.device-mobile .toast.is-leaving { transform: translateY(-16px) scale(.96); }

/* ================================================================
   CONFIRM DIALOG — Briefee.confirm() / data-confirm
   Desktop: centred card. Phone: bottom sheet.
   ================================================================ */
.has-dialog { overflow: hidden; }
.cdlg { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 20px; }
.cdlg__backdrop {
    position: absolute; inset: 0; background: rgba(10, 17, 85, .42);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .28s ease;
}
.cdlg__box {
    position: relative; width: 100%; max-width: 400px; padding: 30px 28px 24px; text-align: center;
    background: var(--white); border-radius: 30px;
    box-shadow: 0 30px 80px rgba(10, 17, 85, .35);
    opacity: 0; transform: translateY(16px) scale(.95);
    transition: transform .4s var(--ease), opacity .25s ease;
}
.cdlg.is-open .cdlg__backdrop { opacity: 1; }
.cdlg.is-open .cdlg__box { opacity: 1; transform: none; }
.cdlg.is-closing .cdlg__box { transform: translateY(10px) scale(.97); }
.cdlg__handle { display: none; }
.cdlg__icon {
    position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px;
    border-radius: 22px; background: var(--navy); color: var(--white);
}
.cdlg__icon::after {
    content: ""; position: absolute; inset: -8px; border-radius: 28px; border: 2px solid currentColor; opacity: .15;
    animation: cdlgRing 1.8s ease-out infinite;
}
.cdlg--default .cdlg__icon::after { color: var(--navy); }
.cdlg--danger .cdlg__icon { background: var(--coral); }
.cdlg--danger .cdlg__icon::after { color: var(--coral); }
@keyframes cdlgRing { 0% { transform: scale(.9); opacity: .35; } 100% { transform: scale(1.25); opacity: 0; } }
.cdlg__title { font-size: 24px; font-weight: 900; letter-spacing: -.03em; margin-bottom: 8px; }
.cdlg__msg { font-size: 15.5px; line-height: 1.6; margin: 0 0 24px; }
.cdlg__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cdlg__btn {
    padding: 15px 16px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
    font: 900 15px var(--font); transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.cdlg__btn:active { transform: scale(.97); }
.cdlg__btn--cancel { background: var(--bg); color: var(--navy); }
.cdlg__btn--cancel:hover { background: var(--line); }
.cdlg__btn--ok { background: var(--navy); color: var(--white); box-shadow: 0 8px 20px rgba(10, 17, 85, .25); }
.cdlg__btn--ok:hover { background: var(--navy-3); }
.cdlg--danger .cdlg__btn--ok { background: var(--coral); box-shadow: 0 8px 20px rgba(242, 69, 53, .3); }
.cdlg--danger .cdlg__btn--ok:hover { background: var(--coral-2); }

.device-mobile .cdlg { place-items: end stretch; padding: 0; }
.device-mobile .cdlg__box {
    max-width: none; padding: 14px 22px calc(22px + var(--safe-b)); border-radius: 30px 30px 0 0;
    transform: translateY(100%); opacity: 1;
}
.device-mobile .cdlg.is-open .cdlg__box { transform: none; }
.device-mobile .cdlg.is-closing .cdlg__box { transform: translateY(100%); }
.device-mobile .cdlg__handle { display: block; width: 44px; height: 5px; margin: 0 auto 22px; border-radius: 99px; background: var(--line); }
.device-mobile .cdlg__actions { grid-template-columns: 1fr; }
.device-mobile .cdlg__btn--ok { order: -1; }

/* ================================================================
   UPDATE MODAL — white card with a navy "rising chevrons" header,
   floats bottom-left on desktop, slides up above the tab bar on phones.
   ================================================================ */
.update-modal {
    position: fixed; inset-inline-start: 24px; bottom: 24px; z-index: 9000;
    transform: translateY(40px) scale(.96); opacity: 0; pointer-events: none;
    transition: transform .6s var(--ease), opacity .35s ease;
}
.update-modal.is-visible { transform: none; opacity: 1; pointer-events: auto; }

.update-card {
    position: relative; overflow: hidden; width: 344px;
    background: var(--white); border-radius: 30px;
    box-shadow: 0 2px 4px rgba(10, 17, 85, .06), 0 30px 80px rgba(10, 17, 85, .28);
}

/* Navy header: logo tile + chevrons rising (the brand's "up" symbol) */
.update-card__hero {
    position: relative; height: 118px; overflow: hidden;
    display: flex; align-items: center; padding: 0 24px;
    background:
        radial-gradient(circle at 85% 120%, rgba(242, 69, 53, .55), transparent 55%),
        var(--navy);
}
.update-card__hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1.2px, transparent 1.2px);
    background-size: 18px 18px;
    -webkit-mask-image: linear-gradient(90deg, #000 10%, transparent 75%);
    mask-image: linear-gradient(90deg, #000 10%, transparent 75%);
}
.update-card__mark {
    position: relative; display: grid; place-items: center;
    width: 58px; height: 58px; border-radius: 18px; background: var(--white);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}
.update-card__mark img { width: 30px; }
.update-modal.is-visible .update-card__mark { animation: updPop .7s var(--ease) .15s both; }

.update-card__rise { position: absolute; inset-inline-end: 64px; top: 0; bottom: 0; width: 46px; }
.update-card__chev { position: absolute; left: 0; width: 46px; opacity: 0; }
.update-modal.is-visible .update-card__chev { animation: updRise 2.4s cubic-bezier(.4, 0, .2, 1) infinite; }
.update-card__chev--2 { animation-delay: .8s !important; }
.update-card__chev--3 { animation-delay: 1.6s !important; }

@keyframes updRise {
    0%   { transform: translateY(70px) scale(.8); opacity: 0; }
    25%  { opacity: 1; }
    70%  { opacity: .9; }
    100% { transform: translateY(-60px) scale(1); opacity: 0; }
}
@keyframes updPop {
    from { transform: scale(.6) rotate(-10deg); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.update-card__close {
    position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2;
    display: grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: var(--white);
    transform: rotate(45deg); transition: background .2s, transform .3s var(--ease);
}
.update-card__close:hover { background: rgba(255, 255, 255, .24); transform: rotate(135deg); }

.update-card__content { padding: 22px 24px 22px; }
.update-card__content .eyebrow { margin-bottom: 8px; }
.update-card__head { font-size: 30px; font-weight: 900; letter-spacing: -.04em; line-height: 1.02; margin: 0 0 10px; }
.update-modal.is-visible .scribble path { stroke-dashoffset: 0; }
.update-card__body { font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; }

.update-card__actions { display: grid; gap: 4px; }
.update-card__reload { display: grid; grid-template-columns: 38px 1fr 38px; padding: 8px; gap: 0; font-size: 15.5px; }
.update-card__reload::after { content: ""; } /* empty third column balances the ring, keeping the label centred */

.update-ring { position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; }
.update-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.update-ring circle { fill: none; stroke-width: 3; }
.update-ring__track { stroke: rgba(255, 255, 255, .25); }
.update-ring__fill { stroke: var(--white); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.update-ring b { position: relative; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }

.update-card__later {
    padding: 11px; border: 0; background: none; cursor: pointer;
    color: var(--text); font: 800 14px var(--font); border-radius: 999px;
    transition: color .2s, background .2s;
}
.update-card__later:hover { color: var(--navy); background: var(--bg); }

.device-mobile .update-modal { left: 12px; right: 12px; bottom: calc(var(--bar-h) + var(--safe-b) + 22px); }
.device-mobile .update-card { width: auto; }
.device-mobile .update-card__hero { height: 104px; }

/* ── 404 / simple pages ──────────────────────────────────────── */
.section { padding: calc(var(--nav-h) + 96px) 0 80px; }
.page-title { font-size: clamp(30px, 5vw, 48px); font-weight: 900; letter-spacing: -.03em; }
.lead { font-size: 18px; margin-bottom: 28px; }
.m-section { padding: calc(84px + var(--safe-t)) 20px 24px; }
.m-center { text-align: center; }
.m-title { font-size: clamp(28px, 8vw, 36px); font-weight: 900; letter-spacing: -.03em; }
.m-lead { font-size: 16px; margin-bottom: 22px; }

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

/* ── "Built with ♥ by Tarqeyah" ── */
.builtby {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .7); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}
.builtby strong { color: var(--white); font-weight: 900; }
.builtby:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: var(--white); }
.builtby__heart { color: var(--coral); animation: heartbeat 1.6s ease-in-out infinite; transform-origin: center; }
.builtby:hover .builtby__heart { animation-duration: .8s; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.22); } 24% { transform: scale(1); } 36% { transform: scale(1.14); } 48% { transform: scale(1); } }
.dfoot__end { display: inline-flex; align-items: center; gap: 18px; }
.mfoot__built { display: flex; justify-content: center; margin-bottom: 14px; }
@media (max-width: 960px) {
    .dfoot__bottom { flex-wrap: wrap; justify-content: center; text-align: center; }
}

.mfoot__legal { display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; }
.mfoot__legal a { color: rgba(255, 255, 255, .7); font-size: 13.5px; font-weight: 800; text-decoration: none; }
.consent { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--text); }
.consent a { color: var(--navy); font-weight: 800; }
@media (max-width: 1180px) { .dfoot__grid { grid-template-columns: 1.4fr 1fr 1fr; } .dfoot__brand { grid-column: 1 / -1; } }

/* ── Language switcher (partials/lang-switch) ── */
.langbtn {
    display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border-radius: 999px;
    color: var(--navy); font-size: 14.5px; font-weight: 800; text-decoration: none; white-space: nowrap;
    transition: background .2s, color .2s;
}
.langbtn:hover { background: var(--coral-soft); color: var(--coral); }
.langbtn[lang="ar"] span { font-family: 'Tajawal', 'Nunito', sans-serif; font-size: 15.5px; }
.mtop__right { display: flex; align-items: center; gap: 8px; }
.mtop__lang { text-decoration: none; font-weight: 900; font-size: 14px; }
.mtop__lang[lang="ar"] { font-family: 'Tajawal', 'Nunito', sans-serif; font-size: 18px; padding-bottom: 2px; }
.langs { display: flex; gap: 6px; }
.langs__opt { text-decoration: none; }
.langs__opt[lang="ar"] { font-family: 'Tajawal', 'Nunito', sans-serif; }
.langs--list { flex-direction: column; gap: 11px; margin-top: 4px; }
.dfoot__col .langs__opt.is-current { color: var(--white); }
.langs--segmented { justify-content: center; margin: 0 auto 16px; padding: 4px; width: fit-content; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.langs--segmented .langs__opt { padding: 8px 18px; border-radius: 999px; color: rgba(255, 255, 255, .72); font-size: 14px; font-weight: 800; }
.langs--segmented .langs__opt.is-current { background: var(--white); color: var(--navy); }
/* On a light card (account settings) */
.langs--segmented.langs--light { background: var(--bg); margin: 0; }
.langs--segmented.langs--light .langs__opt { color: var(--navy); }
.langs--segmented.langs--light .langs__opt.is-current { background: var(--navy); color: var(--white); }
.langs-light-wrap .langs--segmented { background: var(--bg); margin: 0; }
.langs-light-wrap .langs--segmented .langs__opt { color: var(--navy); }
.langs-light-wrap .langs--segmented .langs__opt.is-current { background: var(--navy); color: var(--white); }

/* ================================================================
   ARABIC + RIGHT-TO-LEFT (<html lang="ar" dir="rtl">)
   Layout uses logical properties (inline-start/end) so it mirrors by
   itself; these rules cover fonts, transforms and directional icons.
   ================================================================ */
/* Tajawal for Arabic text; the brand word stays in Nunito. */
html[lang="ar"] { --font: "Tajawal", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[lang="ar"] body { font-family: var(--font); line-height: 1.75; }
html[lang="ar"] .fnav__brand, html[lang="ar"] .mtop__brand, html[lang="ar"] .dfoot__logo,
html[lang="ar"] .dfoot__giant, html[lang="ar"] .builtby strong { font-family: "Nunito", "Tajawal", sans-serif; }
/* Arabic letters must join: no tracking, no forced capitals. */
html[lang="ar"] *, html[lang="ar"] *::before, html[lang="ar"] *::after { letter-spacing: 0 !important; text-transform: none !important; }
/* Arabic glyphs are taller: give tight headlines room so lines don't collide. */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { line-height: 1.3; }
html[lang="ar"] .eyebrow, html[lang="ar"] .role-badge { font-size: 13.5px; }

/* Directional icons: arrows/exit point the other way. */
[dir="rtl"] .icon--arrow, [dir="rtl"] .icon--logout { transform: scaleX(-1); }
[dir="rtl"] .btn--ghost:hover .icon { transform: translateX(-3px); }
[dir="rtl"] .btn--ghost:hover .icon--arrow { transform: scaleX(-1) translateX(3px); }

/* Sliding / origin-based motion */
[dir="rtl"] .toast__life { transform-origin: right; }
[dir="rtl"] .toast.is-leaving { transform: translateX(-40px) scale(.96); }
[dir="rtl"] .device-mobile .toast.is-leaving { transform: translateY(-16px) scale(.96); }
[dir="rtl"] .update-card__hero { background: radial-gradient(circle at 15% 120%, rgba(242, 69, 53, .55), transparent 55%), var(--navy); }
[dir="rtl"] .update-card__hero::before { -webkit-mask-image: linear-gradient(270deg, #000 10%, transparent 75%); mask-image: linear-gradient(270deg, #000 10%, transparent 75%); }

/* Values that are always left-to-right (emails, phones, passwords, IBAN):
   typed LTR, but aligned to the right edge like the Arabic labels above them. */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="password"],
[dir="rtl"] input[type="url"], [dir="rtl"] input[name*="iban"], [dir="rtl"] input[name="pay_benefit_number"] { direction: ltr; text-align: right; }
[dir="rtl"] input[type="email"]::placeholder, [dir="rtl"] input[type="tel"]::placeholder { text-align: right; }

/* Numbers / references / versions never reorder inside Arabic sentences. */
code, .dfoot__ver { unicode-bidi: isolate; }
[dir="rtl"] .dfoot__col a[href*="wa.me"] { direction: ltr; flex-direction: row-reverse; }
[dir="rtl"] .mfoot__links a[href*="wa.me"] span { direction: ltr; unicode-bidi: isolate; }
