/* AASTMT Online Payment — the student pages' one stylesheet.
   Mobile first: laid out for a 360 px phone and widening from there.
   Bilingual: English and Arabic side by side; Arabic text carries lang="ar" or class="ar".
   Cairo (Google Fonts, see Master.Master) sets both scripts; the system font is the fallback. */

:root {
    /* Blues: one scale, from the header's deep end to the tints behind selected things. */
    --blue-950: #071a4d;
    --blue-900: #0b2a78;
    --blue-800: #12379b;
    --blue-700: #1743b3;
    --blue-600: #1f5ae0;
    --blue-500: #3b7bf6;
    --blue-200: #c9daff;
    --blue-100: #e3ecff;
    --blue-50:  #f2f6ff;

    /* Gold: the Academy's second colour, used as an accent only (lines, rings, the total). */
    --gold-700: #a8791c;
    --gold-500: #d4a843;
    --gold-400: #e2bd5f;
    --gold-200: #f3dc9c;
    --gold-50:  #fdf7e8;
    --gold-line: linear-gradient(90deg, var(--gold-700), var(--gold-400) 50%, var(--gold-700));

    --ink: #111c3a;
    --muted: #5a6788;
    --soft: #8a95b3;
    --line: #e2e8f5;
    --page: #f4f7fd;
    --card: #ffffff;
    --field: #f7f9ff;

    --ok: #0f8a5f;
    --ok-soft: #e4f6ee;
    --warn: #9a6200;
    --warn-soft: #fff5df;
    --bad: #c02a2a;
    --bad-soft: #fdeceb;

    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(11, 42, 120, .06), 0 12px 32px -8px rgba(11, 42, 120, .16);
    --shadow-btn: 0 8px 20px -6px rgba(23, 67, 179, .55);
    --focus: 0 0 0 4px rgba(59, 123, 246, .25);

    --font: "Cairo", "Segoe UI", Tahoma, system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
}

form { flex: 1 0 auto; display: flex; flex-direction: column; }

.ar, [lang="ar"] { direction: rtl; unicode-bidi: isolate; }
.mixed { unicode-bidi: plaintext; }
/* An Arabic sentence after an English one starts its own line; mixed on one line, the two
   directions reorder each other's punctuation. */
p .ar, .lead .ar, .secure .ar, .agree .ar, .when .ar { display: block; margin-top: 2px; }

a { color: var(--blue-700); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.skip {
    position: absolute; left: -999px; top: 8px; z-index: 10;
    background: var(--blue-700); color: #fff; padding: 8px 14px; border-radius: 10px;
}
.skip:focus { left: 8px; }

/* ---- header band -------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 18px 16px 76px;
    color: #fff;
    background:
        radial-gradient(900px 300px at 85% -40%, rgba(120, 170, 255, .55), transparent 60%),
        radial-gradient(600px 260px at -10% 120%, rgba(59, 123, 246, .45), transparent 60%),
        linear-gradient(135deg, var(--blue-950) 0%, var(--blue-800) 48%, var(--blue-600) 100%);
}
.hero::after {   /* a faint grid, for depth */
    content: "";
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; text-align: center; }

.brand {
    display: inline-block;
    padding: 10px 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
}
.brand img { display: block; width: 100%; max-width: 260px; height: auto; }

.tagline {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px;
    margin: 14px 0 0;
    font-size: 14px; font-weight: 600; letter-spacing: .2px;
    color: rgba(255, 255, 255, .88);
}
.tagline svg { width: 18px; height: 18px; color: #9fc2ff; }

.foot {
    padding: 22px 16px 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--soft);
}

/* ---- layout ------------------------------------------------------------------------- */

.shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 760px;
    margin: -56px auto 0;
    padding: 0 16px 8px;
    flex: 1 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid rgba(226, 232, 245, .8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 18px;
    margin-bottom: 18px;
}
@media (min-width: 600px) { .card { padding: 30px 32px; } }

.card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 16px;
    margin: 0 0 6px;
}
.card-title h1, .card-title h2 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--ink); letter-spacing: -.2px; }
.card-title h2 { font-size: 19px; }
.card-title .ar { font-size: 20px; font-weight: 800; color: var(--blue-800); }

.lead { margin: 0 0 20px; color: var(--muted); font-size: 15px; }

/* ---- stepper ------------------------------------------------------------------------ */

.steps {
    list-style: none;
    display: flex;
    margin: 0 0 18px;
    padding: 16px 10px 14px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    counter-reset: step;
}
.steps li {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--soft);
    counter-increment: step;
}
.steps li .ar { display: block; font-size: 12.5px; font-weight: 600; }
.steps li::before {
    content: counter(step);
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--blue-50);
    border: 2px solid var(--blue-100);
    color: var(--soft);
    font-weight: 800;
}
.steps li + li::after {   /* the line from the previous step */
    content: "";
    position: absolute;
    top: 16px;
    right: 50%;
    width: 100%;
    height: 3px;
    margin-right: 16px;
    border-radius: 3px;
    background: var(--blue-100);
}
.steps li.done, .steps li.now { color: var(--ink); }
.steps li.done::before { content: "✓"; background: var(--blue-100); border-color: var(--blue-100); color: var(--blue-700); }
.steps li.now::before {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
    border-color: transparent; color: #fff;
    box-shadow: 0 0 0 5px var(--blue-100);
}
.steps li.done + li::after, .steps li.now::after { background: linear-gradient(90deg, var(--blue-500), var(--blue-700)); }
.steps li.now + li::after { background: var(--blue-100); }

/* ---- forms -------------------------------------------------------------------------- */

.grid { display: grid; gap: 16px; }
@media (min-width: 600px) { .grid.two { grid-template-columns: 1fr 1fr; gap: 18px; } }

.field label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--ink);
}
.field label .ar { color: var(--muted); }

.field input[type=text], .field input[type=email], .field input[type=tel], .field textarea {
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--field);
    color: var(--ink);
    font: 600 18px/1.3 var(--font);
    letter-spacing: .4px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 140px; resize: vertical; font-size: 16px; font-weight: 500; letter-spacing: 0; }
.field input::placeholder, .field textarea::placeholder { color: var(--soft); font-weight: 500; }
.field input:hover, .field textarea:hover { border-color: var(--blue-200); }
.field input:focus, .field textarea:focus { border-color: var(--blue-500); background: #fff; box-shadow: var(--focus); outline: none; }
.field input[disabled] { background: var(--blue-50); color: var(--muted); border-style: dashed; }
.field-error { display: block; margin-top: 6px; color: var(--bad); font-size: 13.5px; font-weight: 700; }

/* ---- buttons ------------------------------------------------------------------------ */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions.center { justify-content: center; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 28px;
    border: 0;
    border-radius: 16px;
    font: 700 17px/1.2 var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: transform .08s, box-shadow .2s, filter .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-primary, .btn-pay {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 55%, var(--blue-500) 100%);
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover, .btn-pay:hover { filter: brightness(1.06); box-shadow: 0 12px 26px -8px rgba(23, 67, 179, .65); }
.btn-pay { min-height: 60px; font-size: 18px; }
.btn-ghost { background: var(--blue-50); color: var(--blue-700); border: 1.5px solid var(--blue-100); }
.btn-ghost:hover { background: var(--blue-100); }
.btn[disabled], .btn.is-disabled {
    background: #dbe2f1; color: #fff; box-shadow: none; filter: none; cursor: not-allowed; transform: none;
}
.btn.block { width: 100%; }
@media (max-width: 599px) { .actions .btn { flex: 1 1 100%; } }

/* ---- notices ------------------------------------------------------------------------ */

.notice {
    display: block;
    margin: 18px 0 0;
    padding: 13px 16px;
    padding-inline-start: 48px;
    position: relative;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.65;
    unicode-bidi: plaintext;
}
.notice:empty { display: none; }
.notice::before {
    position: absolute; inset-inline-start: 15px; top: 14px;
    width: 22px; height: 22px; line-height: 22px;
    border-radius: 50%;
    text-align: center; font-weight: 800; font-size: 13px; color: #fff;
}
.notice-info { background: var(--blue-50); color: var(--blue-900); border: 1px solid var(--blue-100); }
.notice-info::before { content: "i"; background: var(--blue-600); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-warn::before { content: "!"; background: #d08b00; }
.notice-error { background: var(--bad-soft); color: var(--bad); }
.notice-error::before { content: "!"; background: var(--bad); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-ok::before { content: "✓"; background: var(--ok); }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice .line { display: block; }
.notice .line + .line { margin-top: 4px; }

/* ---- facts and the amount ----------------------------------------------------------- */

.facts { margin: 16px 0 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .facts.two { grid-template-columns: 1fr 1fr; } }
.facts div { min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--blue-50); }
.facts dt { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.facts dd { margin: 2px 0 0; font-size: 16.5px; font-weight: 700; overflow-wrap: anywhere; }

.bill { margin: 20px 0 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.bill .row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.bill .row:last-child { border-bottom: 0; }
.bill .label { color: var(--muted); font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.bill .label .ar { display: block; font-size: 13.5px; }
.bill .value { font-size: 19px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bill .total {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-600) 100%);
}
.bill .total .label { color: rgba(255, 255, 255, .78); }
.bill .total .value { font-size: 28px; letter-spacing: -.3px; }
.cur { font-size: .6em; font-weight: 700; margin-left: 5px; opacity: .8; letter-spacing: .5px; }

/* ---- payment page ------------------------------------------------------------------- */

.cards {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    margin: 18px 0 0; padding: 12px 16px;
    border-radius: 14px; background: var(--blue-50);
    color: var(--muted); font-size: 13.5px; font-weight: 700;
}
.cards .logos { display: inline-flex; gap: 8px; }
.cards img { height: 36px; width: auto; border-radius: 8px; background: #fff; padding: 3px 6px; box-shadow: 0 1px 3px rgba(11, 42, 120, .12); }

.terms { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.terms summary {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    cursor: pointer; padding: 13px 16px; font-weight: 700; color: var(--blue-800); list-style: none;
}
.terms summary::-webkit-details-marker { display: none; }
.terms summary::after {
    content: ""; flex: 0 0 auto; width: 9px; height: 9px;
    border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg); transition: transform .2s; margin-top: -4px;
}
.terms[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.terms .body { padding: 0 16px 14px; font-size: 14.5px; color: #3b4766; }
.terms .body p { margin: 8px 0; }

.agree {
    display: flex; gap: 12px; align-items: flex-start;
    margin-top: 14px; padding: 14px 16px;
    border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
    font-weight: 600; font-size: 15px;
    transition: border-color .15s, background .15s;
}
.agree input { width: 22px; height: 22px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--blue-600); }
.agree:hover { border-color: var(--blue-200); }
.agree:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); }

.secure { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---- result pages ------------------------------------------------------------------- */

.result { text-align: center; padding-top: 4px; }
.result .icon {
    width: 84px; height: 84px; margin: 0 auto 14px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.result .icon svg { width: 42px; height: 42px; }
.result.ok .icon { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 0 8px rgba(15, 138, 95, .08); }
.result.bad .icon { background: var(--bad-soft); color: var(--bad); box-shadow: 0 0 0 8px rgba(192, 42, 42, .07); }
.result.warn .icon { background: var(--warn-soft); color: var(--warn); box-shadow: 0 0 0 8px rgba(208, 139, 0, .08); }
.result h1 { margin: 0; font-size: 24px; font-weight: 800; }
.result h1 .ar { display: block; font-size: 22px; margin-top: 2px; color: var(--blue-800); }
.result .amount {
    margin: 16px 0 4px; font-size: 38px; font-weight: 800; letter-spacing: -.5px;
    color: var(--blue-800); font-variant-numeric: tabular-nums;
}
.result p { color: var(--muted); }

.receipt { margin-top: 18px; padding-top: 4px; text-align: start; }

/* ---- maintenance -------------------------------------------------------------------- */

.when {
    margin: 16px 0; padding: 16px 18px; border-radius: 16px;
    background: var(--blue-50); border: 1px solid var(--blue-100);
    text-align: center; font-weight: 700; color: var(--blue-900);
}

/* ---- gold accents ------------------------------------------------------------------- */

/* A gold rule along the bottom of the header band. */
.hero { border-bottom: 3px solid transparent; border-image: var(--gold-line) 1; }
.hero::before {   /* a warm glow in the band's corner */
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(420px 180px at 100% 100%, rgba(226, 189, 95, .22), transparent 70%);
    pointer-events: none;
}

/* The logo badge: white, ringed in gold. */
.brand { box-shadow: 0 0 0 2px var(--gold-400), 0 0 0 6px rgba(226, 189, 95, .22), 0 12px 30px -10px rgba(0, 0, 0, .5); }
.tagline svg { color: var(--gold-400); }

/* A short gold bar under every card title. */
.card-title { position: relative; padding-bottom: 12px; margin-bottom: 10px; }
.card-title::after {
    content: "";
    position: absolute; bottom: 0; inset-inline-start: 0;
    width: 56px; height: 3px; border-radius: 3px;
    background: var(--gold-line);
}

/* The current step: blue centre, gold ring. */
.steps li.now::before { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold-400); }
.steps li.done::before { color: var(--gold-700); background: var(--gold-50); border-color: var(--gold-200); }

/* Fact tiles carry a gold edge on the reading side. */
.facts div { border-inline-start: 3px solid var(--gold-400); }

/* The total: gold on blue. */
.bill .total { border-top: 2px solid var(--gold-500); }
.bill .total .value { color: var(--gold-200); }
.bill .total .cur { color: var(--gold-400); opacity: 1; }

/* Pay: the lock in gold. */
.btn-pay svg { color: var(--gold-200); }

/* Notices: the information one in the Academy's colours. */
.notice-info { border-inline-start: 3px solid var(--gold-400); }

/* The receipt: a gold frame on success, the amount underlined in gold. */
.result.ok .amount { display: inline-block; padding-bottom: 4px; border-bottom: 3px solid transparent; border-image: var(--gold-line) 1; }
.card-gold { position: relative; overflow: hidden; }
.card-gold::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--gold-line);
}

/* Maintenance dates. */
.when { border-color: var(--gold-200); background: linear-gradient(180deg, var(--gold-50), var(--blue-50)); }

/* The footer, signed in gold. */
.foot { color: var(--gold-700); }
.foot::before {
    content: ""; display: block; width: 40px; height: 2px; margin: 0 auto 12px; border-radius: 2px;
    background: var(--gold-line);
}

/* ---- motion ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
    .card, .steps { animation: rise .35s ease-out both; }
    .card + .card { animation-delay: .06s; }
    /* Movement only, no fade: content must be readable even where animations do not run. */
    @keyframes rise { from { transform: translateY(8px); } to { transform: none; } }
}

/* ---- print: the receipt alone ------------------------------------------------------- */

@media print {
    body { background: #fff; }
    .hero { background: none; color: #000; padding: 0 0 12px; }
    .hero::after, .tagline, .skip, .steps, .actions { display: none !important; }
    .brand { box-shadow: none; padding: 0; }
    .shell { margin-top: 0; }
    .card { box-shadow: none; border: 1px solid #999; animation: none; }
    .facts div { background: none; border: 1px solid #ccc; }
    .result .icon { border: 2px solid currentColor; box-shadow: none; }
}
