﻿
/* ==========================================================
   SIPNA | LOGIN
   Estilos originales depurados y corregidos.
   Bootstrap 5 controla la visibilidad responsiva del footer.
========================================================== */

/* ==========================================================
   BASE
========================================================== */
* {
    box-sizing: border-box;
}

html,
body,
form {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    overflow-x: hidden;
    color: #172538;
    background: #ffffff;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

/* ==========================================================
   ESTRUCTURA DE PÁGINA
========================================================== */
/* Paleta local del acceso: no redefine las variables globales del SNS. */
.sipna-login-page {
    --login-sns-primary: #00374f;
    --login-sns-primary-hover: #002c3f;
    --login-sns-accent: #34a9e4;
    --login-sns-green: #70c72f;
    --login-focus-ring: rgba(52, 169, 228, 0.20);
}

.sipna-login-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.sipna-login-main {
    width: 100%;
    display: grid;
    grid-template-columns: 44% 56%;
    flex: 1 1 auto;
    min-height: 0;
}

/* ==========================================================
   PANEL INSTITUCIONAL (IZQUIERDO)
========================================================== */
.sipna-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    color: #ffffff;
    overflow: hidden;
    background: radial-gradient(circle at 24% 22%, rgba(36, 111, 168, 0.34), transparent 38%), linear-gradient(145deg, #064774 0%, #075486 52%, #03426f 100%);
}

    .sipna-brand-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        opacity: 0.16;
        pointer-events: none;
        background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1.2px);
        background-size: 15px 15px;
    }

    .sipna-brand-panel::after {
        content: "";
        position: absolute;
        top: -3%;
        right: -8px;
        width: 22px;
        height: 106%;
        z-index: 3;
        background: #67c52c;
        transform: rotate(-3deg);
        transform-origin: center;
    }

.sipna-brand-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 1.8rem 4.2rem 1.3rem;
}

.sipna-brand-logo {
    margin-bottom: 1.55rem;
}

    .sipna-brand-logo img {
        display: block;
        width: auto;
        max-width: 300px;
        max-height: 84px;
        object-fit: contain;
    }

.sipna-brand-title {
    margin: 0;
    color: var(--login-sns-green);
    font-size: clamp(2.55rem, 3.1vw, 3.4rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.sipna-brand-subtitle {
    margin-top: 0.48rem;
    color: #ffffff;
    font-size: clamp(1.28rem, 1.5vw, 1.65rem);
    font-weight: 700;
    line-height: 1.3;
}

.sipna-brand-line {
    width: 72px;
    height: 4px;
    margin: 1.15rem 0;
    background: var(--login-sns-green);
    border-radius: 20px;
}

.sipna-brand-description {
    max-width: 480px;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.96rem;
    font-weight: 400;
    line-height: 1.5;
}

.sipna-country-map {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    margin: 0.65rem 0 0.45rem;
}

    .sipna-country-map img {
        display: block;
        width: 210px;
        max-width: 55%;
        max-height: 110px;
        object-fit: contain;
        opacity: 0.72;
    }

.sipna-brand-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.2rem;
}

.sipna-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    gap: 0.36rem;
    text-align: center;
}

.sipna-feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--login-sns-green);
    border-radius: 50%;
    font-size: 1.08rem;
}

.sipna-feature-text {
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ==========================================================
   PANEL DE ACCESO (DERECHO)
========================================================== */
.sipna-access-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 1.25rem 3rem;
    background: radial-gradient(circle at 88% 44%, rgba(13, 79, 140, 0.035), transparent 32%), #ffffff;
}

.sipna-login-content {
    width: 100%;
    max-width: 590px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sipna-access-heading {
    width: 100%;
    margin: 0 0 1rem;
    text-align: center;
}

.sipna-system-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.48rem;
    color: #075497;
    background: #ffffff;
    border: 1px solid #d4dfe8;
    border-radius: 50%;
    font-size: 1.45rem;
}

.sipna-access-title {
    margin: 0;
    color: #14263b;
    font-size: 1.68rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.sipna-access-subtitle {
    margin: 0.3rem 0 0;
    color: #526173;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
}

/* ==========================================================
   FORMULARIO E INPUTS
========================================================== */
.sipna-login-form {
    width: 100%;
}

.sipna-form-group {
    width: 100%;
    margin-bottom: 0.78rem;
}

.sipna-form-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #172538;
    font-size: 0.87rem;
    font-weight: 700;
    line-height: 1.2;
}

.sipna-input-group {
    position: relative;
    display: flex;
    width: 100%;
    height: 52px;
    background: #ffffff;
    border: 1px solid #c5d0db;
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .sipna-input-group:focus-within {
        border-color: var(--login-sns-accent);
        box-shadow: 0 0 0 3px var(--login-focus-ring);
    }

.sipna-input-icon {
    width: 52px;
    min-width: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #315d82;
    background: #fbfcfd;
    border-right: 1px solid #dbe3ea;
    font-size: 1rem;
}

.sipna-form-control {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 1rem;
    color: #26394c;
    background: transparent;
    border: 0;
    outline: 0;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 500;
}

    .sipna-form-control:focus {
        outline: none;
        box-shadow: none;
    }

    .sipna-form-control::placeholder {
        color: #9aa8b6;
        opacity: 1;
        font-weight: 400;
    }

.sipna-password-input {
    padding-right: 3.6rem;
}

.sipna-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #71869a;
    background: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    font-size: 1rem;
}

    .sipna-password-toggle:hover {
        color: #075497;
    }

    .sipna-password-toggle:focus-visible {
        outline: 2px solid var(--login-sns-accent);
        outline-offset: -4px;
    }

/* ==========================================================
   VALIDACIÓN Y MENSAJES
========================================================== */
.sipna-validation-message {
    display: block;
    margin-top: 0.24rem;
    color: #c62828;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.sipna-login-message {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.7rem;
    color: #b42318;
    background: #fff5f4;
    border: 1px solid #f1c7c3;
    border-radius: 6px;
    font-size: 0.82rem;
    text-align: center;
}

/* ==========================================================
   BOTÓN ENTRAR Y BOTONES «ENTENDIDO» DE LOS MODALES
========================================================== */
.sipna-login-button {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.05rem;
    padding: 0 1rem;
    color: #ffffff;
    background: var(--login-sns-primary);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 4px 10px rgba(0, 55, 79, 0.14);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    /* Interacción perceptible sin perder la identidad institucional. */
    .sipna-login-button:hover:not(:disabled) {
        background: #08658b;
        color: #ffffff;
        box-shadow: 0 7px 18px rgba(0, 55, 79, 0.27);
        transform: translateY(-2px);
    }

    .sipna-login-button:active:not(:disabled) {
        background: #004c6b;
        transform: translateY(0);
        box-shadow: 0 3px 9px rgba(0, 55, 79, 0.18);
    }

    .sipna-login-button:disabled {
        cursor: not-allowed;
        opacity: 0.88;
    }

    .sipna-login-button:focus-visible {
        outline: 3px solid var(--login-sns-accent);
        outline-offset: 3px;
    }

    .sipna-login-button #loginSpinner {
        font-size: 0.95rem;
    }

/* Las acciones de ayuda usan utilidades de Bootstrap 5 en Login.aspx. */

/* ==========================================================
   FOOTER INSTITUCIONAL
========================================================== */
.sipna-login-footer {
    width: 100%;
    height: 62px;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 62px;
    padding: 0.3rem 18px;
    color: #ffffff;
    background: linear-gradient(90deg, #053e6d 0%, #07518d 52%, #03365f 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.sipna-footer-left {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.65rem;
}

.sipna-footer-sns-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    overflow: hidden;
}

    .sipna-footer-sns-mark img {
        display: block;
        width: auto;
        max-width: none;
        height: 42px;
        margin: 0;
    }

.sipna-footer-text {
    min-width: 0;
}

    .sipna-footer-text strong,
    .sipna-footer-text span {
        display: block;
    }

    .sipna-footer-text strong {
        color: #ffffff;
        font-size: 0.79rem;
        font-weight: 700;
        line-height: 1.15;
    }

    .sipna-footer-text span {
        margin-top: 0.1rem;
        color: rgba(255, 255, 255, 0.82);
        font-size: 0.7rem;
        font-weight: 400;
        line-height: 1.15;
    }

.sipna-footer-right {
    width: 280px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 280px;
    overflow: hidden;
}

    .sipna-footer-right img {
        display: block;
        width: 270px;
        height: auto;
        max-width: 100%;
        max-height: 52px;
        object-fit: contain;
        object-position: right center;
    }

/* ==========================================================
   ESCRITORIO MEDIANO
========================================================== */
@media (max-width: 1366px) {
    .sipna-brand-content {
        padding: 1.5rem 3rem 1rem;
    }

    .sipna-brand-logo {
        margin-bottom: 1.3rem;
    }

        .sipna-brand-logo img {
            max-width: 260px;
            max-height: 74px;
        }

    .sipna-brand-description {
        font-size: 0.91rem;
    }

    .sipna-country-map {
        min-height: 95px;
        margin: 0.5rem 0 0.35rem;
    }

        .sipna-country-map img {
            max-height: 95px;
        }

    .sipna-feature-icon {
        width: 45px;
        height: 45px;
        min-width: 45px;
    }

    .sipna-access-panel {
        padding: 1.1rem 2.5rem;
    }

    .sipna-login-content {
        max-width: 560px;
    }

    .sipna-footer-right {
        width: 245px;
        flex-basis: 245px;
    }

        .sipna-footer-right img {
            width: 235px;
        }
}

/* ==========================================================
   TABLET (991.98 px O MENOS)
   Sin altura fija: la página crece y el footer no se superpone.
========================================================== */
@media (max-width: 991.98px) {
    .sipna-login-page {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
    }

    .sipna-brand-panel {
        display: none !important;
    }

    .sipna-login-main {
        display: flex;
        flex: 1 0 auto;
        min-height: auto;
    }

    .sipna-access-panel {
        width: 100%;
        min-height: auto;
        flex: 1 0 auto;
        align-items: flex-start;
        justify-content: center;
        padding: clamp(1.8rem, 6vh, 3.4rem) 1.5rem 1rem;
        background: radial-gradient(circle at 85% 30%, rgba(13, 79, 140, 0.04), transparent 30%), #ffffff;
    }

    .sipna-login-content {
        max-width: 580px;
        margin: 0 auto;
    }

    .sipna-login-footer {
        height: 60px;
        min-height: 60px;
        flex: 0 0 60px;
        padding: 0.3rem 14px;
    }

    .sipna-footer-right {
        width: 210px;
        flex-basis: 210px;
    }

        .sipna-footer-right img {
            width: 200px;
            max-height: 46px;
        }
}

/* ==========================================================
   MÓVIL (767.98 px O MENOS)
========================================================== */
@media (max-width: 767.98px) {
    .sipna-access-panel {
        padding: clamp(1.2rem, 4vh, 2rem) 1rem 0.75rem;
    }

    .sipna-login-content {
        max-width: 100%;
    }

    .sipna-access-heading {
        margin-bottom: 0.95rem;
    }

    .sipna-system-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 0.42rem;
        font-size: 1.3rem;
    }

    .sipna-access-title {
        font-size: 1.45rem;
    }

    .sipna-access-subtitle {
        margin-top: 0.22rem;
        font-size: 0.86rem;
    }

    .sipna-form-group {
        margin-bottom: 0.7rem;
    }

    .sipna-form-label {
        margin-bottom: 0.28rem;
        font-size: 0.85rem;
    }

    .sipna-input-group {
        height: 50px;
    }

    .sipna-input-icon {
        width: 50px;
        min-width: 50px;
    }

    .sipna-form-control {
        font-size: 1rem;
    }

    .sipna-login-button {
        height: 50px;
        font-size: 0.97rem;
    }

    /* Bootstrap oculta el texto institucional del escritorio y
       el logo del Gobierno usando d-none / d-md-block.
       No ocultar los span: uno muestra el nombre y otro SIPNA. */
    .sipna-login-footer {
        height: auto;
        min-height: 58px;
        flex: 0 0 auto;
        gap: 0.4rem;
        padding: 0.25rem 8px;
    }

    .sipna-footer-left {
        gap: 0.4rem;
    }

    .sipna-footer-sns-mark {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

        .sipna-footer-sns-mark img {
            height: 36px;
        }

    .sipna-footer-text span:first-of-type {
        font-size: 0.65rem;
    }
}

/* ==========================================================
   MÓVIL PEQUEÑO (479.98 px O MENOS)
========================================================== */
@media (max-width: 479.98px) {
    .sipna-access-panel {
        padding: clamp(1rem, 3.5vh, 1.6rem) 0.85rem 0.65rem;
    }

    .sipna-system-icon {
        width: 54px;
        height: 54px;
        font-size: 1.2rem;
    }

    .sipna-access-heading {
        margin-bottom: 0.9rem;
    }

    .sipna-access-title {
        font-size: 1.38rem;
    }

    .sipna-access-subtitle {
        font-size: 0.83rem;
    }

    .sipna-form-label {
        font-size: 0.83rem;
    }

    .sipna-input-group {
        height: 49px;
    }

    .sipna-form-control {
        padding: 0 0.72rem;
        font-size: 1rem;
    }

    .sipna-password-toggle {
        width: 45px;
    }

    .sipna-login-button {
        height: 49px;
        font-size: 0.94rem;
    }

    .sipna-login-footer {
        min-height: 56px;
        padding: 0.2rem 6px;
    }

    .sipna-footer-sns-mark {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

        .sipna-footer-sns-mark img {
            height: 34px;
        }
}

/* ==========================================================
   MÓVIL ESTRECHO (380 px O MENOS)
========================================================== */
@media (max-width: 380px) {
    .sipna-login-footer {
        gap: 0.25rem;
        padding-right: 5px;
        padding-left: 5px;
    }

    .sipna-footer-text span:first-of-type {
        font-size: 0.6rem;
    }
}

/* Accesibilidad: evita transiciones para quienes prefieren menos movimiento. */
@media (prefers-reduced-motion: reduce) {
    .sipna-login-page .sipna-input-group,
    .sipna-login-page .sipna-login-button {
        transition: none;
    }
}


/* ==========================================================
   FOOTER SNS | Alineación compacta de las dos líneas con logo
   ========================================================== */
.sipna-footer-left {
    align-items: center;
}

.sipna-footer-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 42px;
}

    .sipna-footer-text strong,
    .sipna-footer-text span {
        margin: 0;
        line-height: 1.08;
    }

    .sipna-footer-text strong {
        font-weight: 700;
    }

@media (max-width: 767.98px) {
    .sipna-footer-text {
        min-height: 36px;
        gap: 1px;
    }
}

@media (max-width: 479.98px) {
    .sipna-footer-text {
        min-height: 34px;
    }
}
