:root {
    --auth-ink: #0b1220;
    --auth-muted: #5b6b82;
    --auth-line: rgba(15, 23, 42, 0.14);
    --auth-panel: rgba(255, 255, 255, 0.94);
    --auth-primary: #0f766e;
    --auth-primary-dark: #115e59;
    --auth-danger: #b91c1c;
    --auth-success: #15803d;
}

* {
    box-sizing: border-box;
}

body.auth-screen {
    margin: 0;
    min-height: 100svh;
    color: var(--auth-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
    background: #0b1220;
    overflow: hidden;
}

.auth-bg {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
    background-image:
        linear-gradient(90deg, rgba(4, 11, 25, 0.88), rgba(4, 11, 25, 0.54) 47%, rgba(248, 250, 252, 0.91) 47%, rgba(248, 250, 252, 0.98)),
        var(--auth-bg-current);
    background-position: center;
    background-size: cover;
    transition: background-image 900ms ease;
}

.auth-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 68%);
    pointer-events: none;
}

.auth-story {
    min-height: 100svh;
    padding: clamp(22px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.auth-logo {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    flex: 0 0 auto;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.92);
}

.auth-brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.auth-brand span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.auth-headline {
    max-width: 690px;
}

.auth-headline p {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-headline h1 {
    margin: 0;
    max-width: 11ch;
    color: #fff;
    font-size: clamp(34px, 5vw, 66px);
    line-height: 0.98;
    letter-spacing: 0;
}

.auth-signal {
    max-width: 760px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(8, 15, 31, 0.62);
    backdrop-filter: blur(12px);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-signal strong {
    display: block;
    font-size: 14px;
}

.auth-signal span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.auth-signal-line {
    flex: 1;
    height: 6px;
    min-width: 120px;
    border-radius: 999px;
    background: linear-gradient(90deg, #14b8a6, #f59e0b, #2563eb);
}

.auth-form-area {
    min-height: 100svh;
    padding: clamp(18px, 3vw, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.auth-panel {
    width: min(100%, 430px);
}

.auth-panel.compact {
    width: min(100%, 400px);
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 13px;
}

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

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

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--auth-primary-dark);
    font-size: 13px;
    font-weight: 800;
}

.auth-title h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1;
    letter-spacing: 0;
}

.auth-title p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.45;
}

.auth-card {
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: var(--auth-panel);
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.15);
    padding: clamp(18px, 3vw, 26px);
}

.auth-alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(185, 28, 28, 0.25);
    background: rgba(254, 226, 226, 0.92);
    color: var(--auth-danger);
    font-size: 14px;
}

.auth-alert.success {
    border-color: rgba(21, 128, 61, 0.24);
    background: rgba(220, 252, 231, 0.9);
    color: var(--auth-success);
}

.auth-field {
    margin-bottom: 15px;
}

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

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap i {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #64748b;
}

.auth-input-wrap input {
    width: 100%;
    min-height: 47px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 44px 0 40px;
    color: var(--auth-ink);
    background: #fff;
    font: inherit;
}

.auth-input-wrap input:focus {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    border-color: var(--auth-primary);
}

.auth-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
}

.auth-toggle i {
    position: static;
    transform: none;
}

.auth-button {
    width: 100%;
    min-height: 49px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 16px 32px rgba(15, 118, 110, 0.24);
    text-decoration: none;
}

.auth-button:hover {
    background: var(--auth-primary-dark);
}

.auth-secondary-row {
    margin-top: 16px;
    text-align: center;
}

.auth-footnote {
    margin-top: 16px;
    color: var(--auth-muted);
    font-size: 12px;
    text-align: center;
}

.auth-meter {
    height: 6px;
    border-radius: 999px;
    background: #dbe3ef;
    overflow: hidden;
}

.auth-meter span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--auth-danger);
    transition: width 180ms ease, background 180ms ease;
}

.auth-help {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
}

@media (max-width: 980px) {
    body.auth-screen {
        overflow: auto;
    }

    .auth-bg {
        grid-template-columns: 1fr;
        background-image:
            linear-gradient(180deg, rgba(4, 11, 25, 0.82), rgba(248, 250, 252, 0.97) 42%),
            var(--auth-bg-current);
    }

    .auth-story {
        min-height: auto;
        padding-bottom: 18px;
        gap: 34px;
    }

    .auth-form-area {
        min-height: auto;
        align-items: flex-start;
        padding-top: 18px;
    }
}

@media (max-width: 560px) {
    .auth-signal {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-signal-line {
        width: 100%;
    }
}
