:root {
    --auth-blue: #3b82f6;
    --auth-indigo: #6366f1;
    --auth-purple: #7c3aed;
    --auth-ink: #111827;
    --auth-muted: #6b7280;
    --auth-label: #374151;
    --auth-border: #e5e7eb;
    --auth-border-focus: #c7d2fe;
    --auth-surface: #f3f4f6;
    --auth-white: #ffffff;
    --auth-radius: 10px;
    --auth-radius-lg: 28px;
    --auth-font: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --auth-shadow: 0 4px 6px rgba(15, 23, 42, 0.02), 0 24px 48px rgba(15, 23, 42, 0.08);
}

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

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

body.auth-body {
    font-family: var(--auth-font);
    color: var(--auth-ink);
    background: var(--auth-surface);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

/* Left brand panel */
.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: clamp(1.5rem, 4vh, 3.25rem) clamp(1.5rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    background: linear-gradient(145deg, #2563eb 0%, #4f46e5 48%, #7c3aed 100%);
}

.auth-brand__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.auth-brand__glow--1 {
    width: 280px;
    height: 280px;
    top: -60px;
    left: -40px;
    background: rgba(255, 255, 255, 0.22);
}

.auth-brand__glow--2 {
    width: 220px;
    height: 220px;
    top: 18%;
    right: -50px;
    background: rgba(165, 180, 252, 0.35);
}

.auth-brand__glow--3 {
    width: 320px;
    height: 320px;
    bottom: -80px;
    right: 10%;
    background: rgba(167, 139, 250, 0.35);
}

.auth-brand__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1.1px, transparent 1.1px);
    background-size: 22px 22px;
    opacity: 0.22;
    mask-image: radial-gradient(ellipse 70% 55% at 30% 25%, #000 20%, transparent 70%);
    pointer-events: none;
}

.auth-brand__inner {
    position: relative;
    z-index: 1;
    max-width: 460px;
    width: 100%;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    margin-bottom: clamp(2.5rem, 7vh, 4rem);
}

.auth-logo__mark {
    width: 36px;
    height: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.auth-logo__mark span { border-radius: 5px; }
.auth-logo__mark span:nth-child(1) { background: #bfdbfe; }
.auth-logo__mark span:nth-child(2) { background: #93c5fd; }
.auth-logo__mark span:nth-child(3) { background: #c4b5fd; }
.auth-logo__mark span:nth-child(4) { background: #a78bfa; }

.auth-brand__copy h1 {
    margin: 0 0 1.15rem;
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.035em;
}

.auth-brand__copy > p {
    margin: 0 0 clamp(2rem, 5vh, 2.75rem);
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    max-width: 36ch;
    font-weight: 400;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.35rem;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-features__icon {
    position: relative;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 14px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0;
    line-height: 0;
}

.auth-features__icon svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    display: block;
    margin: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-features strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.auth-features li > div > span {
    display: block;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

/* Right form panel — sample card */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vh, 1.75rem) 1.5rem;
    overflow: hidden;
    min-height: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 15%, rgba(124, 58, 237, 0.045), transparent 55%),
        #f0f1f5;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    max-height: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--auth-shadow);
    padding: clamp(1.15rem, 2.5vh, 2rem) clamp(1.25rem, 2.5vw, 2.4rem) clamp(0.85rem, 1.5vh, 1.15rem);
    animation: authRise 0.5s ease both;
    overflow: hidden;
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.auth-card__header {
    text-align: center;
    margin-bottom: clamp(0.75rem, 1.8vh, 1.35rem);
}

.auth-card__icon {
    width: clamp(44px, 6vh, 56px);
    height: clamp(44px, 6vh, 56px);
    margin: 0 auto 0.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ede9fe;
    color: #4338ca;
    font-size: clamp(1.15rem, 2vh, 1.35rem);
}

.auth-card__icon i { line-height: 1; }

.auth-card__header h2 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.2rem, 2.2vh, 1.4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #1f2937;
}

.auth-card__header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-alert {
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.auth-alert--success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.auth-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-field { margin-bottom: clamp(0.55rem, 1.2vh, 0.85rem); }

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.auth-field__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.auth-field__row label { margin-bottom: 0; }

.auth-field__hint {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.35;
}

.auth-field__error {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #dc2626;
}

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

.auth-input__icon {
    position: absolute;
    left: 0.85rem;
    width: 1.05rem;
    height: 1.05rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-input__icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-input:focus-within .auth-input__icon { color: #6366f1; }

.auth-input input {
    width: 100%;
    height: clamp(40px, 5.2vh, 46px);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 2.5rem;
    font: inherit;
    font-size: 0.9rem;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input input::placeholder { color: #9ca3af; }

.auth-input input:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-input input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.auth-input--accent input { border-color: #c7d2fe; }

.auth-input__toggle {
    position: absolute;
    right: 0.35rem;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.auth-input__toggle:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 clamp(0.7rem, 1.5vh, 1.1rem);
    font-size: 0.85rem;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 14px;
    height: 14px;
    accent-color: var(--auth-purple);
    cursor: pointer;
}

.auth-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
}

.auth-link:hover {
    color: #5b21b6;
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    height: clamp(42px, 5.4vh, 48px);
    border: none;
    border-radius: 10px;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 48%, #7c3aed 100%);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.35);
}

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

.auth-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.auth-footer-link {
    text-align: center;
    margin-top: clamp(0.7rem, 1.5vh, 1.1rem);
    font-size: 0.85rem;
    color: #6b7280;
}

.auth-footer-link a {
    color: #7c3aed;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-link a:hover { text-decoration: underline; }

.auth-copy {
    display: block;
    text-align: center;
    margin-top: clamp(0.7rem, 1.4vh, 1.1rem);
    padding-top: clamp(0.55rem, 1vh, 0.85rem);
    border-top: 1px solid #f3f4f6;
    font-size: 0.72rem;
    color: #9ca3af;
}

@media (max-width: 960px) {
    body.auth-body,
    .auth-shell {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }

    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand {
        min-height: auto;
        padding: 1.75rem 1.5rem 2rem;
        justify-content: flex-start;
    }
    .auth-logo { margin-bottom: 1.75rem; }
    .auth-brand__copy h1 { font-size: 1.7rem; }
    .auth-brand__copy > p { margin-bottom: 1.5rem; max-width: none; }
    .auth-features { gap: 1rem; }
    .auth-panel {
        padding: 1.25rem 1rem 2rem;
        overflow: visible;
    }
    .auth-card {
        padding: 1.5rem 1.25rem 1.1rem;
        border-radius: 22px;
        max-width: 480px;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .auth-features__icon {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .auth-features__icon svg {
        width: 22px;
        height: 22px;
    }
}
