/* ============================================
   LOGIN — Refined Financial
   Layout: split panel (navy | white form)
   Palette: cream · navy · gold
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Outfit:wght@300;400;500;600&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy:       #1a2744;
    --navy-deep:  #111c33;
    --navy-light: #2c3e6b;
    --gold:       #b8913a;
    --gold-light: #d4aa55;
    --cream:      #f5f2eb;
    --border:     #ddd8cf;
    --text:       #1c1a17;
    --muted:      #8a8278;
    --error-bg:   #fdf0ef;
    --error-bd:   rgba(192,57,43,.25);
    --error-txt:  #c0392b;
}

html, body {
    height: 100%;
    font-family: 'Outfit', system-ui, sans-serif;
}

body {
    display: flex;
    min-height: 100vh;
    background: var(--cream);
}

/* ── Layout split ── */
.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Panel izquierdo (marca) ── */
.login-brand-panel {
    flex: 0 0 42%;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    position: relative;
    overflow: hidden;
}

/* Patrón de cuadrícula sutil */
.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Mancha dorada decorativa */
.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(184,145,58,.18) 0%, transparent 70%);
    pointer-events: none;
}

.brand-top {
    position: relative;
    z-index: 1;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 64px;
}

.brand-monogram {
    width: 44px; height: 44px;
    background: var(--gold);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--navy);
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.7rem;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 400;
    margin-top: 2px;
}

.brand-headline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.brand-headline em {
    font-style: italic;
    color: var(--gold-light);
}

.brand-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,.45);
    line-height: 1.75;
    font-weight: 300;
    max-width: 340px;
}

/* Estadísticas */
.brand-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 28px;
}

.stat-item {
    flex: 1;
    padding-right: 24px;
}

.stat-item + .stat-item {
    padding-left: 24px;
    padding-right: 0;
    border-left: 1px solid rgba(255,255,255,.1);
}

.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--gold-light);
    line-height: 1;
    display: block;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

/* ── Panel derecho (formulario) ── */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* Logo (en caso de no haber panel de marca visible en móvil) */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-main {
    max-width: 160px;
    height: auto;
}

/* Título del formulario */
.welcome-text {
    margin-bottom: 32px;
}

.welcome-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    line-height: 1.15;
}

.welcome-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 300;
}

/* Divisor dorado */
.title-divider {
    width: 36px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    margin: 12px 0 0;
}

/* Alertas */
.alert-container { margin-bottom: 20px; }

.alert-custom {
    background: var(--error-bg);
    border: 1px solid var(--error-bd);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.84rem;
    animation: slideIn .3s ease;
}

.alert-custom strong { color: var(--error-txt); font-weight: 500; }

.alert-close {
    background: none; border: none;
    color: var(--muted);
    cursor: pointer; padding: 2px;
    display: flex; align-items: center;
    transition: color .15s;
}
.alert-close:hover { color: var(--error-txt); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Campos */
.form-signin { width: 100%; }

.login-field { margin-bottom: 18px; }

.input-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 7px;
}

.input-field {
    width: 100%;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: var(--cream);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-field::placeholder { color: #bbb5ab; }

.input-field:hover { border-color: #c4bdb2; }

.input-field:focus {
    border-color: var(--navy);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,39,68,.07);
}

/* Password toggle */
.password-wrapper { position: relative; }

.password-wrapper .input-field { padding-right: 48px !important; }

/* Ocultar el botón nativo del navegador para revelar contraseña (Edge/Chrome en Windows) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--muted);
    cursor: pointer; padding: 4px;
    display: flex; align-items: center;
    transition: color .15s;
}
.password-toggle:hover { color: var(--navy); }

/* Opciones */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.checkbox-custom {
    width: 17px; height: 17px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    appearance: none; cursor: pointer;
    transition: all .2s; position: relative;
    flex-shrink: 0;
}
.checkbox-custom:checked { background: var(--navy); border-color: var(--navy); }
.checkbox-custom:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-label { font-size: 0.84rem; color: var(--muted); user-select: none; }

.forgot-link {
    font-size: 0.84rem;
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
}
.forgot-link:hover { color: var(--gold); }

/* Botón principal */
.btn-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    background: var(--navy);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(26,39,68,.2);
}
.btn-submit:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26,39,68,.28);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit.loading { pointer-events: none; opacity: .75; }

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 12px;
}
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* Google */
.social-buttons { display: flex; flex-direction: column; gap: 10px; }

.btn-social {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 20px;
    font-size: 0.9rem; font-weight: 500;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
    border-radius: 8px;
    transition: all .2s; cursor: pointer;
}

.btn-google {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-google:hover {
    border-color: #c4bdb2;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transform: translateY(-1px);
}

/* Pie */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.security-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72rem; color: var(--muted);
}
.security-badge svg { width: 12px; height: 12px; }

/* Elementos decorativos ocultos (mantener HTML compatible) */
.decoration { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .login-brand-panel { display: none; }
    .login-form-panel { padding: 40px 24px; }
    .login-container { display: block; }
    .login-form-panel { min-height: 100vh; }
}

/* ── Página de "recordar" y similares ── */
.page-icon { display: flex; justify-content: center; margin-bottom: 16px; }
.page-icon svg { color: var(--gold); }

.back-link { text-align: center; margin-top: 20px; }
.back-link .forgot-link { display: inline-flex; align-items: center; gap: 6px; }