﻿/* =============================================================
   SIGMA — PANTALLA DE ACCESO
   Sistema de diseño SIGMA 2026.1 · Código Creativo

   La clase fg-login-body que traia el markup no estaba definida en
   ninguna hoja: el login se venia mostrando sin estilo. Esta hoja lo
   reconstruye completo.

   ESTRUCTURA
     Dos paneles. A la izquierda la marca sobre navy, con el degradado
     de identidad como acento. A la derecha el formulario sobre fondo
     claro, que es lo que la marca pide para web.

     Bajo 992px el panel de marca se pliega a una franja superior: en un
     telefono el formulario tiene que quedar arriba, no empujado.
   ============================================================= */

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('../LookAndFeel/Fonts/Sora/Sora-Variable.woff2') format('woff2');
}

:root {
    --sg-navy: #0B0F1A;
    --sg-purple: #6C5CFF;
    --sg-purple-hover: #5847E8;
    --sg-teal: #00E0C2;
    --sg-background: #F8FAFC;
    --sg-surface: #FFFFFF;
    --sg-text-primary: #0B0F1A;
    --sg-text-secondary: #475569;
    --sg-text-muted: #64748B;
    --sg-border: #E2E8F0;
    --sg-border-strong: #CBD5E1;
    --sg-danger: #DC2626;
    --sg-gradient: linear-gradient(135deg, #00E0C2 0%, #2563EB 42%, #6C5CFF 72%, #FF4D9D 100%);
    --sg-font: 'Sora', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
}

body.sg-login {
    margin: 0;
    font-family: var(--sg-font);
    color: var(--sg-text-primary);
    background-color: var(--sg-background);
    -webkit-font-smoothing: antialiased;
}

body.sg-login form {
    min-height: 100vh;
}

.sg-login-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Panel de marca ---------- */

.sg-login-brand {
    position: relative;
    flex: 0 0 44%;
    max-width: 44%;
    background-color: var(--sg-navy);
    color: #fff;
    padding: 56px 56px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* El degradado entra como acento, no como fondo. */
.sg-login-brand::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--sg-gradient);
}

/* Halo tenue: da profundidad sin competir con el logotipo. */
.sg-login-brand::after {
    content: "";
    position: absolute;
    right: -180px;
    bottom: -180px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 92, 255, 0.28) 0%, rgba(108, 92, 255, 0) 70%);
    pointer-events: none;
}

.sg-login-brand > * {
    position: relative;
    z-index: 1;
}

.sg-brand-logo img {
    width: 260px;   /* minimo de marca para la version con descriptor */
    max-width: 100%;
    height: auto;
    display: block;
}

.sg-brand-copy {
    max-width: 460px;
}

.sg-brand-copy h1 {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: #fff;
}

.sg-brand-copy p {
    font-size: 15px;
    line-height: 1.6;
    color: #A8B2C3;
    margin: 0;
}

.sg-brand-points {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: grid;
    gap: 12px;
}

.sg-brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #D6DCEA;
}

.sg-brand-points li::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sg-teal);
    box-shadow: 0 0 0 3px rgba(0, 224, 194, 0.18);
}

.sg-brand-footer {
    font-size: 12px;
    color: #64748B;
    letter-spacing: 0.02em;
}

/* ---------- Panel del formulario ---------- */

.sg-login-form-panel {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.sg-login-card {
    width: 100%;
    max-width: 400px;
}

.sg-login-card h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.sg-login-card .sg-sub {
    font-size: 14px;
    color: var(--sg-text-secondary);
    margin: 0 0 32px;
}

.sg-field {
    margin-bottom: 20px;
}

.sg-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-text-primary);
    margin-bottom: 8px;
}

.sg-field input[type="text"],
.sg-field input[type="password"],
.sg-field input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 14px;
    font-family: var(--sg-font);
    font-size: 14px;
    color: var(--sg-text-primary);
    background-color: var(--sg-surface);
    border: 1px solid var(--sg-border-strong);
    border-radius: var(--sg-radius-sm, 8px);
    outline: none;
    transition: border-color var(--sg-duration-fast, 120ms) ease,
                box-shadow var(--sg-duration-fast, 120ms) ease;
}

.sg-field input::placeholder {
    color: var(--sg-text-muted);
}

.sg-field input:focus {
    border-color: var(--sg-purple);
    box-shadow: 0 0 0 3px rgba(108, 92, 255, 0.16);
}

.sg-btn-login {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background-color: var(--sg-purple);
    color: #fff;
    font-family: var(--sg-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, transform 120ms ease;
}

.sg-btn-login:hover {
    background-color: var(--sg-purple-hover);
}

.sg-btn-login:active {
    transform: translateY(1px);
}

.sg-btn-login:focus-visible {
    outline: 3px solid rgba(108, 92, 255, 0.4);
    outline-offset: 2px;
}

/* Error inline: el rojo es estado operativo, no identidad. */
.sg-login-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 20px;
}

.sg-login-foot {
    margin-top: 28px;
    font-size: 12px;
    color: var(--sg-text-muted);
    text-align: center;
}

/* Logo compacto: solo se ve cuando el panel de marca se pliega. */
.sg-login-logo-compact {
    display: none;
    margin-bottom: 28px;
}

.sg-login-logo-compact img {
    height: 40px;
    width: auto;
}

/* ---------- Adaptacion ---------- */

@media (max-width: 991.98px) {
    .sg-login-layout {
        flex-direction: column;
    }

    .sg-login-brand {
        display: none;
    }

    .sg-login-logo-compact {
        display: block;
    }

    .sg-login-form-panel {
        padding: 40px 20px;
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .sg-login-card h2 {
        font-size: 21px;
    }
}
