/* AUTH AND ACCOUNT EDITORIAL DESIGN */

.auth-page {
    --auth-bg: #0c0f0f;
    --auth-surface: #131919;
    --auth-surface-alt: #192528;
    --auth-text: #f3eee6;
    --auth-muted: #b9b1a5;
    --auth-line: rgb(243 238 230 / 22%);
    --auth-accent: #ec8166;
    --auth-accent-soft: #2d1915;
    --auth-blue: #55c8ee;
    --auth-success: #86c995;
    --auth-warning: #ddb86e;
    --auth-danger: #ef8d7a;
    position: relative;
    box-sizing: border-box;
    width: min(calc(100% - 2rem), 920px);
    min-height: 640px;
    margin: clamp(2rem, 6vw, 5.5rem) auto;
    padding: clamp(2rem, 6vw, 5.5rem);
    border: 1px solid var(--auth-line);
    background:
        linear-gradient(
            135deg,
            transparent 0 69%,
            color-mix(
                in srgb,
                var(--auth-blue) 12%,
                var(--auth-bg)
            ) 69% 100%
        ),
        var(--auth-bg);
    color: var(--auth-text);
    overflow: hidden;
    isolation: isolate;
}

.auth-page::before {
    content: "ДОСТУП · АККАУНТ · БЕЗОПАСНОСТЬ";
    display: block;
    margin-bottom: clamp(2.5rem, 6vw, 5rem);
    color: var(--auth-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    line-height: 1.4;
    text-transform: uppercase;
}

.auth-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: clamp(5rem, 15vw, 12rem);
    aspect-ratio: 1;
    border-bottom: 1px solid var(--auth-line);
    border-left: 1px solid var(--auth-line);
    background: color-mix(
        in srgb,
        var(--auth-accent) 10%,
        transparent
    );
}

.auth-page,
.auth-page * {
    box-sizing: border-box;
}

.auth-page h1 {
    max-width: 12ch;
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(3.2rem, 7vw, 6.25rem);
    font-weight: 400;
    letter-spacing: -0.065em;
    line-height: 0.92;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
}

.auth-page > p {
    max-width: 62ch;
    margin: 1.5rem 0 0;
    color: var(--auth-muted);
    font-size: clamp(1rem, 1.6vw, 1.16rem);
    line-height: 1.65;
}

.auth-page a {
    color: var(--auth-text);
    text-decoration-color: var(--auth-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
}

.auth-page a:hover {
    color: var(--auth-accent);
}

.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible,
.auth-page select:focus-visible,
.auth-page textarea:focus-visible {
    outline: 3px solid var(--auth-blue);
    outline-offset: 3px;
}

.auth-page .auth-form {
    display: grid;
    width: min(100%, 620px);
    margin: clamp(2rem, 5vw, 3.5rem) 0 0;
    padding: clamp(1.35rem, 4vw, 2.5rem);
    gap: 0;
    border: 1px solid var(--auth-line);
    border-radius: 0;
    background: color-mix(
        in srgb,
        var(--auth-surface) 94%,
        transparent
    );
    box-shadow: none;
}

.auth-page .auth-form label {
    margin: 0 0 0.55rem;
    color: var(--auth-muted);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.35;
    text-transform: uppercase;
}

.auth-page .auth-form input,
.auth-page .auth-form select,
.auth-page .auth-form textarea {
    width: 100%;
    min-height: 52px;
    margin: 0 0 1.35rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--auth-line);
    border-radius: 0;
    background: var(--auth-bg);
    color: var(--auth-text);
    font: inherit;
}

.auth-page .auth-form input::placeholder,
.auth-page .auth-form textarea::placeholder {
    color: color-mix(
        in srgb,
        var(--auth-muted) 68%,
        transparent
    );
}

.auth-page .auth-form input:hover,
.auth-page .auth-form select:hover,
.auth-page .auth-form textarea:hover {
    border-color: color-mix(
        in srgb,
        var(--auth-accent) 72%,
        var(--auth-line)
    );
}

.auth-page .auth-form button,
.auth-page .auth-logout-form button,
.auth-page .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 50px;
    margin-top: 0.6rem;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--auth-accent);
    border-radius: 0;
    background: transparent;
    color: var(--auth-text);
    font: inherit;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.auth-page .auth-form button:hover,
.auth-page .auth-logout-form button:hover,
.auth-page .button-link:hover {
    background: var(--auth-accent);
    color: #0c0f0f;
    filter: none;
}

.auth-page .auth-form__help {
    max-width: 52ch;
    margin: -0.75rem 0 1.35rem;
    color: var(--auth-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.auth-page .auth-form__success,
.auth-page .auth-form__error,
.auth-page .form-errors {
    width: min(100%, 620px);
    margin: 1.75rem 0 0;
    padding: 1rem 1.2rem;
    border: 1px solid currentColor;
    border-radius: 0;
    background: var(--auth-surface);
}

.auth-page .auth-form__success {
    color: var(--auth-success);
}

.auth-page .auth-form__error,
.auth-page .form-errors {
    color: var(--auth-danger);
}

.auth-page .form-errors h2 {
    margin: 0 0 0.35rem;
    color: inherit;
    font-size: 1rem;
    letter-spacing: 0;
}

.auth-page .form-errors p {
    margin: 0;
    color: inherit;
}

.auth-page .auth-page__alternative {
    max-width: 620px;
    margin: 1rem 0 0;
    color: var(--auth-muted);
    text-align: left;
}

.auth-page .smart-captcha {
    max-width: 100%;
    margin-bottom: 1rem;
}

.auth-page .auth-logout-form {
    margin-top: 1.5rem;
}

/* PERSONAL ACCOUNT */

.auth-page.account-page {
    width: min(calc(100% - 2rem), 1180px);
    max-width: none;
    background:
        linear-gradient(
            90deg,
            transparent 0 66%,
            color-mix(
                in srgb,
                var(--auth-blue) 10%,
                var(--auth-bg)
            ) 66% 100%
        ),
        var(--auth-bg);
}

.auth-page.account-page h1 {
    max-width: none;
    font-size: clamp(3.2rem, 6vw, 5.8rem);
}

.auth-page.account-page > p {
    margin-top: 1.25rem;
}

.auth-page .account-bookings,
.auth-page .account-settings {
    margin-top: clamp(3rem, 7vw, 6rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-line);
}

.auth-page .account-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.auth-page .account-bookings h2,
.auth-page .account-settings h2 {
    max-width: 16ch;
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(2rem, 4vw, 3.8rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 0.98;
    text-wrap: balance;
}

.auth-page .account-section-heading > a {
    color: var(--auth-blue);
    font-weight: 700;
}

.auth-page .account-booking-list {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 0;
    margin-top: 2rem;
    border-top: 1px solid var(--auth-line);
    border-left: 1px solid var(--auth-line);
}

.auth-page .account-booking-card,
.auth-page .account-empty-state {
    min-width: 0;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 0;
    border-right: 1px solid var(--auth-line);
    border-bottom: 1px solid var(--auth-line);
    border-radius: 0;
    background: var(--auth-surface);
}

.auth-page .account-empty-state {
    margin-top: 2rem;
    border: 1px solid var(--auth-line);
}

.auth-page .account-booking-card.is-previous {
    opacity: 0.68;
}

.auth-page .account-booking-card__heading {
    display: grid;
    gap: 0.85rem;
}

.auth-page .account-booking-card__heading h3 {
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 450;
    line-height: 1.1;
}

.auth-page .account-booking-card__date {
    margin-top: 1.25rem;
    color: var(--auth-text);
    font-weight: 650;
}

.auth-page .account-booking-card__meta,
.auth-page .account-booking-card__action {
    margin-top: 0.65rem;
}

.auth-page .account-booking-status {
    justify-self: start;
    padding: 0.3rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    line-height: 1.35;
    text-transform: uppercase;
}

.auth-page .account-booking-status--confirmed {
    color: var(--auth-success);
}

.auth-page .account-booking-status--pending_payment {
    color: var(--auth-warning);
}

.auth-page .account-booking-status--cancelled,
.auth-page .account-booking-muted {
    color: var(--auth-muted);
}

.auth-page .account-settings p {
    color: var(--auth-muted);
}

/* READING THEMES */

html[data-reading-theme="light"] .auth-page {
    --auth-bg: #f4f0e8;
    --auth-surface: #fffdf8;
    --auth-surface-alt: #e8eeee;
    --auth-text: #111717;
    --auth-muted: #625e58;
    --auth-line: rgb(17 23 23 / 24%);
    --auth-accent: #aa5844;
    --auth-accent-soft: #ead7cf;
    --auth-blue: #177a9a;
    --auth-success: #2f7442;
    --auth-warning: #8a6015;
    --auth-danger: #a33f32;
}

html[data-reading-theme="gray"] .auth-page {
    --auth-bg: #dcddda;
    --auth-surface: #f1f1ed;
    --auth-surface-alt: #cad3d2;
    --auth-text: #151919;
    --auth-muted: #555b5a;
    --auth-line: rgb(21 25 25 / 28%);
    --auth-accent: #9f503d;
    --auth-accent-soft: #d8c2bb;
    --auth-blue: #176d88;
    --auth-success: #316f42;
    --auth-warning: #805b18;
    --auth-danger: #963d32;
}

html[data-reading-theme="dark"] .auth-page {
    --auth-bg: #0c0f0f;
    --auth-surface: #131919;
    --auth-surface-alt: #192528;
    --auth-text: #f3eee6;
    --auth-muted: #b9b1a5;
    --auth-line: rgb(243 238 230 / 22%);
    --auth-accent: #ec8166;
    --auth-accent-soft: #2d1915;
    --auth-blue: #55c8ee;
    --auth-success: #86c995;
    --auth-warning: #ddb86e;
    --auth-danger: #ef8d7a;
}

/* RESPONSIVE */

@media (max-width: 760px) {
    .auth-page,
    .auth-page.account-page {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding:
            clamp(2rem, 8vw, 3.25rem)
            clamp(1rem, 5vw, 1.5rem)
            4rem;
        border-right: 0;
        border-left: 0;
        background:
            linear-gradient(
                145deg,
                transparent 0 82%,
                color-mix(
                    in srgb,
                    var(--auth-blue) 10%,
                    var(--auth-bg)
                ) 82% 100%
            ),
            var(--auth-bg);
    }

    .auth-page::before {
        margin-bottom: 2.5rem;
        font-size: 0.64rem;
    }

    .auth-page::after {
        width: 4.5rem;
    }

    .auth-page h1,
    .auth-page.account-page h1 {
        max-width: 100%;
        font-size: clamp(2.45rem, 12vw, 4rem);
        line-height: 0.96;
        letter-spacing: -0.055em;
        text-wrap: balance;
    }

    .auth-page > p {
        font-size: 1rem;
    }

    .auth-page .auth-form {
        width: 100%;
        padding: 1.15rem;
    }

    .auth-page .auth-form button,
    .auth-page .auth-logout-form button,
    .auth-page .button-link {
        width: 100%;
    }

    .auth-page .auth-page__alternative {
        text-align: left;
    }

    .auth-page .account-booking-list {
        grid-template-columns: 1fr;
    }

    .auth-page .account-bookings h2,
    .auth-page .account-settings h2 {
        max-width: 100%;
        font-size: clamp(2rem, 9vw, 3rem);
    }
}

@media (max-width: 380px) {
    .auth-page h1,
    .auth-page.account-page h1 {
        font-size: clamp(2.1rem, 11vw, 2.75rem);
    }

    .auth-page .auth-form {
        padding: 1rem;
    }

    .auth-page .auth-form input,
    .auth-page .auth-form select,
    .auth-page .auth-form textarea {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
