:root {
    --login-red: #ff2637;
    --login-red-dark: #ed1f31;
    --login-mint: #57cdb6;
    --login-text: #15171b;
    --login-muted: #8e929a;
    --login-line: #e8e9ec;
    --login-panel: rgba(255, 255, 255, 0.97);
    --login-page-bg: #f6f6f6;
    --login-shadow: 0 22px 60px rgba(20, 24, 35, 0.16), 0 6px 22px rgba(215, 24, 28, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body.login-page {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--login-page-bg);
    color: var(--login-text);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-phone {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--login-page-bg);
}

.login-phone::before {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 12%, rgba(215, 24, 28, 0.08), transparent 29%),
        radial-gradient(circle at 88% 86%, rgba(44, 166, 127, 0.09), transparent 31%);
    content: "";
    pointer-events: none;
}

.login-screen {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-hero {
    position: relative;
    width: calc(100% + 40px);
    height: 196px;
    margin: -24px -20px 22px;
    flex: 0 0 auto;
    border-radius: 17px 17px 0 0;
    background-image: var(--login-hero-image);
    background-position: center 28%;
    background-size: cover;
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(390px, calc(100vw - 32px));
    min-width: 0;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 auto;
    padding: 24px 20px 20px;
    border: 1px solid rgba(0, 0, 0, 0.035);
    border-radius: 18px;
    background: var(--login-panel);
    box-shadow: var(--login-shadow);
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.login-card::-webkit-scrollbar {
    display: none;
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: clamp(26px, 7vw, 30px);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
}

.login-subtitle {
    margin: 0 0 18px;
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.4;
}

.login-error {
    width: 100%;
    margin: 0 0 14px;
    padding: 2px 8px 0;
    color: #b3323d;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: anywhere;
}

.login-error[hidden] {
    display: none;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 50px;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--login-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 3px 10px rgba(20, 24, 35, 0.025);
}

.login-field:focus-within {
    border-color: var(--login-mint);
    box-shadow: 0 0 0 3px rgba(87, 205, 182, 0.18);
}

.login-field.is-invalid,
.login-field:has(input:user-invalid) {
    border-color: rgba(255, 38, 55, 0.48);
    background: #fffafa;
    box-shadow: 0 0 0 3px rgba(255, 38, 55, 0.08);
}

.login-field.is-invalid:focus-within,
.login-field:has(input:user-invalid):focus-within {
    border-color: var(--login-red);
    box-shadow: 0 0 0 3px rgba(255, 38, 55, 0.12);
}

.login-field svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke: var(--login-mint);
    stroke-width: 1.9;
}

.login-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--login-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.25;
}

.login-field input::placeholder {
    color: #9a9ea6;
}

.login-password-toggle {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    padding: 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.login-password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: #757981;
}

.login-submit {
    position: relative;
    display: grid;
    width: 100%;
    height: 50px;
    min-height: 50px;
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-top: 4px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--login-red), var(--login-red-dark));
    box-shadow: 0 13px 26px rgba(255, 38, 55, 0.23);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.login-submit span {
    grid-column: 1 / -1;
    justify-self: center;
}

.login-submit svg {
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2;
}

.login-submit:hover {
    background: linear-gradient(135deg, var(--login-red-dark), #d7182a);
}

.login-submit:focus-visible,
.login-password-toggle:focus-visible {
    outline: 2px solid rgba(87, 205, 182, 0.45);
    outline-offset: 3px;
}

.login-note {
    margin: 14px 2px 0;
    color: var(--login-muted);
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.login-note--above {
    margin: 0 2px 12px;
    color: var(--login-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.login-actions {
    display: flex;
    justify-content: flex-end;
    margin: 10px 2px 0;
}

.login-actions a,
.login-secondary {
    color: var(--login-mint);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.login-actions a:hover,
.login-secondary:hover {
    text-decoration: underline;
}

.login-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin: 18px 0 12px;
    color: var(--login-muted);
    font-size: 11px;
    text-align: center;
}

.login-divider::before,
.login-divider::after {
    height: 1px;
    background: var(--login-line);
    content: "";
}

.login-secondary {
    display: grid;
    min-height: 48px;
    place-items: center;
    border: 1.5px solid #ff5a66;
    border-radius: 12px;
    color: var(--login-red);
    font-size: 13px;
    letter-spacing: .2px;
    text-decoration: none;
}

.login-success {
    margin: 0 0 12px;
    padding: 10px 11px;
    border: 1px solid #9edbcf;
    border-radius: 11px;
    background: #eefbf8;
    color: #176b5b;
    font-size: 11px;
    line-height: 1.45;
}

.login-consent {
    display: flex;
    min-width: 0;
    gap: 8px;
    align-items: flex-start;
    margin: 1px 2px 2px;
    color: #6f747c;
    font-size: 10px;
    line-height: 1.45;
}

.login-consent input {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
    accent-color: var(--login-red);
}

.login-consent-copy {
    min-width: 0;
    flex: 1;
}

.login-consent.is-invalid .login-consent-summary,
.login-consent:has(input:user-invalid) .login-consent-summary {
    color: #a32b36;
}

.login-gender.is-invalid .login-gender-option-card,
.login-gender:has(input:user-invalid) .login-gender-option-card {
    border-color: rgba(255, 38, 55, 0.38);
    background: #fffafa;
}

.login-consent-summary {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 4px;
    color: #6f747c;
    font-size: 10px;
    line-height: 1.45;
}

.login-gender + .login-consent {
    margin-top: 9px;
}

.login-consent-summary label {
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.login-consent-expand {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--login-mint);
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    flex: 0 0 auto;
    white-space: nowrap;
    cursor: pointer;
}

.login-consent-expand:hover {
    color: var(--login-red);
}

.login-consent-expand:focus-visible {
    outline: 2px solid rgba(87, 205, 182, 0.45);
    outline-offset: 2px;
    border-radius: 3px;
}

.login-consent-details {
    margin-top: 6px;
    color: #858a92;
    font-size: 10px;
    line-height: 1.5;
}

.login-consent-details a {
    color: var(--login-mint);
    overflow-wrap: anywhere;
}

.login-gender {
    display: flex;
    min-width: 0;
    min-inline-size: 0;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.login-gender-options {
    display: flex;
    min-width: 0;
    flex: 1;
    gap: 6px;
}

.login-gender-option {
    position: relative;
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.login-gender-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.login-gender-option-card {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--login-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    color: #6f747c;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
    white-space: nowrap;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.login-gender-option:hover .login-gender-option-card {
    border-color: #9edbcf;
    background: #f6fdfb;
}

.login-gender-option input:checked + .login-gender-option-card {
    border-color: var(--login-mint);
    background: #eefbf8;
    box-shadow: 0 0 0 3px rgba(87, 205, 182, 0.15);
    color: #176b5b;
}

.login-gender-option input:focus-visible + .login-gender-option-card {
    outline: 2px solid rgba(87, 205, 182, 0.45);
    outline-offset: 3px;
}

.login-card--tall {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}

.login-card--tall h1 {
    font-size: clamp(26px, 7vw, 30px);
}

.login-optional {
    display: block;
    margin-top: 14px;
    color: var(--login-mint);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.login-optional:hover {
    text-decoration: underline;
}

.login-homebar {
    display: none;
}

.login-page .legal {
    display: flex;
    width: min(100%, 390px);
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    color: #c4c7cc;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
}

.login-page .legal a {
    color: inherit;
}

.login-page .legal a:hover {
    color: #fff;
}

.login-actions a:focus-visible,
.login-secondary:focus-visible,
.login-optional:focus-visible {
    outline: 2px solid rgba(87, 205, 182, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
}

.login-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 520px) {
    .login-screen {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
}

@media (max-height: 760px) {
    .login-screen {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .login-card {
        padding-top: 20px;
        padding-bottom: 16px;
    }

    .login-hero {
        margin-top: -20px;
    }

    .login-card h1 {
        font-size: 26px;
    }

    .login-field,
    .login-submit {
        min-height: 48px;
        height: 48px;
    }

    .login-secondary {
        min-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit,
    .login-password-toggle,
    .login-gender-option-card {
        transition: none;
    }
}
