:root {
    --brand-red: #dc2429;
    --brand-red-dark: #a90f17;
    --brand-red-soft: #fff0f1;
    --text-primary: #111827;
    --text-secondary: #64748b;
    --border-color: #dce2ea;
    --surface: #ffffff;
    --background: #f5f7fb;
    --danger-background: #fff1f2;
    --danger-border: #fecdd3;
    --danger-text: #be123c;
    --focus-ring: rgba(220, 36, 41, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    background: var(--background);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 46%) 1fr;
}

.auth-brand {
    position: relative;
    display: flex;
    min-height: 100vh;
    padding: 56px;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            #8f0d15 0%,
            #c81720 48%,
            #e4292e 100%
        );
}

.auth-brand::before,
.auth-brand::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-brand::before {
    width: 420px;
    height: 420px;
    right: -190px;
    top: -170px;
    border: 70px solid rgba(255, 255, 255, 0.07);
}

.auth-brand::after {
    width: 280px;
    height: 280px;
    left: -145px;
    bottom: -135px;
    background: rgba(255, 255, 255, 0.06);
}

.auth-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 560px;
    flex-direction: column;
}

.auth-brand__logo {
    display: inline-flex;
    width: fit-content;
    min-height: 76px;
    align-items: center;
    padding: 14px 20px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(72, 0, 6, 0.18);
}

.auth-brand__logo img {
    display: block;
    width: auto;
    max-width: 180px;
    height: 48px;
    object-fit: contain;
}

.auth-brand__message {
    margin: auto 0;
    padding: 72px 0;
}

.auth-brand__label {
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.78;
}

.auth-brand__message h2 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.auth-brand__message p {
    max-width: 490px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    line-height: 1.75;
}

.auth-brand__footer {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.auth-panel {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(220, 36, 41, 0.06),
            transparent 34%
        ),
        var(--background);
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 44px;
    border: 1px solid rgba(220, 226, 234, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
}

.auth-card__mobile-logo {
    display: none;
}

.auth-card__eyebrow {
    margin: 0 0 10px;
    color: var(--brand-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.18;
    letter-spacing: -0.035em;
}

.auth-card__intro {
    margin: 13px 0 32px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.65;
}

.auth-alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    color: var(--danger-text);
    background: var(--danger-background);
    font-size: 14px;
    line-height: 1.5;
}

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

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

.form-field label {
    color: #253146;
    font-size: 14px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    color: var(--text-primary);
    background: #ffffff;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.form-control::placeholder {
    color: #a1a9b8;
}

.form-control:hover {
    border-color: #b9c2cf;
}

.form-control:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.password-control {
    position: relative;
}

.password-control .form-control {
    padding-right: 92px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: #566176;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--brand-red);
    background: var(--brand-red-soft);
}

.password-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
}

.auth-forgot-link {
    justify-self: end;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-forgot-link:hover,
.auth-forgot-link:focus-visible {
    color: var(--brand-red);
}

.auth-forgot-link:focus-visible {
    outline: 3px solid var(--focus-ring);
    border-radius: 4px;
}

.confirm-modal {
    width: min(440px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(16, 24, 40, .25);
}

.confirm-modal::backdrop { background: rgba(16, 24, 40, .58); }
.confirm-modal__body { padding: 24px; }
.confirm-modal__body h3 { margin: 0 0 8px; color: var(--text-primary); }
.confirm-modal__body p { margin: 0; color: var(--text-secondary); line-height: 1.6; font-size: 14px; }
.confirm-modal__actions { display: flex; justify-content: flex-end; margin-top: 22px; }

.auth-submit--modal {
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
}

.auth-submit {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--brand-red),
            #c4161d
        );
    box-shadow: 0 12px 25px rgba(220, 36, 41, 0.23);
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.auth-submit:hover {
    box-shadow: 0 16px 30px rgba(220, 36, 41, 0.29);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 27px 0 0;
    padding-top: 23px;
    border-top: 1px solid #edf0f4;
    color: #7a8598;
    font-size: 12px;
    line-height: 1.55;
}

.auth-note__icon {
    flex: 0 0 auto;
    color: var(--brand-red);
    font-size: 15px;
}

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 32px 20px;
    }

    .auth-card__mobile-logo {
        display: block;
        width: auto;
        max-width: 148px;
        height: 44px;
        margin-bottom: 34px;
        object-fit: contain;
    }
}

@media (max-width: 560px) {
    .auth-panel {
        align-items: stretch;
        padding: 0;
        background: #ffffff;
    }

    .auth-card {
        max-width: none;
        min-height: 100vh;
        padding: 36px 24px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-card h1 {
        font-size: 30px;
    }
}
