/* ══════════════════════════════════════════════════
   VARIABLES & RESET
   ══════════════════════════════════════════════════ */
:root {
    --navy: #0F2347;
    --primary: #1B3A6B;
    --primary-h: #2D5AA0;
    --accent: #0284C7;
    --accent-l: #38BDF8;
    --white: #FFFFFF;
    --bg: #F0F5FB;
    --border: #DDE5EF;
    --text-1: #0F2347;
    --text-2: #4B5E7A;
    --text-3: #8FA3BC;
    --error: #DC2626;
    --error-bg: #FEF2F2;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    overflow: hidden;
}

body.loaded {
    overflow: auto;
}

/* ══════════════════════════════════════════════════
   SPLASH
   ══════════════════════════════════════════════════ */
#splash {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: linear-gradient(150deg, var(--navy) 0%, var(--primary) 55%, #1565C0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform .7s cubic-bezier(.76, 0, .24, 1);
}

#splash.hide {
    transform: translateY(-100%);
}

.sp-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.sp-blob-1 {
    width: 520px;
    height: 520px;
    top: -160px;
    right: -140px;
    background: radial-gradient(circle, rgba(2, 132, 199, .18) 0%, transparent 70%);
    animation: blobPulse 4s ease-in-out infinite;
}

.sp-blob-2 {
    width: 380px;
    height: 380px;
    bottom: -120px;
    left: -100px;
    background: radial-gradient(circle, rgba(56, 189, 248, .12) 0%, transparent 70%);
    animation: blobPulse 6s ease-in-out infinite reverse;
}

.sp-blob-3 {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 65%;
    background: radial-gradient(circle, rgba(255, 255, 255, .06) 0%, transparent 70%);
    animation: blobPulse 3s ease-in-out infinite;
}

.sp-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.sp-icon-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    opacity: 0;
    animation: iconIn .5s cubic-bezier(.34, 1.56, .64, 1) .1s forwards;
}

.sp-ring,
.sp-ring-2 {
    position: absolute;
    border-radius: 50%;
}

.sp-ring {
    inset: 0;
    border: 2px solid rgba(56, 189, 248, .5);
    animation: ringPulse 1.2s ease-in-out 1s infinite;
}

.sp-ring-2 {
    inset: -12px;
    border: 1.5px solid rgba(56, 189, 248, .2);
    animation: ringPulse 1.2s ease-in-out 1.3s infinite;
}

.sp-icon-bg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, .2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}

.sp-icon-bg i {
    font-size: 42px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, .6));
}

.sp-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    letter-spacing: -.03em;
    text-align: center;
    opacity: 0;
    animation: fadeUp .4s ease .6s forwards;
}

.sp-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, .55);
    margin-top: 8px;
    text-align: center;
    letter-spacing: .01em;
    opacity: 0;
    animation: fadeUp .4s ease 1.05s forwards;
}

.sp-progress-wrap {
    position: absolute;
    bottom: 48px;
    width: 200px;
    z-index: 2;
    opacity: 0;
    animation: fadeUp .1s ease 1.1s forwards;
}

.sp-progress-track {
    height: 3px;
    background: rgba(255, 255, 255, .12);
    border-radius: 4px;
    overflow: hidden;
}

.sp-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-l) 100%);
    border-radius: 4px;
    animation: fillBar 2s cubic-bezier(.4, 0, .2, 1) 1.5s forwards;
}

.sp-progress-label {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, .35);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ══════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════ */
#login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

/* ── LEFT PANEL ─────────────────────────────────── */
.lp-left {
    position: relative;
    background: linear-gradient(150deg, var(--navy) 0%, var(--primary) 55%, #1565C0 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 64px;
    overflow: hidden;
}

.lp-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lp-c1 {
    width: 480px;
    height: 480px;
    top: -120px;
    right: -160px;
    background: radial-gradient(circle, rgba(2, 132, 199, .2) 0%, transparent 65%);
}

.lp-c2 {
    width: 340px;
    height: 340px;
    bottom: -80px;
    left: -80px;
    background: radial-gradient(circle, rgba(56, 189, 248, .15) 0%, transparent 65%);
}

.lp-c3 {
    width: 160px;
    height: 160px;
    top: 55%;
    right: 8%;
    border: 1.5px solid rgba(255, 255, 255, .07);
}

.lp-c4 {
    width: 110px;
    height: 110px;
    top: 10%;
    left: 10%;
    border: 1.5px solid rgba(255, 255, 255, .06);
}

.lp-c5 {
    width: 40px;
    height: 40px;
    bottom: 26%;
    right: 18%;
    background: rgba(56, 189, 248, .12);
}

.lp-c6 {
    width: 25px;
    height: 25px;
    top: 20%;
    left: 16%;
    background: rgba(56, 189, 248, .12);
}

.lp-pt {
    position: absolute;
    left: var(--px);
    top: var(--py);
    width: var(--ps);
    height: var(--ps);
    border-radius: 50%;
    background: rgba(56, 189, 248, .5);
    box-shadow: 0 0 8px rgba(56, 189, 248, .4);
    animation: particleFloat 4s ease-in-out var(--pd) infinite;
    pointer-events: none;
    z-index: 1;
}

.lp-content {
    position: relative;
    z-index: 2;
}

.lp-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 60px;
}

.lp-brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, .1);
    border: 1.5px solid rgba(255, 255, 255, .18);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: white;
}

.lp-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.lp-brand-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, .45);
    margin-top: 1px;
}

.lp-headline {
    font-size: 38px;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    letter-spacing: -.03em;
    margin-bottom: 16px;
}

.lp-headline span {
    color: var(--accent-l);
}

.lp-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, .55);
    line-height: 1.7;
    max-width: 380px;
}

/* ── RIGHT PANEL ────────────────────────────────── */
.lp-right {
    position: relative;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

/* Logo posicionado en la parte superior, separado del form */
.logo {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo svg {
    max-width: 280px;
    height: auto;
}

.login-card {
    width: 100%;
    max-width: 400px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}

.login-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.lc-top {
    text-align: center;
    margin-bottom: 36px;
}

.lc-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(27, 58, 107, .3);
}

.lc-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -.03em;
    margin-bottom: 6px;
}

.lc-sub {
    font-size: 13.5px;
    color: var(--text-2);
}

/* ── FORM ───────────────────────────────────────── */
.lc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: .01em;
}

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

.input-ico {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-3);
    pointer-events: none;
    transition: color .2s;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-1);
    background: var(--white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.input-wrap input::placeholder {
    color: var(--text-3);
}

.input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .12);
}

.input-wrap:focus-within .input-ico {
    color: var(--accent);
}

.btn-eye {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: color .2s;
}

.btn-eye:hover {
    color: var(--accent);
}

.input-wrap.has-error input {
    border-color: var(--error);
}

.input-wrap.has-error input:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.field-error {
    font-size: 12px;
    color: var(--error);
    display: none;
    align-items: center;
    gap: 4px;
}

.field-error.show {
    display: flex;
}

/* ── RECUÉRDAME ─────────────────────────────────── */
.chk-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-2);
    margin-top: -6px;
}

.chk-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── BUTTON ─────────────────────────────────────── */
.btn-login {
    width: 100%;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(27, 58, 107, .25);
    margin-top: 4px;
    letter-spacing: .01em;
}

.btn-login:hover {
    background: var(--primary-h);
    box-shadow: 0 6px 20px rgba(27, 58, 107, .35);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-login.loading .btn-spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

/* ── ALERT & FOOTER ─────────────────────────────── */
.lc-alert {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--error-bg);
    border: 1px solid #FECACA;
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--error);
}

.lc-alert.show {
    display: flex;
}

.lc-alert i {
    font-size: 15px;
    flex-shrink: 0;
}

.lc-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 11.5px;
    color: var(--text-3);
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes blobPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

@keyframes ringPulse {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes iconIn {
    from { opacity: 0; transform: scale(.4) rotate(-20deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fillBar {
    from { width: 0%; }
    to   { width: 100%; }
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0)     scale(1);   opacity: .4; }
    50%      { transform: translateY(-14px) scale(1.3); opacity: .9; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}

.login-card.shake {
    animation: shake .4s ease;
}

/* Campo usuario siempre en mayúsculas */
#inp-user {
    text-transform: uppercase;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    #login-page {
        grid-template-columns: 1fr;
    }

    .lp-left {
        display: none;
    }

    .lp-right {
        padding: 120px 24px 40px;
        min-height: 100vh;
        justify-content: center;
    }

    .logo {
        top: 30px;
    }

    .logo svg {
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .login-card {
        max-width: 100%;
    }

    .lc-title {
        font-size: 22px;
    }

    .logo svg {
        max-width: 180px;
    }

    .lp-right {
        padding-top: 100px;
        justify-content: center;
    }
}
