/* ═══════════════════════════════════════════════
   SGI Login  |  Tema profesional · navy / blanco
════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────── */
:root {
    --c-navy-950:  #080F1A;
    --c-navy-900:  #0D1B2A;
    --c-navy-700:  #1A3552;
    --c-blue-500:  #2563EB;
    --c-gray-50:   #F8FAFC;
    --c-gray-100:  #F1F5F9;
    --c-gray-200:  #E2E8F0;
    --c-gray-300:  #CBD5E1;
    --c-gray-400:  #94A3B8;
    --c-gray-500:  #64748B;
    --c-gray-900:  #0F172A;
    --c-white:     #FFFFFF;
    --c-red-50:    #FEF2F2;
    --c-red-200:   #FECACA;
    --c-red-700:   #B91C1C;
    --c-green-50:  #F0FDF4;
    --c-green-200: #BBF7D0;
    --c-green-600: #16A34A;
    --radius:      8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background: var(--c-gray-100);
    display: flex;
}

/* ── Layout principal ───────────────────────── */
.page {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ══════════════════════════════════════════════
   PANEL IZQUIERDO — Marca / Navy
══════════════════════════════════════════════ */
.panel-brand {
    flex: 0 0 44%;
    background: var(--c-navy-900);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 52px 56px;
}

/* Cuadrícula sutil */
.panel-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Anillos decorativos */
.panel-brand__deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.deco-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .06);
}

.deco-ring--lg {
    width: 460px;
    height: 460px;
    bottom: -150px;
    right: -150px;
}

.deco-ring--sm {
    width: 250px;
    height: 250px;
    top: -80px;
    left: -65px;
    border-color: rgba(37, 99, 235, .18);
}

/* Contenido */
.panel-brand__body {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.brand-eyebrow {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.2px;
    color: rgba(255, 255, 255, .38);
    margin-bottom: 22px;
}

.brand-headline {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--c-white);
    line-height: 1.18;
    letter-spacing: -.5px;
    margin-bottom: 28px;
}

.brand-rule {
    display: block;
    width: 40px;
    height: 3px;
    background: var(--c-blue-500);
    border-radius: 2px;
    margin-bottom: 22px;
}

.brand-copy {
    font-size: .875rem;
    color: rgba(255, 255, 255, .4);
    line-height: 1.8;
    max-width: 290px;
}

.panel-brand__footer {
    position: relative;
    z-index: 1;
    font-size: .72rem;
    color: rgba(255, 255, 255, .22);
    letter-spacing: .3px;
}

/* ══════════════════════════════════════════════
   PANEL DERECHO — Formulario / Blanco
══════════════════════════════════════════════ */
.panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-white);
    padding: 48px 32px;
}

.form-box {
    width: 100%;
    max-width: 400px;
    animation: fadeUp .3s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabecera del formulario */
.form-box__header {
    margin-bottom: 34px;
}

.form-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    object-position: left;
    display: block;
    margin-bottom: 28px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-gray-900);
    letter-spacing: -.35px;
    margin-bottom: 6px;
}

.form-hint {
    font-size: .865rem;
    color: var(--c-gray-400);
}

/* Alerta */
.form-alert {
    display: none;
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: .835rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
}

.form-alert--error {
    background: var(--c-red-50);
    border: 1px solid var(--c-red-200);
    color: var(--c-red-700);
}

.form-alert--success {
    background: var(--c-green-50);
    border: 1px solid var(--c-green-200);
    color: var(--c-green-600);
}

/* ── Campos ─────────────────────────────────── */
.field {
    margin-bottom: 18px;
}

.field__label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--c-gray-500);
    margin-bottom: 7px;
}

.field__wrap {
    position: relative;
}

.field__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--c-gray-300);
    pointer-events: none;
    flex-shrink: 0;
}

.field__input {
    display: block;
    width: 100%;
    padding: 11px 44px;
    border: 1.5px solid var(--c-gray-200);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    color: var(--c-gray-900);
    background: var(--c-gray-50);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    -webkit-appearance: none;
}

.field__input::placeholder {
    color: var(--c-gray-300);
}

.field__input:focus {
    border-color: var(--c-blue-500);
    background: var(--c-white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}

.field__input.is-invalid {
    border-color: var(--c-red-700);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .08);
}

/* Botón mostrar contraseña */
.btn-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--c-gray-300);
    transition: color .18s;
}

.btn-eye:hover {
    color: var(--c-gray-500);
}

.btn-eye svg {
    width: 18px;
    height: 18px;
}

/* ── Botón principal ─────────────────────────── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    background: var(--c-navy-900);
    border: none;
    border-radius: var(--radius);
    color: var(--c-white);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .15px;
    cursor: pointer;
    transition: background .18s, transform .12s, box-shadow .18s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--c-navy-700);
    box-shadow: 0 4px 18px rgba(13, 27, 42, .22);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-primary.is-success {
    background: var(--c-green-600);
}

/* Spinner CSS puro */
.btn-primary__spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: var(--c-white);
    border-radius: 50%;
    animation: spin .65s linear infinite;
    flex-shrink: 0;
}

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

/* Pie del formulario */
.form-box__footer {
    margin-top: 32px;
    font-size: .72rem;
    color: var(--c-gray-300);
    text-align: center;
    line-height: 1.7;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 860px) {
    .page {
        flex-direction: column;
    }

    .panel-brand {
        flex: none;
        padding: 40px 32px 36px;
    }

    .brand-headline {
        font-size: 1.7rem;
    }

    .brand-copy {
        display: none;
    }

    .panel-form {
        padding: 44px 24px 52px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .panel-brand {
        padding: 32px 24px 28px;
    }

    .panel-form {
        padding: 36px 20px 44px;
    }

    .form-title {
        font-size: 1.35rem;
    }

    .brand-headline {
        font-size: 1.45rem;
    }
}
