/* ==========================================
   FINANZAS PRO - ESTILOS DE AUTENTICACIÓN
   v1.1 - Fix ojito + tema claro/oscuro + mobile
   ========================================== */

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

/* === VARIABLES (ambos temas) === */
:root[data-tema="oscuro"],
:root {
    --auth-bg-1: #0a0e1a;
    --auth-bg-2: #131829;
    --auth-bg-3: #1a2138;
    --auth-card-bg: rgba(26, 33, 56, 0.8);
    --auth-card-border: #2d3552;
    --auth-input-bg: rgba(10, 14, 26, 0.6);
    --auth-input-bg-focus: rgba(10, 14, 26, 0.9);
    --auth-input-border: #2d3552;
    --auth-texto: #f1f5f9;
    --auth-texto-suave: #94a3b8;
    --auth-texto-tenue: #64748b;
    --auth-acento: #10b981;
    --auth-acento-hover: #34d399;
    --auth-error-bg: rgba(239, 68, 68, 0.1);
    --auth-error-border: rgba(239, 68, 68, 0.3);
    --auth-error-texto: #f87171;
    --auth-exito-bg: rgba(16, 185, 129, 0.1);
    --auth-exito-border: rgba(16, 185, 129, 0.3);
    --auth-exito-texto: #34d399;
}

:root[data-tema="claro"] {
    --auth-bg-1: #f0f4f8;
    --auth-bg-2: #e2e8f0;
    --auth-bg-3: #cbd5e1;
    --auth-card-bg: rgba(255, 255, 255, 0.95);
    --auth-card-border: #e2e8f0;
    --auth-input-bg: #ffffff;
    --auth-input-bg-focus: #ffffff;
    --auth-input-border: #cbd5e1;
    --auth-texto: #0f172a;
    --auth-texto-suave: #475569;
    --auth-texto-tenue: #94a3b8;
    --auth-acento: #059669;
    --auth-acento-hover: #10b981;
    --auth-error-bg: rgba(239, 68, 68, 0.08);
    --auth-error-border: rgba(239, 68, 68, 0.25);
    --auth-error-texto: #dc2626;
    --auth-exito-bg: rgba(16, 185, 129, 0.08);
    --auth-exito-border: rgba(16, 185, 129, 0.25);
    --auth-exito-texto: #059669;
}

.auth-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 50%, var(--auth-bg-3) 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Mejor soporte móvil con barra del navegador */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--auth-texto);
    position: relative;
    transition: background 0.3s ease;
}

/* === Switch tema flotante === */
.tema-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    color: var(--auth-texto);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.tema-switch:hover {
    transform: scale(1.05);
    border-color: var(--auth-acento);
}

.auth-container {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--auth-card-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.auth-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--auth-acento) 0%, var(--auth-acento-hover) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.auth-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--auth-texto);
}

.auth-subtitulo {
    text-align: center;
    color: var(--auth-texto-suave);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.campo {
    margin-bottom: 1.25rem;
}

.campo-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.campo label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--auth-texto);
}

/* === FIX ICONO Y OJITO === */
.campo-input {
    position: relative;
    display: block; /* CAMBIADO de flex a block para evitar problemas de alineación */
    width: 100%;
}

/* Icono izquierdo (sobre = email, lock = password, etc.) */
.campo-input > i:first-child {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-texto-tenue);
    pointer-events: none;
    z-index: 2;
    font-size: 1rem;
    line-height: 1;
}

/* Inputs y selects */
.campo-input input,
.campo-input select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 10px;
    color: var(--auth-texto);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    line-height: 1.4;
    height: 48px; /* Altura fija para alineación perfecta del ojito */
}

/* Cuando hay ojito, el input necesita padding derecho */
.campo-input input[type="password"],
.campo-input.con-ojito input {
    padding-right: 3rem;
}

.campo-input input:focus,
.campo-input select:focus {
    outline: none;
    border-color: var(--auth-acento);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: var(--auth-input-bg-focus);
}

/* === BOTÓN OJITO BIEN POSICIONADO === */
.boton-toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--auth-texto-tenue);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    z-index: 3;
    transition: color 0.2s, background 0.2s;
}

.boton-toggle-password:hover {
    color: var(--auth-texto);
    background: rgba(148, 163, 184, 0.1);
}

.boton-toggle-password i {
    font-size: 1rem;
}

/* === FORMULARIO === */
.campo-grupo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.campo-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.campo-checkbox input {
    width: auto;
    cursor: pointer;
    accent-color: var(--auth-acento);
}

.campo-checkbox label {
    margin-bottom: 0;
    cursor: pointer;
    color: var(--auth-texto-suave);
    user-select: none;
}

.campo-ayuda {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--auth-texto-tenue);
}

/* === BOTONES === */
.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    min-height: 48px; /* Touch-friendly */
}

.boton-primario {
    background: linear-gradient(135deg, var(--auth-acento) 0%, var(--auth-acento-hover) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.boton-primario:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.boton-primario:active {
    transform: translateY(0);
}

.boton-completo {
    width: 100%;
    justify-content: center;
}

/* === ALERTAS === */
.alerta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alerta-error {
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-texto);
}

.alerta-exito {
    background: var(--auth-exito-bg);
    border: 1px solid var(--auth-exito-border);
    color: var(--auth-exito-texto);
}

.auth-pie {
    text-align: center;
    color: var(--auth-texto-suave);
    font-size: 0.9rem;
}

.auth-pie a,
.link-pequeño,
.link-fuerte {
    color: var(--auth-acento);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-pie a:hover,
.link-pequeño:hover,
.link-fuerte:hover {
    color: var(--auth-acento-hover);
    text-decoration: underline;
}

.link-pequeño {
    font-size: 0.8rem;
}

.link-fuerte {
    margin-left: auto;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--auth-texto-tenue);
    font-size: 0.8rem;
}

/* === RESPONSIVE MOBILE-FIRST === */
@media (max-width: 480px) {
    .auth-body {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .auth-titulo {
        font-size: 1.5rem;
    }
    
    .auth-subtitulo {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .campo-grupo {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .campo-input input,
    .campo-input select {
        font-size: 16px; /* Evita zoom automático en iOS */
    }
    
    .tema-switch {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding: 1.25rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SPLIT-SCREEN LOGIN — solo login.php usa auth-split-body
   Todas las clases auth-* existentes siguen funcionando
   ═══════════════════════════════════════════════════════════ */

body.auth-split-body {
    padding: 0;
    align-items: stretch;
    background: none;
    flex-direction: row;
    min-height: 100vh;
}

/* ── Panel izquierdo: formulario ───────────────────────────── */
.split-form-panel {
    flex: 0 0 420px;
    width: 420px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: var(--auth-card-bg);
    border-right: 1px solid var(--auth-card-border);
    position: relative;
    overflow-y: auto;
    transition: background .3s, border-color .3s;
}

.split-form-inner {
    width: 100%;
    max-width: 340px;
}

/* Logo compacto en forma de fila */
.split-logo-wrap {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 2rem;
}

.split-logo-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--auth-acento), var(--auth-acento-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #000;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(16,185,129,.25);
}

.split-app-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--auth-texto);
    display: block;
    letter-spacing: -.01em;
}

.split-app-tag {
    font-size: .68rem;
    color: var(--auth-texto-tenue);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: block;
    margin-top: .05rem;
}

/* Botón tema dentro del panel form */
.tema-switch-split {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid var(--auth-card-border);
    color: var(--auth-texto-suave);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all .2s;
    z-index: 10;
}

.tema-switch-split:hover {
    border-color: var(--auth-acento);
    color: var(--auth-acento);
    background: rgba(16,185,129,.08);
}

.split-register-row {
    text-align: center;
    font-size: .875rem;
    color: var(--auth-texto-suave);
    margin-top: 1.5rem;
}

.split-register-row a {
    color: var(--auth-acento);
    font-weight: 700;
    text-decoration: none;
    margin-left: .25rem;
    transition: color .2s;
}

.split-register-row a:hover {
    color: var(--auth-acento-hover);
    text-decoration: underline;
}

.split-copyright {
    text-align: center;
    font-size: .7rem;
    color: var(--auth-texto-tenue);
    margin-top: 2rem;
}

/* ── Panel derecho: hero financiero (SIEMPRE oscuro) ────────── */
.split-hero-panel {
    flex: 1;
    min-height: 100vh;
    background: #060c18;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 3rem;
}

/* Dot grid */
.split-hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1.5px 1.5px, rgba(74,222,128,.09) 1.5px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Glow superior derecho */
.split-hero-panel::after {
    content: '';
    position: absolute;
    top: -15%;
    right: -8%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(16,185,129,.09) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

/* Glow inferior izquierdo */
.split-hero-panel .split-hero-inner::before {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
    pointer-events: none;
}

/* SVG de líneas de gráfica (posición absoluta abajo) */
.hero-chart-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 0;
    pointer-events: none;
}

.split-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
}

/* Badge "100% Seguro" */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.22);
    color: #4ade80;
    font-size: .7rem;
    font-weight: 700;
    padding: .3rem .85rem;
    border-radius: 999px;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 1.35rem;
}

.hero-titulo {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.12;
    color: #f1f5f9;
    margin-bottom: .9rem;
    letter-spacing: -.025em;
}

.hero-subtitulo {
    font-size: .9rem;
    color: #4b607c;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 440px;
}

/* Features */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-bottom: 2.75rem;
}

.hero-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.hero-feature-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: .1rem;
}

.hero-feature h3 {
    font-size: .9rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 .25rem;
    line-height: 1.3;
}

.hero-feature p {
    font-size: .8rem;
    color: #4b607c;
    line-height: 1.55;
    margin: 0;
}

/* App Store Buttons */
.hero-stores {
    margin-bottom: 2.5rem;
}

.hero-stores-label {
    font-size: .68rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .85rem;
}

.hero-store-btns {
    display: flex;
    gap: .85rem;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 12px;
    padding: .7rem 1.2rem;
    color: #f1f5f9;
    text-decoration: none;
    transition: background .2s, border-color .2s, transform .15s;
    min-width: 158px;
    cursor: pointer;
}

.store-btn:hover {
    background: rgba(255,255,255,.09);
    border-color: rgba(74,222,128,.4);
    transform: translateY(-2px);
    color: #f1f5f9;
}

.store-btn-ico {
    font-size: 1.65rem;
    line-height: 1;
    opacity: .9;
}

.store-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.store-btn-sub {
    font-size: .62rem;
    color: #64748b;
    letter-spacing: .02em;
}

.store-btn-main {
    font-size: .9rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -.01em;
}

/* Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.hero-stat-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: #4ade80;
    line-height: 1.1;
}

.hero-stat-label {
    font-size: .67rem;
    color: #334155;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hero-stat-sep {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,.07);
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
    body.auth-split-body { flex-direction: column; }

    .split-form-panel {
        flex: none;
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--auth-card-border);
        padding: 2.5rem 1.5rem;
    }

    .split-hero-panel {
        min-height: 400px;
        padding: 2.5rem 1.75rem;
    }

    .hero-titulo { font-size: 2rem; }

    .hero-feature p { display: none; }
}

@media (max-width: 640px) {
    .split-form-panel { padding: 2rem 1.25rem; }
    .split-form-inner { max-width: 100%; }

    .split-hero-panel { padding: 2rem 1.25rem; min-height: auto; }
    .hero-titulo { font-size: 1.65rem; }
    .hero-subtitulo { display: none; }
    .hero-features { gap: .9rem; margin-bottom: 1.75rem; }
    .hero-feature p { display: none; }
    .hero-stores { margin-bottom: 1.75rem; }
    .store-btn { min-width: 145px; padding: .6rem 1rem; }
    .store-btn-ico { font-size: 1.4rem; }
    .hero-stats { gap: 1rem; padding-top: 1.25rem; }
}

@media (max-width: 400px) {
    .hero-store-btns { gap: .6rem; }
    .store-btn { min-width: 130px; }
    .hero-stats { display: none; }
}

/* ── Extras para register ──────────────────────────────── */

/* Asterisco requerido */
.req {
    color: #f87171;
    margin-left: .15rem;
    font-style: normal;
}

/* Medidor de fuerza de contraseña */
.pwd-fuerza-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .45rem;
}

.pwd-fuerza-barra {
    flex: 1;
    height: 4px;
    background: rgba(148,163,184,.15);
    border-radius: 999px;
    overflow: hidden;
}

.pwd-fuerza-relleno {
    height: 100%;
    border-radius: 999px;
    transition: width .3s ease, background .3s ease;
    width: 0%;
}

.pwd-fuerza-label {
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* Texto de términos bajo el botón */
.reg-terminos {
    font-size: .7rem;
    color: var(--auth-texto-tenue);
    text-align: center;
    margin-top: .85rem;
    line-height: 1.5;
}

/* Ajuste campo-grupo en register (más campos, scroll) */
.split-form-panel .campo-grupo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

@media (max-width: 480px) {
    .split-form-panel .campo-grupo {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
