/*
 * Pantalla de login (views/auth/login.php). CSS propio con prefijo lg- para no
 * depender de clases Tailwind nuevas (public/css/app.css se compila aparte).
 * Modo oscuro: html.dark (lo pone el layout).
 */

.lg {
    --lg-accent: #dc2626;
    --lg-accent-hover: #b91c1c;
    --lg-accent-soft: #fee2e2;
    --lg-ring: rgba(220, 38, 38, .35);
    --lg-text: #0f172a;
    --lg-muted: #64748b;
    --lg-border: #e2e8f0;
    --lg-card: #ffffff;
    --lg-input: #f8fafc;

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--lg-text);
    background: #0b1220;
}

html.dark .lg {
    --lg-accent-soft: rgba(220, 38, 38, .18);
    --lg-text: #f1f5f9;
    --lg-muted: #94a3b8;
    --lg-border: #334155;
    --lg-card: #0f172a;
    --lg-input: #1e293b;
}

@media (min-width: 1024px) {
    .lg {
        grid-template-columns: 1.25fr 1fr;
    }
}

/* ---------- Panel visual (foto + propuesta de valor) ---------- */

.lg-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    display: none;
    background:
        radial-gradient(600px circle at 0% 0%, rgba(69, 126, 164, .35), transparent 60%),
        radial-gradient(500px circle at 10% 100%, rgba(186, 160, 95, .18), transparent 60%),
        #0b1626;
}

@media (min-width: 1024px) {
    .lg-hero {
        display: flex;
    }
}

/* Escritorio: la foto ocupa la parte derecha del panel, entera, encuadrada en la persona */
.lg-hero-photo {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 54%;
    /* La foto empieza a mitad del panel: desvanecer su borde evita el corte
       vertical contra el azul, incluso cuando la imagen es muy luminosa. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .18) 8%, #000 26%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .18) 8%, #000 26%);
}

.lg-hero-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 18%;
}

/* Funde la foto con el azul del panel para que los textos se lean */
.lg-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #0b1626 0%, #0b1626 44%, rgba(11, 22, 38, .7) 54%, rgba(11, 22, 38, .12) 72%, rgba(11, 22, 38, 0) 100%),
        linear-gradient(0deg, rgba(11, 22, 38, .55) 0%, rgba(11, 22, 38, 0) 30%);
}

/* Celular: la foto de fondo, con la cara visible y oscurecida sólo abajo */
.lg-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 12%;
}

.lg-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 22, 38, .45) 0%, rgba(11, 22, 38, .05) 25%, rgba(11, 22, 38, .1) 50%, rgba(11, 22, 38, .8) 78%, #0b1626 100%);
}

.lg-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
    max-width: 600px;
    padding: 48px 56px;
}

.lg-brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: rgba(255, 255, 255, .95);
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.lg-brand img {
    display: block;
    height: 44px;
    width: auto;
}

.lg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fecaca;
}

.lg-hero h2 {
    margin: 14px 0 12px;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.lg-hero-lead {
    margin: 0;
    max-width: 520px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

.lg-features {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 580px;
}

.lg-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lg-feature-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    font-size: 16px;
}

.lg-feature-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.lg-feature-text span {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .72);
}

.lg-hero-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, .8);
}

.lg-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}

.lg-chip:hover {
    background: rgba(255, 255, 255, .24);
}

/* ---------- Columna del formulario ---------- */

.lg-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px 16px 24px;
    overflow: hidden;
}

/* En mobile la foto va arriba, detrás del logo y el título, y se funde con el azul */
.lg-bg {
    position: absolute;
    inset: 0 0 auto 0;
    height: 23rem;
}

@media (max-width: 1023px) {
    .lg-main {
        background: #0b1626;
        justify-content: flex-start;
        padding-top: 1rem;
    }

    /* Logo arriba, la cara en el medio y el título abajo, sobre la foto */
    .lg-main .lg-mobile-head {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 18rem;
        text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
    }

    .lg-main .lg-mobile-head .lg-brand {
        margin-bottom: auto;
        text-shadow: none;
    }
}

@media (min-width: 1024px) {
    .lg-main {
        background: #f1f5f9;
        padding: 40px 32px;
    }

    html.dark .lg-main {
        background: #020617;
    }

    .lg-bg {
        display: none;
    }
}

.lg-mobile-head {
    position: relative;
    text-align: center;
    color: #fff;
}

.lg-mobile-head .lg-brand {
    align-self: center;
    margin-bottom: 14px;
}

.lg-mobile-head .lg-brand img {
    height: 38px;
}

.lg-mobile-head p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
}

.lg-mobile-head .lg-mobile-title {
    max-width: 320px;
    margin: 0 auto 6px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #fff;
}

@media (min-width: 1024px) {
    .lg-mobile-head {
        display: none;
    }
}

.lg-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    background: var(--lg-card);
    border-radius: 24px;
    padding: 32px 28px 26px;
    box-shadow: 0 25px 60px rgba(2, 6, 23, .35);
    animation: lg-in .5s ease-out both;
}

/* Franja con los colores del logo de Perfil */
.lg-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #FB060A 0 25%, #BAA05F 25% 50%, #AAB233 50% 75%, #457EA4 75% 100%);
}

@media (min-width: 1024px) {
    .lg-card {
        box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
        border: 1px solid var(--lg-border);
    }
}

@media (max-width: 380px) {
    .lg-card {
        padding: 26px 18px 22px;
    }
}

.lg-greet {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-accent);
}

.lg-title {
    margin: 4px 0 6px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.025em;
}

.lg-sub {
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--lg-muted);
}

/* Alertas */
.lg-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 18px;
}

.lg-alert i {
    margin-top: 2px;
}

.lg-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.lg-alert--ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

html.dark .lg-alert--error {
    background: rgba(220, 38, 38, .14);
    color: #fecaca;
    border-color: rgba(248, 113, 113, .35);
}

html.dark .lg-alert--ok {
    background: rgba(22, 163, 74, .14);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, .35);
}

/* Campos */
.lg-form {
    display: grid;
    gap: 16px;
}

.lg-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--lg-text);
}

.lg-input-wrap {
    position: relative;
}

.lg-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lg-muted);
    font-size: 15px;
    pointer-events: none;
}

.lg-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    border-radius: 13px;
    border: 1.5px solid var(--lg-border);
    background: var(--lg-input);
    color: var(--lg-text);
    font: inherit;
    font-size: 16px; /* evita el zoom automático de iOS */
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.lg-input::placeholder {
    color: #94a3b8;
}

.lg-input:focus {
    outline: none;
    border-color: var(--lg-accent);
    background: var(--lg-card);
    box-shadow: 0 0 0 4px var(--lg-ring);
}

.lg-input--pass {
    padding-right: 50px;
}

.lg-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
    font-size: 15px;
}

.lg-eye:hover {
    color: var(--lg-text);
    background: rgba(148, 163, 184, .15);
}

.lg-eye:focus-visible {
    outline: 2px solid var(--lg-accent);
    outline-offset: 1px;
}

.lg-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--lg-muted);
}

.lg-caps {
    display: none;
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
}

html.dark .lg-caps {
    color: #fbbf24;
}

.lg-caps.is-on {
    display: block;
}

.lg-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.lg-link {
    color: var(--lg-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.lg-link:hover {
    text-decoration: underline;
}

html.dark .lg-link {
    color: #f87171;
}

/* Botón */
.lg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ef4444, var(--lg-accent-hover));
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(220, 38, 38, .32);
    transition: transform .15s, box-shadow .15s, filter .15s;
}

.lg-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 14px 30px rgba(220, 38, 38, .4);
}

.lg-btn:active {
    transform: translateY(1px);
}

.lg-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--lg-ring);
}

.lg-btn:disabled {
    opacity: .7;
    cursor: wait;
}

/* El layout alterna hidden / inline-flex al enviar el formulario */
.lg-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.lg-btn .hidden {
    display: none !important;
}

.lg-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    font-size: 12px;
    color: var(--lg-muted);
}

.lg-divider::before,
.lg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--lg-border);
}

.lg-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border-radius: 13px;
    border: 1.5px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}

.lg-help:hover {
    background: #dcfce7;
}

html.dark .lg-help {
    background: rgba(22, 163, 74, .12);
    border-color: rgba(74, 222, 128, .3);
    color: #86efac;
}

/* Funciones en mobile (debajo de la tarjeta) */
.lg-mfeatures {
    position: relative;
    width: 100%;
    max-width: 440px;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lg-mfeatures li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lg-mfeatures i {
    flex: none;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .16);
}

@media (min-width: 1024px) {
    .lg-mfeatures {
        display: none;
    }
}

/* Pie legal */
.lg-legal {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
}

.lg-legal a {
    color: inherit;
    text-decoration: none;
}

.lg-legal a:hover {
    text-decoration: underline;
}

@media (min-width: 1024px) {
    .lg-legal {
        color: var(--lg-muted);
    }
}

/* Titularidad y licencia */
.lg-credit {
    position: relative;
    max-width: 440px;
    margin: 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .75);
}

.lg-credit strong {
    color: #fff;
    font-weight: 700;
}

.lg-credit a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (min-width: 1024px) {
    .lg-credit {
        color: var(--lg-muted);
    }

    .lg-credit strong {
        color: var(--lg-text);
    }
}

@keyframes lg-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-card {
        animation: none;
    }

    .lg-btn,
    .lg-input {
        transition: none;
    }
}

/* Escritorio angosto: el panel no alcanza para foto y textos lado a lado */
@media (min-width: 1024px) and (max-width: 1279px) {
    .lg-hero-photo {
        width: 100%;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .lg-hero-overlay {
        background: linear-gradient(90deg, #0b1626 0%, rgba(11, 22, 38, .94) 38%, rgba(11, 22, 38, .78) 58%, rgba(11, 22, 38, .45) 100%);
    }
}
