/* ══════════════════════════════════════════════════════════════
   PREVISIO — Estilos compartidos de autenticación (login / registro)
   Alineado con el sistema visual de index.html
   ══════════════════════════════════════════════════════════════ */

:root {
    --primary:        #0B132B;
    --primary-card:   #151F38;
    --primary-light:  #1C2541;
    --accent:        #185abc;
    --accent-rgb:    24, 90, 188;
    --accent-hover:  #124a9e;
    --accent-dark:   #0e3a7d;
    --accent-light:  #edf3fc;
    --accent-border: #b8cdee;
    --accent-soft:   #4a82d4;
    --section-bg:     #ededed;
    --section-border: #d9d9d9;
    --section-text:   #1f2937;
    --section-muted:  #5b6472;
    --accent-active:  var(--accent-dark);
    --accent-ring:    rgba(var(--accent-rgb), 0.18);
    --success:        #059669;
    --danger:         #DC2626;
    --bg:             #F8FAFC;
    --surface:        #FFFFFF;
    --border:         #E2E8F0;
    --border-strong:  #CBD5E1;
    --text:           #0F172A;
    --text-secondary: #334155;
    --text-muted:     #64748B;
    --text-light:     #94A3B8;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Logo (idéntico al de la landing) ── */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #FFFFFF;
    text-transform: uppercase;
    text-decoration: none;
}
.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
    color: #FFFFFF;
    flex-shrink: 0;
}

/* Sobre el panel azul de marca el ícono va en blanco para no perderse */
.auth-brand .logo-icon {
    background: #FFFFFF;
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* ══ Panel izquierdo: marca ══ */
.auth-brand {
    background: linear-gradient(160deg, var(--accent-dark) 0%, var(--accent-hover) 55%, var(--accent) 100%);
    padding: 44px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    overflow: hidden;
    color: #FFFFFF;
    min-height: 100vh;
}
.auth-brand::before {
    content: '';
    position: absolute;
    top: -25%;
    right: -30%;
    width: 760px;
    height: 760px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22) 0%, rgba(var(--accent-rgb), 0.04) 45%, transparent 70%);
    pointer-events: none;
}
.auth-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}
.brand-top, .brand-middle, .brand-bottom { position: relative; z-index: 1; }

.brand-middle {
    max-width: 480px;
}

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--accent-border);
    margin-bottom: 22px;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.brand-headline {
    font-size: clamp(26px, 2.6vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.8px;
    margin-bottom: 14px;
}
.brand-headline .highlight {
    background: linear-gradient(90deg, #ffffff, #cfe0f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
    margin-bottom: 32px;
}

.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #CBD5E1;
    line-height: 1.45;
}
.feat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.brand-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-trust {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}
.brand-trust svg { color: #10B981; flex-shrink: 0; }
.brand-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color .15s;
}
.brand-back:hover { color: #FFFFFF; }

/* ══ Panel derecho: formulario ══ */
.auth-form-panel {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    position: relative;
}

/* Barra superior móvil (logo + volver) — oculta en escritorio */
.auth-mobile-bar { display: none; }

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.10), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
    animation: cardIn .35s ease-out both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.form-heading {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.6px;
}
.form-subheading {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 28px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}
.form-field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    transition: color .15s;
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.form-field input {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    padding: 0 14px 0 42px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    font-family: inherit;
    width: 100%;
    height: 46px;
}
.form-field input:hover { border-color: #94A3B8; }
.form-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}
.form-field input:focus-visible { outline: none; }
.form-field input::placeholder { color: var(--text-light); }
.form-field input.has-toggle { padding-right: 46px; }

.btn-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}
.btn-eye:hover { color: var(--accent); background: var(--accent-light); }

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.form-forgot {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.form-forgot:hover { text-decoration: underline; }

/* ── Botón principal ── */
.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--accent);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.45);
}
.btn-primary:active:not(:disabled) { background: var(--accent-active); transform: none; }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-primary.is-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mensajes ── */
.form-error, .form-success {
    display: none;
    border-radius: var(--radius-sm);
    padding: 12px 14px 12px 40px;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 20px;
    position: relative;
    background-repeat: no-repeat;
    background-position: 14px 13px;
    background-size: 16px 16px;
}
.form-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}
.form-error a { color: #991B1B; font-weight: 700; }
.form-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
}
.form-success a { color: #065F46; font-weight: 700; }

/* ── Separador y link alternativo ── */
.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 18px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}
.form-divider::before, .form-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border);
}
.form-link {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.form-link a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}
.form-link a:hover { text-decoration: underline; }

.form-footnote {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* ══ Responsive ══ */
@media (max-width: 960px) {
    .auth-brand { padding: 40px 36px; }
    .brand-features li:nth-child(n+4) { display: none; }
}

@media (max-width: 820px) {
    body { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form-panel {
        justify-content: flex-start;
        padding: 0 16px 40px;
        min-height: 100vh;
    }
    .auth-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: calc(100% + 32px);
        margin: 0 -16px 28px;
        padding: 14px 16px;
        background: var(--section-bg);
        border-bottom: 1px solid var(--section-border);
    }
    .auth-mobile-bar .brand-logo { font-size: 15px; gap: 10px; color: var(--accent); }
    .auth-mobile-bar .logo-icon { width: 32px; height: 32px; }
    .auth-mobile-bar .brand-back { font-size: 13px; color: var(--section-muted); }
    .auth-mobile-bar .brand-back:hover { color: var(--accent); }
}

@media (max-width: 480px) {
    .auth-form-inner {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }
    .form-heading { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
