/* =========================================================
   du · Quick Recharge — faithful replica
   Brand fonts, colours and layout extracted from the live
   myaccount.du.ae/webapp build.
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
    font-family: "duCoHeadline16";
    font-display: swap;
    font-style: normal;
    font-weight: 700;
    src: url("/assets/fonts/duCoHeadline16-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "ProximaNova";
    font-display: swap;
    font-style: normal;
    font-weight: 700;
    src: url("/assets/fonts/ProximaNova-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "ProximaNova";
    font-display: swap;
    font-style: normal;
    font-weight: 500;
    src: url("/assets/fonts/ProximaNova-Medium.woff2") format("woff2");
}
@font-face {
    font-family: "ProximaNova";
    font-display: swap;
    font-style: normal;
    font-weight: 400;
    src: url("/assets/fonts/ProximaNova-Regular.woff2") format("woff2");
}
@font-face {
    font-family: "Dubai";
    font-display: swap;
    font-style: normal;
    font-weight: 700;
    src: url("/assets/fonts/DubaiW23-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "Dubai";
    font-display: swap;
    font-style: normal;
    font-weight: 400;
    src: url("/assets/fonts/DubaiW23-Regular.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
    --du-navy: #00205b;
    --du-purple: #753bbd;
    --du-cyan: #00a9ce;
    --du-magenta: #c724b1;
    --du-gradient: linear-gradient(45deg, #824bc7 6%, #d92cc1 53%);
    --du-gradient-hover: linear-gradient(45deg, #7440b8 6%, #c91fae 53%);

    --text: #333333;
    --text-muted: #6a6a72;
    --text-soft: #8a8a92;

    --bg: #f4f5f7;
    --card: #ffffff;
    --border: #e3e4e8;
    --border-strong: #c9cad0;
    --field-bg: #ffffff;

    --radius-card: 16px;
    --radius-field: 12px;
    --radius-pill: 28px;

    --shadow-card: 0 10px 40px rgba(0, 32, 91, 0.08);
    --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.06);

    --maxw: 480px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family:
        "ProximaNova",
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[dir="rtl"] body {
    font-family: "Dubai", system-ui, "Segoe UI", sans-serif;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #fff;
    padding: 10px 16px;
    border-radius: 0 0 8px 0;
    z-index: 100;
}
.skip-link:focus {
    left: 0;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    box-shadow: var(--shadow-header);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand__logo {
    width: 40px;
    height: 40px;
}

.brand__divider {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
}

.brand__title {
    font-weight: 700;
    font-size: 1.0588rem; /* 18px */
    color: var(--du-navy);
    letter-spacing: 0.2px;
}

.lang-toggle {
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--du-navy);
    font-weight: 700;
    font-size: 0.8235rem; /* 14px */
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.lang-toggle:hover {
    background: var(--du-navy);
    color: #fff;
}

/* ---------- Main / card ---------- */
.main {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-block: 48px;
}

.main__inner {
    display: flex;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: var(--maxw);
    background: var(--card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 36px 32px 32px;
}

/* ---------- Steps / progress ---------- */
.steps {
    display: flex;
    gap: 8px;
    list-style: none;
    margin-bottom: 28px;
}
.steps__item {
    height: 4px;
    flex: 1;
    border-radius: 3px;
    background: #e7e8ec;
    transition: background 0.25s ease;
}
.steps__item.is-active {
    background: var(--du-magenta);
}

.step {
    display: none;
    animation: fade 0.28s ease;
}
.step.is-active {
    display: block;
}
.step--center {
    text-align: center;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Typography ---------- */
.card__title {
    font-family: "duCoHeadline16", "ProximaNova", sans-serif;
    font-weight: 700;
    font-size: 1.647rem; /* 28px */
    line-height: 1.2;
    color: var(--du-navy);
    margin-bottom: 6px;
}
[dir="rtl"] .card__title {
    font-family: "Dubai", sans-serif;
}

.card__subtitle {
    color: var(--text-muted);
    font-size: 0.9412rem; /* 16px */
    margin-bottom: 26px;
}
.card__subtitle strong {
    color: var(--text);
    font-weight: 700;
}

/* ---------- Form fields ---------- */
.field-label {
    display: block;
    font-size: 0.8235rem; /* 14px */
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.phone-field {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-field);
    overflow: hidden;
    background: var(--field-bg);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.phone-field:focus-within {
    border-color: var(--du-cyan);
    box-shadow: 0 0 0 3px rgba(0, 169, 206, 0.15);
}
.phone-field.has-error {
    border-color: #e02d3c;
}
.phone-field.has-error:focus-within {
    box-shadow: 0 0 0 3px rgba(224, 45, 60, 0.15);
}

.phone-field__country {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: #f7f8fa;
    border-inline-end: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.phone-field__country img {
    border-radius: 2px;
}

.phone-field__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 15px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    letter-spacing: 0.5px;
}
.phone-field__input::placeholder {
    color: #b6b7bd;
    letter-spacing: normal;
}

.input {
    width: 100%;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-field);
    background: var(--field-bg);
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.input::placeholder {
    color: #b6b7bd;
}
.input:focus {
    outline: 0;
    border-color: var(--du-cyan);
    box-shadow: 0 0 0 3px rgba(0, 169, 206, 0.15);
}

.input-wrap {
    position: relative;
}
.input-wrap__icon {
    position: absolute;
    top: 50%;
    inset-inline-end: 14px;
    transform: translateY(-50%);
    height: 13px;
    pointer-events: none;
}

.row {
    display: flex;
    gap: 14px;
}
.row__col {
    flex: 1;
}

.field-label + .input,
.field-label + .input-wrap {
    margin-bottom: 18px;
}

.field-error {
    color: #e02d3c;
    font-size: 0.8235rem;
    margin-top: 8px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8235rem;
    color: var(--text-muted);
    margin: 6px 0 22px;
}
.checkbox input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--du-magenta);
    flex-shrink: 0;
}

/* ---------- Button ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 15px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--du-gradient);
    transition:
        filter 0.15s ease,
        transform 0.05s ease,
        opacity 0.15s ease;
    margin-top: 22px;
}
.btn:hover {
    filter: brightness(1.04);
}
.btn:active {
    transform: translateY(1px);
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.btn--primary:focus-visible {
    outline: 3px solid rgba(199, 36, 177, 0.4);
    outline-offset: 2px;
}
.btn__amount {
    font-weight: 500;
    opacity: 0.92;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: none;
    color: var(--du-magenta);
    font-weight: 700;
    font-size: 0.8824rem;
    padding: 0;
    margin-bottom: 18px;
}
.back span[aria-hidden] {
    font-size: 1.3rem;
    line-height: 0;
}
[dir="rtl"] .back span[aria-hidden] {
    transform: scaleX(-1);
}

/* ---------- We accept ---------- */
.accept {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.accept__heading {
    font-size: 0.7647rem; /* 13px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-soft);
    margin-bottom: 14px;
}
.accept__cards {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    min-height: 24px;
}
.accept__cards img {
    width: auto;
}
.accept__note {
    font-size: 0.8235rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Secure ---------- */
.secure {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 0.8235rem;
    color: var(--text-muted);
}
.secure__icon {
    flex-shrink: 0;
}

/* ---------- Plans (amount grid) ---------- */
.plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 6px;
}
.plan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 96px;
    padding: 16px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-field);
    background: #fff;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}
.plan:hover {
    border-color: var(--du-cyan);
}
.plan.is-selected {
    border-color: var(--du-magenta);
    background: rgba(199, 36, 177, 0.05);
    box-shadow: 0 0 0 1px var(--du-magenta) inset;
}
.plan__amount {
    font-family: "duCoHeadline16", "ProximaNova", sans-serif;
    font-weight: 700;
    font-size: 1.0588rem; /* 18px */
    color: var(--du-navy);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}
[dir="rtl"] .plan__amount {
    font-family: "Dubai", sans-serif;
}
.plan--other .plan__amount {
    color: var(--text-muted);
}
.plan.is-selected.plan--other .plan__amount {
    color: var(--du-navy);
}
.plan__radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    position: relative;
    transition: border-color 0.15s ease;
}
.plan.is-selected .plan__radio {
    border-color: var(--du-magenta);
}
.plan.is-selected .plan__radio::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--du-magenta);
}

/* ---------- Custom (Other) amount ---------- */
.custom-amount {
    margin-top: 16px;
}
.amount-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-field);
    background: var(--field-bg);
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.amount-input:focus-within {
    border-color: var(--du-cyan);
    box-shadow: 0 0 0 3px rgba(0, 169, 206, 0.15);
}
.amount-input__currency {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-weight: 700;
    color: var(--text-muted);
    background: #f7f8fa;
    border-inline-end: 1px solid var(--border);
}
.amount-input__field {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
}
.amount-input__field::placeholder {
    color: #b6b7bd;
}
.amount-help {
    margin-top: 8px;
    font-size: 0.8235rem;
    color: var(--text-muted);
}
.custom-amount.is-error .amount-input {
    border-color: #e02d3c;
}
.custom-amount.is-error .amount-help {
    color: #e02d3c;
}

/* ---------- Card BIN error ---------- */
.bin-error {
    margin-top: 4px;
    margin-bottom: 12px;
}

/* ---------- Payment ---------- */
/* Payment summary (phone + amount) */
.payment-summary {
    background: #f7f8fa;
    border-radius: var(--radius-field);
    padding: 16px 18px;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.payment-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.payment-summary__label {
    color: var(--text-muted);
    font-size: 0.8824rem;
}
.payment-summary__value {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9412rem;
    direction: ltr;
    unicode-bidi: embed;
}
.payment-summary__amount {
    font-family: "duCoHeadline16", "ProximaNova", sans-serif;
    font-size: 1.1765rem;
    color: var(--du-navy);
}
[dir="rtl"] .payment-summary__amount {
    font-family: "Dubai", sans-serif;
}

/* ---------- Verify / Status ---------- */
.verify-spinner {
    display: flex;
    justify-content: center;
    margin: 8px 0 24px;
}
.verify-spinner__arc {
    stroke: var(--du-magenta);
    stroke-linecap: round;
    stroke-dasharray: 90 126;
    transform-origin: center;
    animation: verifyRotate 1s linear infinite;
}
@keyframes verifyRotate {
    to {
        transform: rotate(360deg);
    }
}
.order-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f7f8fa;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 16px;
    font-size: 0.8824rem;
    color: var(--text-muted);
}
.order-code strong {
    color: var(--text);
    font-family: monospace, "ProximaNova", sans-serif;
    letter-spacing: 0.5px;
}
.status-icon {
    display: flex;
    justify-content: center;
    margin: 8px 0 24px;
}
.status-icon__circle {
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: drawCircle 0.5s ease forwards;
}
.status-icon__x {
    stroke-dasharray: 23;
    stroke-dashoffset: 23;
    animation: drawCheck 0.3s 0.45s ease forwards;
}
.success {
    display: flex;
    justify-content: center;
    margin: 8px 0 24px;
}
.success__circle {
    stroke: #18b06b;
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: drawCircle 0.5s ease forwards;
}
.success__check {
    stroke: #18b06b;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawCheck 0.35s 0.45s ease forwards;
}
@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}
@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0;
    padding: 28px 0;
}
.copyright {
    text-align: center;
    color: var(--text-soft);
    font-size: 0.8235rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
    html {
        font-size: 16px;
    }
    .main {
        padding-block: 24px;
    }
    .card {
        padding: 28px 20px 24px;
        border-radius: 14px;
    }
    .brand__title {
        font-size: 1rem;
    }
    .plans {
        gap: 10px;
    }
    .plan {
        min-height: 88px;
        padding: 14px 4px;
        gap: 10px;
    }
    .plan__amount {
        font-size: 0.9375rem; /* 15px */
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
