:root {
    --auth-red: #e10600;
    --auth-red-soft: rgba(225, 6, 0, 0.12);
    --auth-ink: #111111;
    --auth-muted: #6b6b6b;
    --auth-line: #e7e7e7;
    --auth-fill: #f4f4f4;
    --auth-white: #ffffff;
    --auth-dark: #0c0c0c;
    --auth-radius: 14px;
    --auth-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

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

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

body.auth-body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background: var(--auth-dark);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 42%) 1fr;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 500px at -10% 110%, rgba(225, 6, 0, 0.28), transparent 55%),
        linear-gradient(180deg, #161616 0%, #0a0a0a 100%);
    color: var(--auth-white);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(45deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.auth-brand::after {
    content: "G";
    position: absolute;
    right: -40px;
    bottom: -70px;
    font-size: 420px;
    font-weight: 800;
    letter-spacing: -0.08em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.auth-brand-top,
.auth-brand-copy,
.auth-brand-foot {
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.auth-logo-mark {
    width: 56px;
    height: 56px;
    padding: 10px;
    border-radius: 16px;
    background: var(--auth-white);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.auth-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-logo-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-logo-badge {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--auth-red);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-brand-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 800;
    max-width: 9ch;
}

.auth-brand-copy p {
    margin: 0;
    max-width: 34ch;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}

.auth-notice {
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
}

.auth-notice strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffb4ae;
}

.auth-notice span {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}

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

.auth-brand-foot a {
    color: var(--auth-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.auth-brand-foot a:hover {
    border-bottom-color: var(--auth-white);
}

.auth-panel {
    background: var(--auth-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 32px;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.auth-card .auth-lead {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.5;
}

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

.auth-alert-danger {
    background: #fff1f0;
    color: #9b1c1c;
    border: 1px solid #ffd0cc;
}

.auth-alert-success {
    background: #edf9f0;
    color: #146c2e;
    border: 1px solid #c8ecd3;
}

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

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-input,
.auth-input-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--auth-white);
    font: inherit;
    font-size: 15px;
    color: var(--auth-ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus,
.auth-input-wrap input:focus {
    border-color: var(--auth-ink);
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.auth-input.is-invalid,
.auth-input-wrap.is-invalid input {
    border-color: var(--auth-red);
    box-shadow: 0 0 0 4px var(--auth-red-soft);
}

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

.auth-input-wrap input {
    padding-right: 46px;
}

.auth-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    border-radius: 8px;
}

.auth-toggle:hover {
    color: var(--auth-ink);
    background: var(--auth-fill);
}

.auth-error {
    display: block;
    margin-top: 6px;
    color: var(--auth-red);
    font-size: 13px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 22px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-ink);
}

.auth-link {
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

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

.auth-submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-ink);
    color: var(--auth-white);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.auth-submit:hover {
    background: #000;
}

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

.auth-back {
    display: inline-block;
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: 14px;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--auth-ink);
}

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

    .auth-brand {
        min-height: auto;
        padding: 20px 20px 22px;
        justify-content: flex-start;
        gap: 16px;
    }

    .auth-brand::after {
        font-size: 180px;
        right: -16px;
        bottom: -48px;
    }

    .auth-brand-copy h1 {
        max-width: none;
        font-size: 22px;
        margin: 0 0 8px;
    }

    .auth-brand-copy p {
        font-size: 14px;
    }

    .auth-notice {
        margin-top: 14px;
        padding: 12px 14px;
    }

    .auth-brand-foot {
        display: none;
    }

    .auth-panel {
        padding: 24px 20px 40px;
        align-items: flex-start;
    }

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