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

:root {
    --auth-ink: #000000;
    --auth-muted: #6b7280;
    --auth-line: #e5e7eb;
    --auth-panel: #ffffff;
    --auth-soft: #f7f2ee;
    --auth-primary: #712cf9;
    --auth-primary-dark: #6628e0;
    --auth-accent: #d69b6a;
    --auth-success: #0f9f6e;
    --auth-danger: #d64545;
    --auth-shadow: 0 22px 70px rgba(35, 25, 31, 0.14);
    --auth-radius: 8px;
    --auth-font: 'Karla', sans-serif;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    font-family: var(--auth-font);
    background:
        linear-gradient(135deg, rgba(185, 86, 121, 0.06), rgba(214, 155, 106, 0.12)),
        #fbfaf8;
}

a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

button,
input {
    font: inherit;
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(420px, 0.92fr) minmax(420px, 1fr);
    min-height: 100vh;
}

.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 56px;
    min-height: 100vh;
    padding: clamp(32px, 5vw, 72px);
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(39, 20, 31, 0.9), rgb(106 41 232 / 64%)), url(../images/elements/slide1.jpg) center / cover;
}

.auth-story::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(28, 18, 24, 0.68));
    pointer-events: none;
}

.brand-mark,
.story-copy,
.story-stats {
    position: relative;
    z-index: 1;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--auth-radius);
    color: #34151f;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.story-copy {
    max-width: 560px;
}

.story-label,
.auth-kicker {
    display: block;
    margin-bottom: 14px;
    color: var(--auth-panel);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.story-copy h1 {
    margin: 0;
    max-width: 680px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1;
    letter-spacing: 0;
}

.story-copy p {
    max-width: 520px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    line-height: 1.75;
}

.story-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.story-stat {
    min-height: 122px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.story-stat strong {
    display: block;
    margin-bottom: 18px;
    color: #f6cf9a;
    font-size: 13px;
}

.story-stat span {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.auth-panel {
    display: grid;
    align-items: center;
    min-height: 100vh;
    padding: clamp(24px, 6vw, 76px);
}

.auth-card {
    width: min(100%, 480px);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(229, 231, 235, 0.86);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--auth-shadow);
}

.auth-title {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(28px, 4vw, 29px);
    line-height: 1.12;
    letter-spacing: -2px;
}

.auth-subtitle {
    margin: 12px 0 30px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.7;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.form-control {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    color: var(--auth-ink);
    background: #fff;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

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

.form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(185, 86, 121, 0.12);
}

.form-control.is-invalid {
    border-color: rgba(214, 69, 69, 0.72);
    background: #fffafa;
}

.password-field {
    position: relative;
}

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

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: var(--auth-radius);
    color: #8b95a5;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--auth-primary);
    background: var(--auth-soft);
    outline: none;
}

.password-toggle svg,
.toast-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.invalid-feedback {
    display: block;
    margin-top: 8px;
    color: var(--auth-danger);
    font-size: 13px;
    font-weight: 700;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 26px;
    font-size: 14px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #4b5563;
    font-weight: 700;
    cursor: pointer;
}

.remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    border: 0;
    border-radius: var(--auth-radius);
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    box-shadow: 0 15px 28px rgba(185, 86, 121, 0.28);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 19px 34px rgba(185, 86, 121, 0.34);
    outline: none;
}

.btn:active {
    transform: translateY(0);
}

.auth-footer {
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 20;
    display: grid;
    gap: 12px;
    width: min(380px, calc(100vw - 32px));
}

.toast-message {
    display: grid;
    grid-template-columns: 38px 1fr 28px;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: #fff;
    box-shadow: 0 18px 46px rgba(31, 41, 55, 0.14);
    animation: toastIn 220ms ease both;
}

.toast-message.is-hiding {
    animation: toastOut 220ms ease both;
}

.toast-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: var(--auth-radius);
}

.toast-success .toast-icon {
    color: var(--auth-success);
    background: rgba(15, 159, 110, 0.1);
}

.toast-error .toast-icon {
    color: var(--auth-danger);
    background: rgba(214, 69, 69, 0.1);
}

.toast-message strong {
    display: block;
    margin-bottom: 3px;
    color: var(--auth-ink);
    font-size: 14px;
}

.toast-message p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.45;
}

.toast-close {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: var(--auth-radius);
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
}

.toast-close:hover,
.toast-close:focus {
    color: var(--auth-ink);
    background: #f3f4f6;
    outline: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(12px);
    }
}

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

    .auth-story {
        min-height: auto;
        padding: 28px;
    }

    .story-copy {
        margin-top: 40px;
    }

    .story-copy h1 {
        max-width: 760px;
    }

    .auth-panel {
        min-height: auto;
        padding: 32px 24px 48px;
    }
}

@media (max-width: 720px) {
    .auth-story {
        gap: 32px;
    }

    .story-copy h1 {
        font-size: 34px;
    }

    .story-copy p {
        font-size: 15px;
    }

    .story-stats {
        grid-template-columns: 1fr;
    }

    .story-stat {
        min-height: auto;
    }

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

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

@media (max-width: 460px) {
    .auth-story {
        padding: 22px;
    }

    .auth-panel {
        padding: 22px 14px 34px;
    }

    .auth-title {
        font-size: 27px;
    }

    .toast-stack {
        right: 16px;
        bottom: 16px;
    }
}