/* ═══════════════════════════════════════════════
   SGI Login  |  Rediseño moderno · navy / aurora / glass
════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────── */
:root {
    --c-navy-950:  #060D17;
    --c-navy-900:  #0B1826;
    --c-navy-800:  #102338;
    --c-navy-700:  #16324D;
    --c-blue-400:  #5B9CFF;
    --c-blue-500:  #2563EB;
    --c-blue-600:  #1D4ED8;
    --c-cyan-400:  #56D6D0;
    --c-violet-400: #9B8CFB;
    --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:      12px;
}

/* ── 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-50);
    display: flex;
}

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

/* ══════════════════════════════════════════════
   PANEL IZQUIERDO — Marca / Aurora navy
══════════════════════════════════════════════ */
.panel-brand {
    flex: 0 0 46%;
    background:
        radial-gradient(900px 620px at 8% -10%, rgba(91, 156, 255, .22), transparent 55%),
        radial-gradient(700px 560px at 105% 15%, rgba(155, 140, 251, .16), transparent 55%),
        radial-gradient(640px 520px at -5% 108%, rgba(86, 214, 208, .14), transparent 55%),
        linear-gradient(165deg, var(--c-navy-950) 0%, var(--c-navy-900) 45%, var(--c-navy-800) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 56px 58px;
}

/* Malla de puntos muy fina, reemplaza la cuadrícula de líneas */
.panel-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(circle at 30% 30%, black, transparent 75%);
            mask-image: radial-gradient(circle at 30% 30%, black, transparent 75%);
    pointer-events: none;
}

/* Anillos decorativos — ahora con brillo animado */
.panel-brand__deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

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

.deco-ring--lg {
    width: 480px;
    height: 480px;
    bottom: -160px;
    right: -140px;
    border-color: rgba(86, 214, 208, .14);
    animation: sgi-ring-spin 46s linear infinite;
}

.deco-ring--lg::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, .06);
}

.deco-ring--sm {
    width: 260px;
    height: 260px;
    top: -70px;
    left: -70px;
    border-color: rgba(91, 156, 255, .24);
    box-shadow: 0 0 60px rgba(91, 156, 255, .08);
    animation: sgi-ring-pulse 5s ease-in-out infinite;
}

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

@keyframes sgi-ring-pulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.04); }
}

/* Punto de luz flotante extra, look "aurora" */
.panel-brand::before {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    left: 55%;
    top: 8%;
    background: radial-gradient(circle, rgba(91, 156, 255, .16), transparent 68%);
    filter: blur(6px);
    pointer-events: none;
    animation: sgi-drift 14s ease-in-out infinite;
}

@keyframes sgi-drift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-22px, 26px); }
}

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

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.2px;
    color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    margin-bottom: 26px;
}

.brand-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-cyan-400);
    box-shadow: 0 0 10px 2px rgba(86, 214, 208, .7);
    flex-shrink: 0;
}

.brand-headline {
    font-size: 2.35rem;
    font-weight: 800;
    color: var(--c-white);
    line-height: 1.16;
    letter-spacing: -.8px;
    margin-bottom: 28px;
    background: linear-gradient(100deg, #FFFFFF 40%, #BFD7FF 75%, #9DC8FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-rule {
    display: block;
    width: 46px;
    height: 3px;
    background: linear-gradient(90deg, var(--c-blue-400), var(--c-cyan-400));
    border-radius: 2px;
    margin-bottom: 22px;
    box-shadow: 0 0 14px rgba(91, 156, 255, .5);
}

.brand-copy {
    font-size: .9rem;
    color: rgba(255, 255, 255, .5);
    line-height: 1.8;
    max-width: 300px;
}

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

/* ══════════════════════════════════════════════
   PANEL DERECHO — Formulario / Glass card
══════════════════════════════════════════════ */
.panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(560px 420px at 85% 12%, rgba(37, 99, 235, .05), transparent 60%),
        radial-gradient(480px 380px at 8% 90%, rgba(86, 214, 208, .05), transparent 60%),
        var(--c-white);
    padding: 48px 32px;
    position: relative;
}

.form-box {
    width: 100%;
    max-width: 404px;
    animation: fadeUp .45s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--c-white);
    border: 1px solid var(--c-gray-200);
    border-radius: 20px;
    padding: 40px 38px 34px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 24px 48px -20px rgba(15, 23, 42, .16);
}

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

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

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

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

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

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

/* Alerta */
.form-alert {
    display: none;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
    animation: fadeUp .25s ease both;
}

.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: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--c-gray-300);
    pointer-events: none;
    flex-shrink: 0;
    transition: color .18s;
}

.field__wrap:focus-within .field__icon {
    color: var(--c-blue-500);
}

.field__input {
    display: block;
    width: 100%;
    padding: 12px 44px;
    border: 1.5px solid var(--c-gray-200);
    border-radius: 10px;
    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:hover {
    border-color: var(--c-gray-300);
}

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

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

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

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

.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: 13px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--c-navy-800) 0%, var(--c-navy-900) 55%, #081120 100%);
    border: none;
    border-radius: 10px;
    color: var(--c-white);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .15s, box-shadow .2s;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-blue-600), var(--c-blue-400));
    opacity: 0;
    transition: opacity .22s;
}

.btn-primary > * {
    position: relative;
    z-index: 1;
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 26px -6px rgba(37, 99, 235, .5);
    transform: translateY(-1px);
}

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

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

.btn-primary.is-success {
    background: linear-gradient(135deg, var(--c-green-600), #22C55E);
}

.btn-primary.is-success::before {
    display: none;
}

/* 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: 30px;
    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.75rem;
    }

    .brand-copy {
        display: none;
    }

    .panel-form {
        padding: 40px 24px 52px;
        align-items: flex-start;
        background: var(--c-white);
    }

    .form-box {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

@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.5rem;
    }
}
