:root {
    --auth-primary: #7e2525;
    --auth-primary-dark: #601a1a;
    --auth-primary-soft: #fbf2f2;
    --auth-text: #172033;
    --auth-muted: #687386;
    --auth-border: #dce2ea;
    --auth-surface: #ffffff;
    --auth-background: #f3f5f8;
    --auth-radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--auth-background);
}

body.auth-body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px;
    overflow-x: hidden;
    color: var(--auth-text);
    background: var(--auth-background) url('/assets/images/bg.jpg') center center / cover fixed no-repeat;
    font-family: "Oswald", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a,
button,
input {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(126, 37, 37, .2);
    outline-offset: 2px;
}

.auth-skip-link {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    color: #fff;
    background: var(--auth-primary);
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .18s ease;
}

.auth-skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.auth-wrapper {
    width: min(100%, 470px);
    padding: 30px 34px 34px;
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 65px rgba(8, 15, 28, .3);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: auth-enter .45s ease-out both;
}

.auth-brand {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 23px;
    color: var(--auth-primary);
    text-align: center;
    text-decoration: none;
}

.auth-brand:hover {
    color: var(--auth-primary);
}

.auth-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    object-fit: contain;
    filter: drop-shadow(0 4px 9px rgba(126, 37, 37, .14));
}

.auth-brand-copy {
    display: grid;
    gap: 1px;
}

.auth-brand-copy strong {
    display: block;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .015em;
    line-height: 1.28;
}

.auth-content {
    min-width: 0;
}

.auth-card {
    width: 100%;
    margin: 0;
    padding: 0;
}

.auth-page-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
}

.auth-page-heading {
    margin-bottom: 24px;
}

.auth-page-heading h1 {
    margin: 0;
    color: var(--auth-text);
    font-size: 29px;
    font-weight: 600;
    letter-spacing: -.012em;
    line-height: 1.2;
}

.auth-page-heading h1.auth-page-title-compact {
    color: var(--auth-text);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: .025em;
}

.auth-page-heading p {
    max-width: 390px;
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.5;
}

.auth-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border: 1px solid #e4e8ee;
    border-radius: 11px;
    background: #f3f5f7;
}

.auth-switcher-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #647084;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-switcher-link:hover {
    color: var(--auth-primary);
}

.auth-switcher-link.active {
    color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 2px 7px rgba(25, 34, 49, .09);
}

.auth-form {
    margin: 0;
}

.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-group label {
    display: block;
    margin-bottom: 6px;
    color: #394459;
    font-size: 14px;
    font-weight: 500;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    z-index: 1;
    left: 15px;
    color: #8b96a8;
    font-size: 15px;
    pointer-events: none;
    transition: color .18s ease;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 43px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    outline: 0;
    color: var(--auth-text);
    background: #fff;
    font-size: 15px;
    font-weight: 400;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

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

.auth-input:hover {
    border-color: #bcc5d1;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(126, 37, 37, .11);
}

.auth-input:read-only {
    color: #536073;
    background: #f5f7f9;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--auth-primary);
}

.auth-input-code {
    padding-right: 43px;
    padding-left: 43px;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .18em;
    text-align: center;
}

.auth-toggle-password {
    position: absolute;
    z-index: 2;
    right: 8px;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #7f8a9c;
    background: transparent;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

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

.auth-sublinks {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 24px;
    margin: -2px 0 16px;
}

.auth-sublinks-centered {
    justify-content: center;
    margin: 16px 0 0;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-primary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 18px;
    border: 1px solid var(--auth-primary);
    border-radius: 10px;
    color: #fff;
    background: var(--auth-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 7px 16px rgba(126, 37, 37, .18);
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-submit-btn:hover {
    border-color: var(--auth-primary-dark);
    background: var(--auth-primary-dark);
    box-shadow: 0 9px 20px rgba(96, 26, 26, .23);
    transform: translateY(-1px);
}

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

.auth-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e8ebf0;
}

.auth-btn-secondary {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    color: #4c586b;
    background: #fff;
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.auth-btn-secondary:hover {
    border-color: rgba(126, 37, 37, .28);
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 17px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.45;
}

.auth-alert i {
    flex: 0 0 auto;
    margin-top: 3px;
}

.auth-alert-danger {
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.auth-alert-success {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

@keyframes auth-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@media (max-width: 900px) {
    body.auth-body {
        align-items: flex-start;
        padding: 18px;
    }
}

@media (max-width: 560px) {
    body.auth-body {
        padding: 12px;
    }

    .auth-wrapper {
        width: 100%;
        padding: 24px 18px 28px;
        border-radius: 17px;
    }

    .auth-brand {
        margin-bottom: 20px;
    }

    .auth-logo {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .auth-brand-copy strong {
        font-size: 14.5px;
    }

    .auth-page-heading {
        margin-bottom: 20px;
    }

    .auth-page-heading h1 {
        font-size: 26px;
    }

    .auth-switcher {
        margin-bottom: 22px;
    }

    .auth-switcher-link {
        min-height: 44px;
        gap: 5px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 13px;
    }

    .auth-secondary-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
