:root {
    color-scheme: light;
}

.account-page-body {
    min-height: 100vh;
    margin: 0;
    color: #0f172a;
    background:
        radial-gradient(circle at 8% 6%, rgba(37, 99, 235, 0.18), transparent 30rem),
        radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.18), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 52%, #f8fafc 100%);
}

.account-page-shell {
    min-height: 100vh;
}

.account-topbar {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.account-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: #0f172a;
    text-decoration: none;
}

.account-brand:hover {
    color: #0f172a;
}

.account-brand-mark {
    width: 2.8rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
}

.account-brand-mark img {
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
}

.account-brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.account-brand strong {
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.account-brand small {
    margin-top: 0.28rem;
    color: #64748b;
    font-weight: 650;
}

.account-home-link {
    padding: 0.7rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    color: #334155;
    background: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-weight: 800;
}

.account-home-link:hover {
    color: #0f172a;
    background: #ffffff;
}

.account-main {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0 5rem;
}

.account-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(20px);
}

.account-card-copy {
    padding: clamp(2rem, 5vw, 4.5rem);
    color: #ffffff;
    background:
        radial-gradient(circle at 75% 18%, rgba(255, 255, 255, 0.2), transparent 16rem),
        linear-gradient(145deg, #0f172a 0%, #1d4ed8 58%, #0ea5e9 100%);
}

.account-card-copy h1 {
    margin: 1rem 0 1rem;
    font-size: clamp(2.1rem, 5vw, 3.7rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    font-weight: 950;
}

.account-card-copy p {
    margin: 0;
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
    line-height: 1.7;
}

.account-eyebrow {
    display: inline-flex;
    padding: 0.42rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.account-eyebrow-danger {
    background: rgba(239, 68, 68, 0.2);
}

.account-benefits {
    margin-top: 2rem;
    display: grid;
    gap: 0.75rem;
}

.account-benefits span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
}

.account-benefits span::before {
    content: "✓";
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #0f172a;
    background: #ffffff;
    font-size: 0.85rem;
}

.account-form {
    padding: clamp(2rem, 5vw, 4.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.1rem;
}

.account-field {
    display: grid;
    gap: 0.45rem;
}

.account-field label {
    color: #334155;
    font-size: 0.86rem;
    font-weight: 850;
}

.account-field input {
    width: 100%;
    min-height: 3.2rem;
    padding: 0.78rem 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.9rem;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.account-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
}

.account-field input:disabled {
    color: #64748b;
    background: #f1f5f9;
}

.account-field small {
    color: #64748b;
    line-height: 1.45;
}

.account-field span,
.account-form > span,
.account-validation-summary {
    color: #b91c1c;
    font-size: 0.84rem;
    font-weight: 700;
}

.account-validation-summary ul {
    margin: 0;
    padding-left: 1.15rem;
}

.account-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

.account-check input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.16rem;
    accent-color: #2563eb;
}

.account-primary-button,
.account-secondary-button,
.account-danger-button {
    min-height: 3.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    text-decoration: none;
    font-weight: 900;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.account-primary-button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.account-primary-button:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.account-secondary-button {
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
}

.account-danger-button {
    border: 0;
    color: #ffffff;
    background: #b91c1c;
}

.account-danger-button:hover {
    color: #ffffff;
    background: #991b1b;
}

.account-switch {
    margin: 0.25rem 0 0;
    color: #64748b;
    text-align: center;
}

.account-switch a {
    color: #1d4ed8;
    font-weight: 850;
}

.account-card-manage {
    display: block;
}

.account-card-manage > .account-card-copy {
    padding: 2.4rem 3rem;
}

.account-card-manage > .account-card-copy h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.account-manage-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.account-form-panel {
    padding: 1.5rem;
    justify-content: flex-start;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    background: #f8fafc;
}

.account-form-panel h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 900;
}

.account-success {
    padding: 0.8rem 0.95rem;
    border: 1px solid #86efac;
    border-radius: 0.85rem;
    color: #166534;
    background: #f0fdf4;
    font-weight: 750;
}

.account-danger-zone {
    margin: 0 2rem 2rem;
    padding: 1.3rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #fecaca;
    border-radius: 1.1rem;
    background: #fef2f2;
}

.account-danger-zone strong {
    color: #991b1b;
    font-weight: 900;
}

.account-danger-zone p {
    margin: 0.25rem 0 0;
    color: #7f1d1d;
}

.account-card-delete {
    grid-template-columns: 1fr 1fr;
}

.account-card-delete .account-card-copy {
    background: linear-gradient(145deg, #450a0a, #991b1b 58%, #ef4444);
}

.account-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 850px) {
    .account-card,
    .account-card-delete {
        grid-template-columns: 1fr;
    }

    .account-card-copy {
        padding: 2.25rem;
    }

    .account-card-copy h1 {
        font-size: 2.4rem;
    }

    .account-form {
        padding: 2.25rem;
    }

    .account-manage-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .account-topbar {
        align-items: flex-start;
    }

    .account-brand small {
        display: none;
    }

    .account-home-link {
        padding: 0.58rem 0.75rem;
        font-size: 0.82rem;
    }

    .account-main {
        padding-top: 1.25rem;
    }

    .account-card {
        border-radius: 1.35rem;
    }

    .account-card-copy,
    .account-form,
    .account-card-manage > .account-card-copy,
    .account-manage-grid {
        padding: 1.4rem;
    }

    .account-danger-zone {
        margin: 0 1.4rem 1.4rem;
        align-items: stretch;
        flex-direction: column;
    }
}

.account-button-link {
    width: fit-content;
}

.account-secondary-link {
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
}

.account-secondary-link:hover {
    text-decoration: underline;
}

.account-info {
    padding: 0.9rem 1rem;
    border: 1px solid #93c5fd;
    border-radius: 0.85rem;
    color: #1e3a8a;
    background: #eff6ff;
    line-height: 1.55;
    font-weight: 700;
}

.account-email-summary {
    margin: 0;
    color: #475569;
    overflow-wrap: anywhere;
}

.account-inline-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.account-inline-links a,
.account-verified-badge {
    color: #1d4ed8;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.account-inline-links a:hover {
    text-decoration: underline;
}

.account-verified-badge {
    width: fit-content;
    padding: 0.32rem 0.6rem;
    border: 1px solid #86efac;
    border-radius: 999px;
    color: #166534 !important;
    background: #f0fdf4;
}

.account-form-note {
    color: #64748b;
    text-align: center;
    line-height: 1.5;
}

/* Phase 2.0D.2: account center */
.account-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.account-language-links {
    padding: .25rem;
    display: inline-flex;
    gap: .18rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
}

.account-language-links a {
    min-width: 2rem;
    padding: .35rem .45rem;
    border-radius: 999px;
    color: #64748b;
    text-align: center;
    text-decoration: none;
    font-size: .75rem;
    font-weight: 900;
}

.account-language-links a.active {
    color: #fff;
    background: #2563eb;
}

.account-management-page { overflow: visible; }
.account-page-status { margin: 1.5rem 2rem 0; }

.account-plan-overview {
    padding: 2rem 2rem 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.account-plan-card {
    min-width: 0;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    border: 1px solid #dce6f3;
    border-radius: 1.25rem;
    background: #f8fbff;
}

.account-plan-card-primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(145deg, #13213e, #1d4ed8 65%, #0ea5e9);
}

.account-plan-card > span { font-size: .76rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.account-plan-card > strong { font-size: 1.8rem; line-height: 1; }
.account-plan-card > p { margin: 0; color: #52627a; }
.account-plan-card > small { color: #73819a; }
.account-plan-card-primary > p,
.account-plan-card-primary > small { color: rgba(255, 255, 255, .8); }
.account-plan-card .account-button-link { margin-top: auto; }
.account-plan-card-primary .account-primary-button { color: #13213e; background: #fff; box-shadow: none; }

.account-manage-grid-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.account-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.account-panel-heading > span {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .75rem;
    color: #1d4ed8;
    background: #eaf1ff;
    font-size: .72rem;
    font-weight: 950;
}

.account-panel-heading h2 { margin: 0; }
.account-panel-heading p { margin: .25rem 0 0; color: #64748b; line-height: 1.45; }

.account-select {
    width: 100%;
    min-height: 3.2rem;
    padding: .78rem .95rem;
    border: 1px solid #cbd5e1;
    border-radius: .9rem;
    color: #0f172a;
    background: #fff;
}

.account-detail-list { margin: 0; display: grid; gap: .65rem; }
.account-detail-list > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .65rem; border-bottom: 1px solid #e2e8f0; }
.account-detail-list dt { color: #64748b; font-weight: 700; }
.account-detail-list dd { margin: 0; color: #0f172a; font-weight: 850; text-align: right; }

.account-data-summary {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #edf4ff;
}
.account-data-summary strong { color: #155eef; font-size: 2rem; }
.account-data-summary span { color: #334155; font-weight: 750; }
.account-panel-note { color: #64748b; line-height: 1.5; }

.account-quick-links {
    margin: 0 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}
.account-quick-links a {
    min-width: 0;
    padding: 1rem 1.1rem;
    display: grid;
    gap: .25rem;
    border: 1px solid #dce6f3;
    border-radius: 1rem;
    color: #0f172a;
    background: #fff;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.account-quick-links a:hover { transform: translateY(-1px); border-color: #9bb7e8; box-shadow: 0 12px 26px rgba(15, 23, 42, .08); }
.account-quick-links span { color: #64748b; font-size: .87rem; }

@media (max-width: 850px) {
    .account-plan-overview,
    .account-manage-grid-expanded,
    .account-quick-links { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .account-topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
    .account-language-links { order: 2; }
    .account-plan-overview { padding: 1.4rem 1.4rem 0; }
    .account-page-status { margin: 1.4rem 1.4rem 0; }
    .account-quick-links { margin: 0 1.4rem 1.4rem; }
}

/* Phase 2.0F.4B.1 — account language picker */
.account-language-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .62rem;
    border: 0;
}

.account-language-option {
    position: relative;
    min-width: 0;
    min-height: 4.15rem;
    padding: .72rem .76rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .68rem;
    border: 1px solid #dce6f3;
    border-radius: .95rem;
    color: #334155;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.account-language-option:hover {
    border-color: #9bb7e8;
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .08);
    transform: translateY(-1px);
}

.account-language-option.is-selected {
    border-color: #60a5fa;
    background: linear-gradient(145deg, #eff6ff, #f8fbff);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12), 0 8px 20px rgba(37, 99, 235, .08);
}

.account-language-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.account-language-option:has(input:focus-visible) {
    outline: 3px solid rgba(59, 130, 246, .28);
    outline-offset: 2px;
}

.account-language-option-code {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .72rem;
    color: #1d4ed8;
    background: #eaf1ff;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .04em;
}

.account-language-option-copy {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.account-language-option-copy strong {
    overflow: hidden;
    color: #172033;
    font-size: .88rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-language-option-copy small {
    color: #64748b;
    font-size: .7rem;
    font-weight: 700;
}

.account-language-option-check {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: transparent;
    background: #ffffff;
    font-size: .72rem;
    font-weight: 950;
}

.account-language-option.is-selected .account-language-option-check {
    color: #ffffff;
    border-color: #2563eb;
    background: #2563eb;
}

.account-language-note {
    color: #64748b;
    line-height: 1.45;
}


/* Phase 2.0F.5A — reflect the radio choice immediately, before submit.
   The server-rendered is-selected class represents the saved cookie; :checked
   represents the user's current unsaved choice. */
.account-language-option.is-selected:not(:has(input:checked)) {
    border-color: #dce6f3;
    background: #ffffff;
    box-shadow: none;
}

.account-language-option.is-selected:not(:has(input:checked)) .account-language-option-check {
    color: transparent;
    border-color: #cbd5e1;
    background: #ffffff;
}

.account-language-option:has(input:checked) {
    border-color: #60a5fa;
    background: linear-gradient(145deg, #eff6ff, #f8fbff);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12), 0 8px 20px rgba(37, 99, 235, .08);
}

.account-language-option:has(input:checked) .account-language-option-check {
    color: #ffffff;
    border-color: #2563eb;
    background: #2563eb;
}

@media (max-width: 520px) {
    .account-language-options {
        grid-template-columns: 1fr;
    }
}

/* Keep language access on sign-in and recovery pages, but avoid duplicating
   the full language card on the account-management page. */
.account-language-menu {
    position: relative;
}

.account-language-menu summary {
    min-height: 2.7rem;
    padding: .55rem .7rem;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 999px;
    color: #334155;
    background: rgba(255, 255, 255, .82);
    font-size: .78rem;
    font-weight: 900;
    list-style: none;
    cursor: pointer;
}

.account-language-menu summary::-webkit-details-marker { display: none; }
.account-language-menu summary:hover,
.account-language-menu[open] summary {
    color: #1d4ed8;
    border-color: #93b4e8;
    background: #ffffff;
}

.account-language-menu summary:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .25);
    outline-offset: 2px;
}

.account-language-menu-globe {
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    color: #1d4ed8;
    background: #eaf1ff;
    font-size: .9rem;
}

.account-language-menu-chevron {
    width: .42rem;
    height: .42rem;
    margin-left: .05rem;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-.1rem) rotate(45deg);
}

.account-language-menu[open] .account-language-menu-chevron {
    transform: translateY(.1rem) rotate(225deg);
}

.account-language-menu-options {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 30;
    width: 14rem;
    padding: .42rem;
    display: grid;
    gap: .22rem;
    border: 1px solid #dce6f3;
    border-radius: .95rem;
    background: rgba(255, 255, 255, .99);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .16);
}

.account-language-menu-options a {
    min-height: 2.65rem;
    padding: .52rem .58rem;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .52rem;
    border-radius: .7rem;
    color: #334155;
    text-decoration: none;
}

.account-language-menu-options a:hover,
.account-language-menu-options a.is-selected {
    color: #1d4ed8;
    background: #eff6ff;
}

.account-language-menu-options a > span {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .62rem;
    color: #1d4ed8;
    background: #eaf1ff;
    font-size: .68rem;
    font-weight: 950;
}

.account-language-menu-options a > strong {
    overflow: hidden;
    font-size: .82rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-language-menu-options a > small {
    color: #2563eb;
    font-size: .72rem;
    font-weight: 950;
}

@media (max-width: 620px) {
    .account-language-menu-options {
        right: auto;
        left: 0;
    }
}
