.account-narrow { max-width: 620px; }
.compact-hero h1 { font-size: clamp(26px, 4vw, 36px); }
.form-card { display: grid; gap: 18px; }
.form-group { display: grid; gap: 7px; }
.form-group label { font-weight: 700; font-size: 14px; }
.form-group input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--color-border, #dce5f0); border-radius: 8px; background: #fff; color: #1c2430; }
.form-group select { width: 100%; min-height: 46px; padding: 10px 40px 10px 12px; border: 1px solid var(--color-border, #dce5f0); border-radius: 8px; background: #fff; color: #1c2430; line-height: 1.45; }
.form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border, #dce5f0); border-radius: 8px; background: #fff; color: #1c2430; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid rgba(36, 87, 197, .18); border-color: var(--color-primary, #03346B); }
.form-group input:disabled { background: #f2f4f7; color: #687483; }
.form-group small { color: var(--color-text-muted, #79869a); }
.button.full { width: 100%; }
.account-switch { text-align: center; color: var(--color-text-muted, #79869a); }
.otp-input { text-align: center; letter-spacing: .35em; font-size: 24px !important; font-weight: 800; }
.notice.success { background: #eaf8ef; border: 1px solid #bfe6cb; color: #116530; }
.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.account-nav { margin-top: 0; padding: 18px; position: sticky; top: 18px; }
.account-nav nav { display: grid; gap: 4px; margin-top: 12px; }
.account-nav a { display: block; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: #485566; }
.account-nav a:hover { background: #f2f5f9; color: var(--color-primary, #03346B); }
.account-nav a.is-current {
    background: rgba(3, 52, 107, .045);
    color: var(--color-primary, #03346B);
    font-weight: 700;
}
.account-nav a.is-current:hover {
    background: rgba(3, 52, 107, .065);
}
.account-nav__mobile { display: none; }
.account-content { min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--color-border, #dce5f0); border-radius: 10px; padding: 18px; }
.stat-card span { display: block; color: var(--color-text-muted, #79869a); font-size: 13px; }
.stat-card strong { display: inline-block; margin-top: 5px; font-size: 30px; line-height: 1; }
.stat-card small { margin-left: 4px; color: var(--color-text-muted, #79869a); }
.table-wrap { width: 100%; overflow-x: auto; }
.empty-state { color: var(--color-text-muted, #79869a); margin: 8px 0; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.detail-list div { padding: 14px 0; border-bottom: 1px solid #eceff2; }
.detail-list dt { color: var(--color-text-muted, #79869a); font-size: 12px; }
.detail-list dd { margin: 4px 0 0; font-weight: 700; word-break: break-word; }
.logout-form { display: inline; margin: 0; }
.logout-button { border: 0; background: none; padding: 0; color: #485566; cursor: pointer; font: inherit; }
.logout-button:hover { color: var(--color-primary, #03346B); }
@media (max-width: 760px) {
    .account-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .account-nav {
        position: static;
        overflow: hidden;
        padding: 0;
        border-radius: 12px;
        box-shadow: none;
    }
    .account-nav__desktop { display: none; }
    .account-nav__mobile { display: block; }
    .account-nav__mobile summary {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 22px;
        grid-template-rows: auto auto;
        column-gap: 12px;
        min-height: 54px;
        padding: 10px 16px;
        cursor: pointer;
        list-style: none;
        user-select: none;
    }
    .account-nav__mobile summary::-webkit-details-marker { display: none; }
    .account-nav__mobile summary::after {
        content: "";
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: center;
        width: 8px;
        height: 8px;
        border-right: 2px solid #748397;
        border-bottom: 2px solid #748397;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 180ms ease;
    }
    .account-nav__mobile[open] summary::after {
        transform: translateY(2px) rotate(225deg);
    }
    .account-nav__mobile-kicker {
        color: #8996a6;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.25;
    }
    .account-nav__mobile-current {
        overflow: hidden;
        margin-top: 2px;
        color: var(--color-primary, #03346B);
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .account-nav__mobile nav {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0;
        padding: 5px 8px 9px;
        border-top: 1px solid #edf1f5;
    }
    .account-nav__mobile a {
        padding: 10px 9px;
        border-radius: 6px;
        font-size: 14px;
    }
    .account-nav__mobile a.is-current {
        background: rgba(3, 52, 107, .04);
    }
    .account-nav__mobile .account-nav__withdraw {
        margin-top: 4px;
        padding-top: 11px;
    }

    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .stat-card {
        min-width: 0;
        padding: 12px 10px;
        border-radius: 9px;
        text-align: center;
    }
    .stat-card span {
        min-height: 2.5em;
        font-size: 11px;
        line-height: 1.25;
    }
    .stat-card strong {
        margin-top: 3px;
        font-size: 24px;
    }
    .stat-card small {
        margin-left: 2px;
        font-size: 11px;
    }

    .detail-list { grid-template-columns: 1fr; }

    /* Purchase history: turn the wide desktop table into compact order cards. */
    .orders-table-wrap {
        overflow: visible;
    }
    .orders-table,
    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
        width: 100%;
    }
    .orders-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .orders-table tbody {
        display: grid;
        gap: 10px;
    }
    .orders-table tr {
        overflow: hidden;
        border: 1px solid #e3eaf2;
        border-radius: 10px;
        background: #fff;
    }
    .orders-table td {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 9px 11px;
        border-bottom: 1px solid #edf1f5;
        color: #26384b;
        font-size: 13px;
        line-height: 1.55;
        writing-mode: horizontal-tb;
        word-break: normal;
        overflow-wrap: anywhere;
    }
    .orders-table td:last-child {
        border-bottom: 0;
    }
    .orders-table td::before {
        content: attr(data-label);
        color: #8190a0;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.7;
        white-space: nowrap;
    }
    .orders-table td a {
        color: var(--color-primary, #03346B);
        font-weight: 700;
        text-underline-offset: 3px;
    }
}


@media (max-width: 380px) {
    .stat-grid { gap: 6px; }
    .stat-card { padding: 10px 6px; }
    .stat-card span { font-size: 10px; }
    .stat-card strong { font-size: 22px; }
}

/* =========================================================
   Login / Register
   Current AtlasRoute blue + gold tone
   ========================================================= */
.auth-page {
    position: relative;
    overflow: hidden;
    padding-top: 64px;
    background:
        radial-gradient(circle at 13% 5%, rgba(3, 52, 107, .08), transparent 24rem),
        radial-gradient(circle at 88% 26%, rgba(201, 164, 93, .10), transparent 22rem),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 48%, #f7f9fc 100%);
}

.auth-page::before {
    content: "";
    position: absolute;
    top: 52px;
    left: 50%;
    width: min(760px, 82vw);
    height: 280px;
    transform: translateX(-50%);
    border: 1px solid rgba(3, 52, 107, .055);
    border-radius: 50%;
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.auth-hero {
    margin-bottom: 26px;
    text-align: center;
}

.auth-hero .eyebrow {
    color: #C9A45D !important;
    letter-spacing: .18em;
}

.auth-hero h1 {
    margin-top: 8px;
    color: #03346B;
    letter-spacing: -.045em;
}

.auth-hero p:not(.eyebrow) {
    max-width: 520px;
    margin-inline: auto;
    color: #68788c;
    line-height: 1.85;
}

.auth-form-card {
    position: relative;
    gap: 20px;
    margin-top: 0;
    padding: 32px;
    border: 1px solid #e1e8f0;
    border-top: 3px solid #C9A45D;
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow:
        0 24px 64px rgba(9, 43, 79, .10),
        0 3px 12px rgba(9, 43, 79, .04);
}

.auth-form-card .form-group {
    gap: 8px;
}

.auth-form-card .form-group label {
    color: #173a60;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .015em;
}

.auth-form-card .form-group input {
    min-height: 54px;
    padding: 12px 15px;
    border: 1.5px solid #c5d3e2;
    border-radius: 12px;
    background: #fff;
    color: #17243a;
    box-shadow: inset 0 1px 2px rgba(3, 52, 107, .025);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.auth-form-card .form-group input:hover {
    border-color: #9fb6cf;
}

.auth-form-card .form-group input:focus {
    outline: none;
    border-color: #0b67be;
    background: #fcfeff;
    box-shadow:
        0 0 0 4px rgba(3, 52, 107, .10),
        0 6px 18px rgba(3, 52, 107, .055);
}

.auth-form-card .form-group input::placeholder {
    color: #a4afbd;
}

.auth-form-card .form-group small {
    color: #77869a;
    font-size: 12px;
    line-height: 1.6;
}

.auth-submit.button.primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 56px;
    margin-top: 3px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    background:
        linear-gradient(105deg, #022b5e 0%, #03346B 42%, #0755a0 74%, #0b68bd 100%);
    color: #fff;
    box-shadow:
        0 14px 28px rgba(3, 52, 107, .22),
        inset 0 1px 0 rgba(255, 255, 255, .20);
    letter-spacing: .035em;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        filter 180ms ease;
}

.auth-submit.button.primary::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -80%;
    left: -25%;
    width: 34%;
    height: 260%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .20), transparent);
    transition: left 420ms ease;
}

.auth-submit.button.primary::after {
    content: "→";
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-left: 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .11);
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

.auth-submit.button.primary:hover {
    background:
        linear-gradient(105deg, #022653 0%, #043d7d 42%, #0861b3 76%, #1173c9 100%);
    color: #fff;
    filter: saturate(1.04);
    transform: translateY(-1px);
    box-shadow:
        0 18px 34px rgba(3, 52, 107, .27),
        inset 0 1px 0 rgba(255, 255, 255, .23);
}

.auth-submit.button.primary:hover::before {
    left: 112%;
}

.auth-submit.button.primary:active {
    transform: translateY(1px);
    box-shadow: 0 8px 18px rgba(3, 52, 107, .20);
}

.auth-submit.button.primary:focus-visible {
    outline: 3px solid rgba(201, 164, 93, .45);
    outline-offset: 3px;
}

.auth-page .notice.error {
    margin-bottom: 14px;
    border-radius: 12px;
}

.auth-page .account-switch {
    margin-top: 22px;
    color: #758397;
    font-size: 13px;
}

.auth-page .account-switch a {
    color: #03346B;
    font-weight: 800;
    text-decoration-color: rgba(201, 164, 93, .8);
    text-decoration-thickness: 2px;
}

@media (max-width: 760px) {
    .auth-page {
        padding-top: 42px;
    }

    .auth-form-card {
        padding: 24px;
        border-radius: 18px;
    }

    .auth-form-card .form-group input {
        min-height: 52px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding-top: 32px;
    }

    .auth-hero {
        text-align: left;
    }

    .auth-hero p:not(.eyebrow) {
        margin-inline: 0;
    }

    .auth-form-card {
        padding: 20px 18px;
        border-radius: 16px;
    }

    .auth-submit.button.primary {
        min-height: 54px;
    }
}

/* Registration: individual policy acknowledgements and submit lock */
.registration-form .registration-consents {
    display: grid;
    gap: 13px;
    min-width: 0;
    margin: 2px 0 0;
    padding: 17px 16px;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #f8fafd;
}

.registration-form .registration-consents legend {
    float: left;
    width: 100%;
    margin-bottom: 4px;
    padding: 0;
    color: #425873;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.registration-form .registration-consents__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.registration-form .registration-consents__item input[type="checkbox"] {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    accent-color: #03346B;
    cursor: pointer;
}

.registration-form .registration-consents__item label {
    min-width: 0;
    color: #253c56;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.8;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.registration-form .registration-consents__item a {
    color: #0756a0;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.registration-form .registration-consents__item a:hover {
    color: #03346B;
}

.registration-form .registration-consents__item :is(input, a):focus-visible {
    outline: 2px solid #0b67be;
    outline-offset: 3px;
}

.registration-form .auth-submit.button.primary:disabled {
    border-color: #d3dbe4;
    background: #dce3eb;
    color: #718095;
    box-shadow: none;
    filter: none;
    transform: none;
    cursor: not-allowed;
}

.registration-form .auth-submit.button.primary:disabled::before {
    display: none;
}

.registration-form .auth-submit.button.primary:disabled::after {
    border-color: rgba(113, 128, 149, .35);
    background: rgba(113, 128, 149, .08);
    color: #718095;
}

@media (max-width: 480px) {
    .registration-form .registration-consents {
        gap: 12px;
        padding: 15px 12px;
    }
}

/* Account withdrawal */
.account-nav__withdraw {
    margin-top: 8px;
    border-top: 1px solid #edf1f5;
    color: #9b3b34 !important;
}
.withdrawal-card h2 { margin-bottom: 10px; }
.withdrawal-card > p { color: #5e6f81; line-height: 1.8; }
.withdrawal-notes { margin: 16px 0 0; padding-left: 1.35em; color: #586b7e; }
.withdrawal-notes li + li { margin-top: 8px; }
.withdrawal-form { border-color: #eed4d1; }
.withdrawal-confirm {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 10px;
    background: #fff7f6;
    color: #633f3c;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
}
.withdrawal-confirm input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    padding: 0;
}
.button.danger {
    background: #a43b33;
    border-color: #a43b33;
    color: #fff;
}
.button.danger:hover {
    background: #873029;
    border-color: #873029;
    color: #fff;
}
.withdrawal-submit { justify-self: start; }



/* Password reset */
.auth-forgot-link {
    margin-top: -6px;
    text-align: right;
    font-size: 13px;
}
.auth-forgot-link a,
.auth-reset-links a {
    color: #03346B;
    font-weight: 700;
    text-decoration-color: rgba(201, 164, 93, .75);
    text-underline-offset: 3px;
}
.auth-form-note {
    margin: -2px 0 0;
    color: #6e7e91;
    font-size: 12px;
    line-height: 1.75;
}
.password-reset-guidance {
    line-height: 1.75;
}
.auth-reset-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    font-size: 13px;
}
@media (max-width: 480px) {
    .auth-reset-links {
        display: grid;
        gap: 10px;
        text-align: center;
    }
}

/* =========================================================
   Phase 3: grouped purchase history / purchase detail
   ========================================================= */
.purchase-history-list {
    display: grid;
    gap: 14px;
}
.purchase-history-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 20px;
    border: 1px solid #dce6ef;
    border-radius: 16px;
    background: #fff;
}
.purchase-history-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 8px;
    color: #6c8093;
    font-size: 12px;
}
.purchase-history-card h2 {
    margin: 0 0 8px;
    color: #073d74;
    font-size: 18px;
}
.purchase-history-card__items {
    display: grid;
    gap: 3px;
    color: #536b80;
    font-size: 13px;
}
.purchase-history-card__side {
    display: grid;
    justify-items: end;
    gap: 7px;
    min-width: 150px;
}
.purchase-history-card__side > strong {
    color: #073d74;
    font-size: 20px;
}
.purchase-history-card__side > small {
    color: #6c8093;
}
.purchase-status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #edf5fb;
    color: #07568e;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.legacy-orders-heading {
    margin: 30px 0 14px;
    padding-top: 24px;
    border-top: 1px solid #e1e8ef;
}
.legacy-orders-heading h2 { margin: 0 0 4px; font-size: 18px; color: #073d74; }
.legacy-orders-heading p { margin: 0; color: #738497; font-size: 12px; }
.purchase-detail-head { margin-bottom: 18px; }
.purchase-progress-card h2 { margin-top: 0; color: #073d74; }
.purchase-progress-list { display: grid; gap: 12px; }
.purchase-progress-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #dce6ef;
    border-radius: 14px;
    background: #fbfdff;
}
.purchase-progress-item__copy { display: grid; gap: 3px; min-width: 0; }
.purchase-progress-item__copy > span { color: #a17b33; font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.purchase-progress-item__copy > strong { color: #153c61; overflow-wrap: anywhere; }
.purchase-progress-item__copy > small { color: #728397; }
.purchase-progress-item__action { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.esim-purchase-card__purchase-link { margin-top: 5px !important; }
.esim-purchase-card__purchase-link a { color: #0b5f9f; font-size: 12px; font-weight: 750; text-underline-offset: 3px; }

@media (max-width: 720px) {
    .purchase-history-card,
    .purchase-progress-item { grid-template-columns: 1fr; }
    .purchase-history-card__side { justify-items: stretch; min-width: 0; }
    .purchase-history-card__side .button { width: 100%; }
    .purchase-progress-item__action { justify-content: flex-start; }
}

/* Profile residence-country combobox */
.country-combobox {
    position: relative;
    display: grid;
    gap: 7px;
}
.country-combobox__control {
    position: relative;
}
.country-combobox__input {
    padding-right: 46px !important;
    cursor: text;
}
.country-combobox[data-has-selection="true"] .country-combobox__input::placeholder {
    color: #1c2430;
    opacity: 1;
}
.country-combobox__toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 44px;
    padding: 0;
    border: 0;
    border-radius: 0 7px 7px 0;
    background: transparent;
    color: #536b80;
    cursor: pointer;
}
.country-combobox__toggle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -68%) rotate(45deg);
    transition: transform .16s ease;
}
.country-combobox.is-open .country-combobox__toggle span {
    transform: translate(-50%, -32%) rotate(225deg);
}
.country-combobox__toggle:hover { color: var(--color-primary, #03346B); }
.country-combobox__toggle:focus-visible {
    outline: 2px solid rgba(36, 87, 197, .3);
    outline-offset: -4px;
}
.country-combobox__menu {
    position: absolute;
    z-index: 40;
    top: 53px;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #cfdae6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(22, 48, 75, .14);
}
.country-combobox__option {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 14px;
    width: 100%;
    padding: 9px 38px 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #1c2430;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.country-combobox__option:hover,
.country-combobox__option.is-active {
    background: #f1f6fb;
}
.country-combobox__option[aria-selected="true"] {
    background: #edf4fb;
    color: var(--color-primary, #03346B);
}
.country-combobox__option-label {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
}
.country-combobox__option-meta {
    color: #74869a;
    font-size: 12px;
    white-space: nowrap;
}
.country-combobox__check {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--color-primary, #03346B);
    font-size: 14px;
    font-weight: 800;
}
.country-combobox__empty {
    padding: 12px 10px;
    color: #74869a;
    font-size: 13px;
    text-align: center;
}
.country-combobox__help {
    line-height: 1.55;
}
@media (max-width: 520px) {
    .country-combobox__menu { max-height: 240px; }
    .country-combobox__option { grid-template-columns: 1fr; gap: 1px; }
    .country-combobox__option-meta { white-space: normal; }
}
