/* ─── POOOL Error Pages — Shared Styles ─────────────────────────────────── */

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

:root {
    --brand-600: var(--primary-color, var(--brand-blue, #0000FF));
    --brand-700: #0000CC;
    --brand-lime: #98FB96;
    --brand-green: #03FF88;
    --brand-50: #ebebff;
    --brand-25: #F5F6FF;
    --brand-dark: #08232F;
    --gray-900: var(--page-title-color, var(--fg-heading-1, #181D27));
    --gray-700: #414651;
    --gray-600: var(--text-secondary, var(--fg-secondary, #475467));
    --gray-400: #a4a7ae;
    --gray-300: #d5d7da;
    --gray-100: #f2f4f7;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --error-600: #d92d20;
    --warning-500: #f79009;
}

html,
body {
    height: 100%;
    font-family: var(--font-family, 'TT Norms Pro', sans-serif);
    background: var(--white);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
}

/* ─── Page Layout ─────────────────────────────────────────────────────────── */
.error-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 24px 72px;
    /* iOS safe-area */
    padding-top: calc(96px + env(safe-area-inset-top));
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    background: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.error-page::before {
    content: none;
}

.error-page::after {
    content: none;
}

.error-content {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Logo ────────────────────────────────────────────────────────────────── */
.error-logo {
    position: absolute;
    top: 32px;
    left: 40px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
}

.error-logo img {
    height: 42px;
    width: auto;
    display: block;
}

.error-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.error-brand-mark img {
    display: block;
    height: 48px;
    width: auto;
}

/* ─── Code Badge ──────────────────────────────────────────────────────────── */
.error-code {
    display: inline-block;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.error-code--blue {
    background: var(--brand-50);
    color: var(--brand-700);
}

.error-code--red {
    background: #fef3f2;
    color: var(--error-600);
}

.error-code--yellow {
    background: #fffaeb;
    color: #b54708;
}

/* ─── Text ────────────────────────────────────────────────────────────────── */
.error-title {
    font-size: var(--fs-5xl);
    font-weight: 700;
    line-height: 44px;
    letter-spacing: 0;
    color: var(--gray-900);
    margin-bottom: 12px;
    max-width: 480px;
}

.error-subtitle {
    font-size: var(--fs-md);
    font-weight: 400;
    line-height: 1.5;
    color: var(--gray-600);
    max-width: 460px;
    margin: 0 auto 36px;
}

/* ─── Actions ─────────────────────────────────────────────────────────────── */
.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--btn-border-radius, 8px);
    font-family: var(--font-family, 'TT Norms Pro', sans-serif);
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--brand-600);
    color: var(--brand-lime);
    box-shadow: 0 1px 2px rgba(10, 13, 18, 0.08), inset 0 -2px 0 rgba(10, 13, 18, 0.08);
}

.btn--primary:hover {
    background: var(--brand-700);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: 0 1px 2px rgba(10, 13, 18, 0.05);
}

.btn--secondary:hover {
    background: var(--white);
}

.error-page .ds-btn--primary {
    background: var(--brand-600);
    color: var(--brand-lime);
}

.error-page .ds-btn--primary:hover {
    background: var(--brand-700);
}

.error-page .ds-btn--secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.error-page .ds-btn--secondary:hover {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

/* ─── Indeterminate maintenance state ────────────────────────────────────── */
.maintenance-progress {
    width: min(100%, 360px);
    height: 6px;
    margin: -12px auto 28px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--brand-50);
}

.maintenance-progress-bar {
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-600);
    animation: maintenance-progress 1.4s ease-in-out infinite alternate;
}

@keyframes maintenance-progress {
    from { transform: translateX(-5%); }
    to { transform: translateX(155%); }
}

/* ─── Status info (for maintenance page) ─────────────────────────────────── */
.status-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.status-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    padding: 20px 28px;
    text-align: left;
    min-width: 160px;
}

.status-item-label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.status-item-value {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--gray-900);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot--green {
    background: #12b76a;
}

.status-dot--yellow {
    background: var(--warning-500);
}

/* ─── Footer hint ─────────────────────────────────────────────────────────── */
.error-footer {
    font-size: var(--fs-sm);
    color: var(--gray-400);
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.error-footer a {
    color: var(--brand-600);
    font-weight: 700;
    text-decoration: none;
}

.error-footer a:hover {
    text-decoration: underline;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .error-page {
        justify-content: flex-start;
        padding: 104px 20px 40px;
    }

    .error-title {
        font-size: var(--fs-3xl);
        line-height: 36px;
    }

    .error-logo {
        top: 20px;
        left: 20px;
    }

    .error-logo img {
        height: 32px;
    }

    .error-brand-mark {
        margin-bottom: 24px;
    }

    .error-brand-mark img {
        height: 40px;
    }

    .error-actions {
        width: 100%;
    }

    .error-actions .btn {
        width: 100%;
    }

    .error-footer {
        position: static;
        max-width: 280px;
        margin-top: auto;
        line-height: 1.5;
    }

    .status-grid {
        flex-direction: column;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn--primary:hover {
        transition: none;
        transform: none;
    }

    .maintenance-progress-bar {
        animation: none;
        transform: translateX(75%);
    }
}

/* ─── Account Deletion Page ──────────────────────────────────────────────── */
.account-deletion-page {
    min-height: 100%;
    background: var(--content-bg, #FAFAFA);
    color: var(--page-title-color, #181D27);
}

.account-deletion-main {
    margin-left: var(--sidebar-width, 256px);
    width: calc(100% - var(--sidebar-width, 256px));
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    gap: 0;
    background: var(--content-bg, #FAFAFA);
    display: flex;
    flex-direction: column;
}

.account-deletion-shell {
    width: 100%;
    padding: 24px var(--page-padding-x, 32px) var(--page-padding-bottom, 48px);
    background: var(--content-bg, #FAFAFA);
    box-sizing: border-box;
}

.account-deletion-container {
    width: min(100%, 820px);
    margin: 0 auto;
}

.account-deletion-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.account-deletion-logo {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
}

.account-deletion-logo:focus-visible {
    outline: 2px solid var(--input-border-focus, #0000FF);
    outline-offset: 6px;
}

.account-deletion-logo img {
    display: block;
    width: auto;
    height: 42px;
}

.account-deletion-card,
.account-deletion-success {
    border-radius: var(--card-border-radius, 12px);
}

.account-deletion-success {
    display: none;
    grid-template-columns: auto 1fr;
    gap: 16px;
    margin-bottom: 16px;
    border-color: #ABEFC6;
    background: #FFFFFF;
}

.account-deletion-success.shown {
    display: grid;
}

.account-deletion-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: 0 0 auto;
}

.account-deletion-status-icon--success {
    color: #027A48;
    background: #ECFDF3;
}

.account-deletion-status-icon--danger {
    color: #B42318;
    background: #FEF3F2;
}

.account-deletion-page .success-title {
    margin: 0 0 6px;
    color: var(--page-title-color, #181D27);
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: 1.35;
}

.account-deletion-page .success-body {
    margin: 0;
    color: var(--body-color, #344054);
    font-size: var(--fs-sm);
    line-height: 1.55;
}

.account-deletion-page .success-body + .success-body {
    margin-top: 8px;
}

.account-deletion-page .success-countdown {
    margin: 16px 0 0;
    color: #717680;
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.account-deletion-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.account-deletion-title {
    margin: 0;
    color: var(--page-title-color, #181D27);
    font-size: var(--fs-4xl);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: 0;
}

.account-deletion-subtitle {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--body-color, #344054);
    font-size: var(--fs-md);
    line-height: 1.55;
}

.account-deletion-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.account-deletion-info {
    border: 1px solid var(--card-border-color, #E5E7EB);
    border-radius: 12px;
    padding: 18px;
    background: #FFFFFF;
}

.account-deletion-info--danger {
    border-color: #FECDCA;
    background: #FFFBFA;
}

.account-deletion-info--neutral {
    background: #F9FAFB;
}

.account-deletion-info__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--page-title-color, #181D27);
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.35;
}

.account-deletion-info--danger .account-deletion-info__title {
    color: #B42318;
}

.account-deletion-info__icon {
    display: inline-flex;
    color: currentColor;
}

.account-deletion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: #535862;
    font-size: var(--fs-sm);
    line-height: 1.45;
}

.account-deletion-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border-color, #E5E7EB);
}

.account-deletion-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #D5D7DA;
    border-radius: 10px;
    background: #F9FAFB;
}

.account-deletion-confirm__label {
    color: #535862;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.4;
}

.account-deletion-confirm__code {
    color: #181D27;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.account-deletion-checkbox {
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #E9EAEB;
    border-radius: 10px;
    background: #FFFFFF;
}

.account-deletion-checkbox input[type="checkbox"] {
    margin-top: 2px;
}

.account-deletion-checkbox .ds-checkbox-label {
    color: var(--body-color, #344054);
    line-height: 1.5;
}

.account-deletion-error {
    display: none;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #FECDCA;
    border-radius: 10px;
    background: #FEF3F2;
    color: #B42318;
    line-height: 1.45;
}

.account-deletion-error:not(:empty) {
    display: flex;
}

.account-deletion-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.account-deletion-actions .ds-btn {
    min-width: 190px;
}

.account-deletion-actions .ds-btn--secondary {
    background: #FFFFFF;
    color: #414651;
    border-color: #D5D7DA;
}

.account-deletion-actions .ds-btn--secondary:hover,
.account-deletion-actions .ds-btn--secondary:active {
    background: #FFFFFF;
    color: #414651;
    border-color: #D5D7DA;
}

.account-deletion-actions .ds-btn--danger:disabled {
    background: #F2F4F7;
    color: #A4A7AE;
    border: 1px solid #E9EAEB;
    opacity: 1;
}

@media (max-width: 760px) {
    .account-deletion-main {
        margin-left: 0;
        width: 100%;
    }

    .account-deletion-shell {
        padding: 20px 16px 40px;
    }

    .account-deletion-logo img {
        height: 34px;
    }

    .account-deletion-card,
    .account-deletion-success {
        padding: 20px;
    }

    .account-deletion-title {
        font-size: var(--fs-3xl);
        line-height: 1.22;
    }

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

    .account-deletion-confirm {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .account-deletion-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .account-deletion-actions .ds-btn {
        width: 100%;
        min-width: 0;
    }
}
