:root {
    --radius-xl: 26px;
    --radius-md: 16px;

    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;

    --transition-fast: .18s ease;
}

:root,
:root[data-theme="night"] {
    --color-bg: #050814;
    --color-bg-gradient:
        radial-gradient(circle at 0% 0%, #1a3b6d 0, #050814 45%, #020308 100%);

    --color-card: rgba(10,14,30,.86);
    --color-border: rgba(255,255,255,.08);

    --color-text-main: #f9fafb;
    --color-text-muted: #9ca3af;

    --color-input-bg: rgba(15,23,42,.86);
    --color-input-text: #f9fafb;
    --color-input-placeholder: rgba(148,163,184,.85);

    --color-link: #93c5fd;

    --color-badge-bg: rgba(15,23,42,.85);
    --color-accent: #2f8cff;
    --color-accent-soft: rgba(47,140,255,.2);

    --color-danger: #f97373;
    --color-success: #4ade80;
}

:root[data-theme="day"] {
    --color-bg: #f8fafc;
    --color-bg-gradient:
        radial-gradient(circle at 0% 0%, #dbeafe 0, #f8fafc 55%, #ffffff 100%);

    --color-card: rgba(255,255,255,.88);
    --color-border: rgba(15,23,42,.16);

    --color-text-main: #0f172a;
    --color-text-muted: #334155;

    --color-input-bg: rgba(255,255,255,.95);
    --color-input-text: #0f172a;
    --color-input-placeholder: #64748b;

    --color-link: #2563eb;

    --color-badge-bg: rgba(241,245,249,.9);
    --color-accent: #2563eb;
    --color-accent-soft: rgba(37,99,235,.15);

    --color-danger: #dc2626;
    --color-success: #16a34a;
}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--color-text-main);
    background: var(--color-bg-gradient);
}

.auth-body {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#net-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

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

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
    gap: 1px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(115,184,255,.28), rgba(101,90,255,.12), rgba(15,23,42,.9));
    padding: 1px;
    box-shadow:
        0 32px 90px rgba(0,0,0,.65),
        0 0 80px rgba(56,189,248,.25);
    backdrop-filter: blur(24px);
}

.auth-inner {
    display: contents;
}

.auth-left,
.auth-right {
    padding: 28px 32px 32px;
    background: var(--color-card);
    border-color: var(--color-border);
}

.auth-left {
    border-top-left-radius: var(--radius-xl);
    border-bottom-left-radius: var(--radius-xl);
    border-right: 1px solid var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.auth-right {
    border-top-right-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    position: relative;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.auth-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, #a5f3fc 0, #38bdf8 35%, #1d4ed8 100%);
    box-shadow:
        0 0 20px rgba(56,189,248,.6),
        0 0 50px rgba(59,130,246,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5f4ff;
    font-weight: 800;
    font-size: 18px;
}

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

.auth-logo-text span:first-child {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 11px;
    color: #9ca3af;
}

.auth-logo-text span:last-child {
    font-weight: 700;
    font-size: 18px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
}

.auth-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.auth-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-badge-bg);,
    rgba(15,23,42,.85);
    font-size: 11px;
    color: var(--color-text-main);
}

.auth-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: conic-gradient(from 160deg, #22c55e, #4ade80, #bbf7d0, #4ade80);
    box-shadow: 0 0 12px rgba(34,197,94,.85);
}

.auth-badge-pill {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    background: rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.6);
    color: #9ca3af;
}

.auth-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    color: var(--radius-xl);
    font-size: 13px;
}

.auth-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.auth-list li svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-list-label {
    color: #e5e7eb;
}

.auth-metric-card {
    position: absolute;
    right: 13px;
    bottom: 13px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.55);
    background: radial-gradient(circle at 0 0, rgba(59,130,246,.35), transparent 55%),
    rgba(15,23,42,.96);
    box-shadow:
        0 18px 46px rgba(0,0,0,.75),
        0 0 30px rgba(59,130,246,.5);
    font-size: 11px;
}

.auth-metric-label {
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10px;
}

.auth-metric-value {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.auth-metric-pill {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(22,163,74,.14);
    color: #bbf7d0;
    font-size: 11px;
}

.auth-metric-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #4ade80;
}

.auth-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.auth-form-header h2 {
    margin: 0;
    font-size: 22px;
}

.auth-form-header span {
    font-size: 12px;
    color: var(--radius-xl);
}

.auth-form {
    margin-top: 4px;
}

.auth-label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--radius-xl);
}

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

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

.auth-input-shell input {
    width: 100%;
    padding: 12px 12px 12px 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-input-bg);
    color: var(--color-input-text);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.auth-input-shell input::placeholder {
    color: var(--color-input-placeholder);
}

.auth-input-shell input:focus {
    border-color: rgba(59,130,246,.9);
    box-shadow:
        0 0 0 1px rgba(59,130,246,.6),
        0 0 24px rgba(59,130,246,.45);
    background: radial-gradient(circle at 0 0, rgba(37,99,235,.4), transparent 65%),
    rgba(15,23,42,.94);
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: .75;
    color: #9ca3af;
}

.auth-error {
    margin-top: -4px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--color-danger);
}

.auth-foot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-remember input {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.auth-btn-primary {
    width: 100%;
    border: none;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 16px 40px rgba(37,99,235,.55),
        0 0 44px rgba(59,130,246,.75);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-btn-primary span {
    letter-spacing: .02em;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow:
        0 22px 60px rgba(37,99,235,.70),
        0 0 52px rgba(59,130,246,.90);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 10px 24px rgba(37,99,235,.55),
        0 0 34px rgba(59,130,246,.80);
}

.auth-btn-chevron {
    display: inline-flex;
    transform: translateX(0);
    transition: transform .15s ease;
}

.auth-btn-primary:hover .auth-btn-chevron {
    transform: translateX(3px);
}

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

.auth-foot-text a {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
}

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

.auth-footer {
    margin-top: 14px;
    text-align: center;
    font-size: 11px;
    color: rgba(148,163,184,.8);
}

.theme-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: opacity .25s ease, color .25s ease;
}

:root[data-theme="night"] .theme-icon.sun {
    opacity: .35;
}

:root[data-theme="day"] .theme-icon.moon {
    opacity: .35;
}

.theme-toggle svg {
    display: block;
}

:root[data-theme="day"] .theme-icon.sun,
:root[data-theme="night"] .theme-icon.moon {
    color: var(--color-accent);
    opacity: .9;
}

@media (max-width: 880px) {
    body {
        margin: 0;
        min-height: 100vh;
        font-family: var(--font-main);
        color: var(--color-text-main);
        background: var(--color-bg-gradient);
        overflow-x: hidden;
    }
    body {
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .auth-body {
        min-height: 100dvh;
        padding: 24px;
    }
    .auth-card {
        grid-template-columns: minmax(0, 1fr);
    }
    .auth-left {
        display: none;
    }
    .auth-right {
        border-radius: var(--radius-xl);
    }
    .auth-shell {
        max-width: 420px;
    }
    #net-bg {
        height: 100dvh;
    }
}

@media (max-width: 540px) {
    .auth-right {
        padding: 22px 18px 24px;
    }
    .auth-body {
        padding: 14px;
        align-items: flex-start;
    }
    .auth-shell {
        margin: 0 auto;
        margin-top: clamp(96px, 23vh, 196px);
    }
    .auth-title {
        font-size: 22px;
    }

    .auth-form-header h2 {
        font-size: 20px;
    }
}

/* =========================
   DAY MODE FIXES
========================= */

:root[data-theme="day"] {

    /* Inputs */
    .auth-input-shell input {
        background: rgba(255,255,255,.92);
        color: #0f172a;
        border: 1px solid rgba(15,23,42,.18);
    }

    .auth-input-shell input::placeholder {
        color: #64748b;
    }

    .auth-input-shell input:focus {
        background: rgba(255,255,255,.98);
        border-color: var(--color-accent);
        box-shadow:
            0 0 0 1px rgba(37,99,235,.35),
            0 10px 30px rgba(37,99,235,.25);
    }

    .auth-input-icon {
        color: #64748b;
        opacity: .85;
    }

    /* Links (Crear acceso / Volver a login) */
    .auth-foot-text a {
        color: #2563eb;
        font-weight: 600;
    }

    .auth-foot-text a:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

    /* Badges */
    .auth-badge {
        background:
            radial-gradient(circle at 0 0, rgba(37,99,235,.15), transparent 60%),
            rgba(241,245,249,.9);
        color: #0f172a;
        border-color: rgba(15,23,42,.15);
    }

    .auth-badge-pill {
        background: rgba(226,232,240,.9);
        color: #334155;
        border-color: rgba(15,23,42,.18);
    }

    /* Métrica (tarjetita inferior) */
    .auth-metric-card {
        background:
            radial-gradient(circle at 0 0, rgba(37,99,235,.18), transparent 60%),
            rgba(248,250,252,.95);
        color: #0f172a;
        border-color: rgba(15,23,42,.18);
        box-shadow:
            0 18px 40px rgba(15,23,42,.18),
            0 0 30px rgba(37,99,235,.25);
    }

    .auth-metric-label {
        color: #64748b;
    }

    /* Botón principal */
    .auth-btn-primary {
        box-shadow:
            0 14px 34px rgba(37,99,235,.45),
            0 0 40px rgba(37,99,235,.35);
    }

    .auth-metric-pill {
        margin-top: 6px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        border-radius: 999px;
        background: rgba(22,163,74,.14);
        color: #00ca47;
        font-size: 11px;
    }

    /* Footer */
    .auth-footer {
        color: #64748b;
    }
}
