:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    --page-background: #f8f9fb;
    --surface: #ffffff;
    --text-primary: #24282d;
    --text-secondary: #62676d;
    --border: #dfe3e7;
    --soft-border: #eaecf0;
    --input-background: #f4f7fc;
    --input-border: #cdd5df;
    --accent: #40b56c;
    --accent-hover: #32a75d;
    --accent-dark: #208b4b;
    --brand: #f05e38;
    --danger-background: #fff5f5;
    --danger-border: #fecaca;
    --danger-text: #b42318;
    --success-background: #effaf3;
    --success-border: #b7e4c7;
    --success-text: #157347;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    background: var(--page-background);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.site-header {
    height: 76px;
    flex: 0 0 auto;
    background: rgb(255 255 255 / 95%);
    border-bottom: 1px solid var(--border);
}

.site-header-inner,
.site-footer-inner,
.auth-grid {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 23px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgb(30 35 40 / 10%));
}

.back-home {
    min-height: 42px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #41464c;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
    font-size: 14px;
    line-height: 1;
    font-weight: 650;
    text-decoration: none;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.back-home svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-home:hover {
    color: var(--accent-dark);
    background: #f8fffb;
    border-color: #a7d8ba;
}

.auth-main {
    flex: 1 0 auto;
    padding: 64px 24px;
    display: flex;
    align-items: center;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
    align-items: center;
    gap: clamp(56px, 7vw, 100px);
}

.auth-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
}

.auth-story {
    max-width: 610px;
}

.auth-eyebrow,
.auth-card-kicker {
    margin: 0;
    color: var(--brand);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 750;
    letter-spacing: 2.6px;
    text-transform: uppercase;
}

.auth-story h1 {
    max-width: 590px;
    margin: 22px 0 0;
    color: var(--text-primary);
    font-size: clamp(46px, 5.2vw, 68px);
    line-height: 1.03;
    letter-spacing: -2.8px;
    font-weight: 750;
}

.auth-story-copy {
    max-width: 590px;
    margin: 26px 0 0;
    color: var(--text-secondary);
    font-size: 19px;
    line-height: 1.65;
    font-weight: 550;
}

.auth-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-benefit {
    min-height: 132px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 7px 20px rgb(16 24 40 / 4%);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.auth-benefit:hover {
    border-color: #b9d9c5;
    box-shadow: 0 10px 24px rgb(16 24 40 / 8%);
    transform: translateY(-2px);
}

.auth-benefit-copy {
    width: 100%;
}

.auth-benefit-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 9px;
}

.auth-benefit-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-benefit-icon-lock {
    color: var(--brand);
    background: #fff0eb;
}

.auth-benefit-icon-help {
    color: var(--accent-dark);
    background: #eaf7ef;
}

.auth-benefit strong {
    display: block;
    color: #30353a;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 750;
}

.auth-card {
    width: 100%;
    padding: 38px;
    background: var(--surface);
    border: 1px solid #d8dde2;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgb(16 24 40 / 9%);
}

.auth-card-intro {
    margin-bottom: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--soft-border);
}

.auth-card-intro .auth-card-kicker {
    margin-bottom: 10px;
    letter-spacing: 1.8px;
}

.auth-card h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.8px;
    font-weight: 750;
}

.auth-card-intro > p:last-child,
.auth-status > p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
}

.auth-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.auth-alert-error {
    color: var(--danger-text);
    background: var(--danger-background);
    border-color: var(--danger-border);
}

.auth-alert-success {
    color: var(--success-text);
    background: var(--success-background);
    border-color: var(--success-border);
}

.auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field label {
    color: #343a40;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 650;
}

.auth-field input,
.login-input,
.auth-input {
    width: 100%;
    height: 54px;
    padding: 0 15px;
    color: var(--text-primary);
    background: var(--input-background);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    outline: none;
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-field input::placeholder,
.login-input::placeholder,
.auth-input::placeholder {
    color: #98a2b3;
    opacity: 1;
}

.auth-field input:hover,
.login-input:hover,
.auth-input:hover {
    border-color: #aeb6c0;
}

.auth-field input:focus,
.login-input:focus,
.auth-input:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(64 181 108 / 14%);
}

.auth-field-error {
    color: var(--danger-text);
    font-size: 12px;
    line-height: 1.4;
}

.auth-field-error ul {
    margin: 0;
    padding-left: 18px;
}

.auth-password-hint {
    margin: -5px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.auth-button {
    width: 100%;
    height: 54px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent-dark);
    border-radius: 8px;
    box-shadow: 0 7px 17px rgb(32 139 75 / 18%);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
    transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.auth-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 9px 20px rgb(32 139 75 / 23%);
}

.auth-button:active {
    transform: translateY(1px);
}

.auth-button-arrow {
    font-size: 21px;
    line-height: 0.8;
    font-weight: 400;
}

.auth-card-footer {
    margin-top: 27px;
    padding-top: 21px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--soft-border);
}

.auth-card-footer a,
.footer-links a {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 650;
    text-decoration: none;
}

.auth-card-footer a:hover,
.footer-links a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-status {
    padding: 8px 0 2px;
    text-align: center;
}

.auth-status-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 750;
}

.auth-status-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-status-icon-success {
    color: var(--success-text);
    background: var(--success-background);
    border: 1px solid var(--success-border);
}

.auth-status-icon-error {
    color: var(--danger-text);
    background: var(--danger-background);
    border: 1px solid var(--danger-border);
}

.auth-status .auth-card-kicker {
    margin-bottom: 10px;
}

.auth-status .auth-button {
    margin-top: 26px;
}

.site-footer {
    flex: 0 0 auto;
    padding: 34px 24px;
    background: #ffffff;
    border-top: 1px solid var(--border);
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.footer-brand {
    flex: 0 0 auto;
}

.footer-details {
    text-align: right;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 26px;
}

.footer-details p {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 550;
}

.brand:focus-visible,
.back-home:focus-visible,
.auth-button:focus-visible,
.auth-card-footer a:focus-visible,
.auth-benefit:focus-visible,
.footer-links a:focus-visible {
    outline: 3px solid rgb(64 181 108 / 20%);
    outline-offset: 3px;
}

@media (max-width: 1100px) {
    .auth-main {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .auth-grid {
        max-width: 680px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "story"
            "card"
            "benefits";
        gap: 38px;
    }

    .auth-left {
        display: contents;
    }

    .auth-story {
        grid-area: story;
        max-width: none;
        text-align: center;
    }

    .auth-story h1,
    .auth-story-copy {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-story h1 {
        font-size: 46px;
    }

    .auth-benefits {
        grid-area: benefits;
        max-width: 560px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .auth-card {
        grid-area: card;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 700px) {
    .site-header {
        height: 68px;
    }

    .site-header-inner,
    .site-footer-inner,
    .auth-grid {
        width: min(100% - 32px, 500px);
    }

    .brand {
        gap: 8px;
        font-size: 20px;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .back-home {
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .auth-main {
        padding: 32px 16px;
        align-items: flex-start;
    }

    .auth-grid {
        gap: 28px;
    }

    .auth-story h1 {
        margin-top: 14px;
        font-size: 34px;
        line-height: 1.08;
        letter-spacing: -1.4px;
    }

    .auth-story-copy {
        margin-top: 16px;
        font-size: 16px;
        line-height: 1.55;
    }

    .auth-card {
        padding: 28px 24px;
        border-radius: 12px;
    }

    .auth-benefits {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .auth-benefit {
        min-height: 82px;
        padding: 16px;
        align-items: center;
        justify-content: flex-start;
        flex-direction: row;
        gap: 14px;
    }

    .auth-benefit-copy {
        width: auto;
    }

    .auth-card h2 {
        font-size: 27px;
    }

    .auth-card-intro {
        margin-bottom: 25px;
        padding-bottom: 23px;
    }

    .site-footer {
        padding: 28px 16px;
    }

    .site-footer-inner {
        align-items: center;
        flex-direction: column;
        gap: 22px;
        text-align: center;
    }

    .footer-details {
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        gap: 20px;
    }
}

@media (max-width: 380px) {
    .back-home svg {
        display: none;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .auth-card-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .footer-links {
        align-items: center;
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-home,
    .auth-benefit,
    .auth-field input,
    .login-input,
    .auth-input,
    .auth-button {
        transition: none;
    }
}
