@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&display=swap');

:root {
    --auth-bg: #050814;
    --auth-panel: #0f172a;
    --auth-card: #0b1327;
    --auth-border: rgba(148, 163, 184, .16);
    --auth-muted: #94a3b8;
    --auth-accent: #38bdf8;
    --auth-accent-2: #22c55e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background:
        radial-gradient(60% 80% at 10% 10%, rgba(56, 189, 248, .16), transparent 60%),
        radial-gradient(60% 80% at 90% 20%, rgba(34, 197, 94, .12), transparent 60%),
        radial-gradient(40% 50% at 50% 90%, rgba(129, 140, 248, .15), transparent 60%),
        var(--auth-bg);
    background-attachment: fixed;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Subtle animated dot pattern */
body.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .06;
    background-repeat: repeat;
    background-size: 200px 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='0.8' fill='%23ffffff' fill-opacity='0.5'/%3E%3C/svg%3E");
    mask-image: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0) 75%);
    animation: subtlePulse 8s ease-in-out infinite;
}

@keyframes subtlePulse {

    0%,
    100% {
        opacity: .06;
    }

    50% {
        opacity: .1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Layout ── */
.auth-shell {
    width: min(1120px, 96vw);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
    animation: fadeInUp 0.6s ease both;
}

/* ── Hero (left panel) ── */
.auth-hero {
    position: relative;
    border-radius: 26px;
    padding: 32px;
    background: linear-gradient(145deg, rgba(30, 64, 175, .18), rgba(2, 6, 23, .85));
    border: 1px solid rgba(148, 163, 184, .14);
    border-top-color: rgba(255, 255, 255, .08);
    overflow: hidden;
    min-height: 420px;
    backdrop-filter: blur(16px) saturate(180%);
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 340px;
    height: 340px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, .3), transparent 70%);
    opacity: .7;
    pointer-events: none;
    animation: auroraFloat 12s ease-in-out infinite alternate;
}

@keyframes auroraFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, 20px) scale(1.08);
    }
}

.auth-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Brand ── */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.auth-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-brand-name {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.auth-brand-sub {
    font-size: .82rem;
    color: var(--auth-muted);
    font-weight: 600;
}

/* ── Title ── */
.auth-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-desc {
    font-size: .95rem;
    color: rgba(226, 232, 240, .85);
    max-width: 460px;
    line-height: 1.6;
}

/* ── Quick links ── */
.auth-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 10px;
    margin-top: 8px;
    max-width: 520px;
    align-items: stretch;
}

.auth-links-title {
    font-weight: 700;
    font-size: .82rem;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-links-wrap {
    margin-top: 10px;
    max-width: 520px;
}

.auth-links-wrap .auth-links-title {
    margin-top: 6px;
}

.auth-link-btn.wide {
    grid-column: 1 / -1;
}

.auth-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, .25);
    background: rgba(30, 64, 175, .2);
    color: #dbeafe;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    min-height: 44px;
    backdrop-filter: blur(8px);
}

.auth-link-btn:hover {
    background: rgba(30, 64, 175, .35);
    border-color: rgba(125, 211, 252, .5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}

/* ── Login card ── */
.auth-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, .95), rgba(11, 19, 39, .98));
    border: 1px solid var(--auth-border);
    border-top-color: rgba(255, 255, 255, .06);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 48px rgba(2, 6, 23, .5);
    backdrop-filter: blur(20px) saturate(180%);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.auth-card h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-card p {
    margin: 0 0 18px;
    color: var(--auth-muted);
    font-size: .9rem;
}

.auth-card label {
    display: block;
    margin: 12px 0 6px;
    font-size: .82rem;
    color: var(--auth-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-card input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .2);
    background: rgba(15, 23, 42, .85);
    color: #e2e8f0;
    font-size: .95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-card input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, .55);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .12), 0 0 20px rgba(56, 189, 248, .06);
    background: rgba(15, 23, 42, .95);
}

/* ── Submit button ── */
.auth-submit {
    margin-top: 18px;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    font-size: .95rem;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 18px rgba(34, 197, 94, .25);
    position: relative;
    overflow: hidden;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(34, 197, 94, .4);
    filter: brightness(1.05);
}

.auth-submit:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* ── Loading state ── */
.auth-submit.is-loading {
    pointer-events: none;
    opacity: .8;
    position: relative;
    color: transparent;
}

.auth-submit.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .6s linear infinite;
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Password toggle ── */
.auth-pw-wrap {
    position: relative;
}

.auth-pw-wrap input {
    padding-right: 48px;
}

.auth-pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s ease, background .2s ease;
}

.auth-pw-toggle:hover {
    color: var(--auth-accent);
    background: rgba(56, 189, 248, .08);
}

.auth-pw-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-note {
    margin-top: 14px;
    color: var(--auth-muted);
    font-size: .82rem;
    text-align: center;
}

/* ── Error message ── */
.error {
    margin: 8px 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fecaca;
    font-size: .88rem;
    font-weight: 600;
    animation: fadeInUp 0.3s ease both;
}

/* Session expired info */
.error.session-expired {
    background: rgba(245, 158, 11, .1);
    border-color: rgba(245, 158, 11, .3);
    color: #fde68a;
}

/* ── Floating orbs ── */
.auth-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    z-index: 0;
    will-change: transform;
}

.auth-orb--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, .22), transparent 70%);
    top: -8%;
    left: -5%;
    animation: orbFloat1 16s ease-in-out infinite alternate;
}

.auth-orb--2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(129, 140, 248, .2), transparent 70%);
    bottom: -10%;
    right: -3%;
    animation: orbFloat2 20s ease-in-out infinite alternate;
}

.auth-orb--3 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(34, 197, 94, .15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 14s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, 30px) scale(1.12);
    }

    100% {
        transform: translate(-20px, 50px) scale(0.95);
    }
}

@keyframes orbFloat2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-35px, -25px) scale(1.08);
    }

    100% {
        transform: translate(25px, -40px) scale(0.92);
    }
}

@keyframes orbFloat3 {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-40%, -55%) scale(1.15);
    }

    100% {
        transform: translate(-55%, -45%) scale(0.9);
    }
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-card {
        order: 1;
    }

    .auth-hero {
        order: 2;
    }
}

@media (max-width: 700px) {
    .auth-links {
        grid-template-columns: 1fr;
    }

    .auth-link-btn.wide {
        grid-column: auto;
    }

    .auth-orb {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}