/**
 * ============================================================
 * SDM Framework
 * Archivo: app/assets/css/pages/login.css
 * Descripción: Estilos exclusivos de la página de login.
 * ============================================================
 */

/* ============================================================
   Configuración general
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body.auth-page {
    display: block;
    min-height: 100vh;
    overflow: hidden;
    background: #ffffff;
    color: #202431;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   Layout de autenticación
   ============================================================ */

.auth-layout {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

.auth-background {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================================
   Figuras animadas de fondo
   ============================================================ */

.auth-shape {
    position: absolute;
    display: block;
    border-radius: 50%;
    transform-origin: center;
    will-change: transform;
}

.auth-shape-primary {
    top: -68%;
    left: -39%;
    width: 93vw;
    height: 146vh;
    background: #6680ef;
    animation: movePrimary 11s ease-in-out infinite alternate;
}

.auth-shape-primary-soft {
    top: -72%;
    left: -35%;
    width: 66vw;
    height: 116vh;
    background: rgba(153, 164, 243, 0.58);
    animation: movePrimarySoft 8s ease-in-out infinite alternate;
}

.auth-shape-success {
    right: -28%;
    bottom: -68%;
    width: 88vw;
    height: 119vh;
    background: #4fc392;
    animation: moveSuccess 12s ease-in-out infinite alternate;
}

.auth-shape-info {
    right: -17%;
    bottom: -93%;
    width: 64vw;
    height: 113vh;
    background: #63b7e8;
    animation: moveInfo 7s ease-in-out infinite alternate;
}

@keyframes movePrimary {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(5vw, 3vh, 0) scale(1.04);
    }

    100% {
        transform: translate3d(-2vw, 7vh, 0) scale(0.98);
    }
}

@keyframes movePrimarySoft {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-4vw, 5vh, 0) scale(1.07);
    }

    100% {
        transform: translate3d(4vw, -2vh, 0) scale(1.02);
    }
}

@keyframes moveSuccess {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-5vw, -4vh, 0) scale(1.05);
    }

    100% {
        transform: translate3d(3vw, -7vh, 0) scale(0.99);
    }
}

@keyframes moveInfo {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(4vw, -3vh, 0) scale(1.08);
    }

    100% {
        transform: translate3d(-3vw, -6vh, 0) scale(1.02);
    }
}

/* ============================================================
   Contenedor central
   ============================================================ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 382px;
    padding: 42px 32px 30px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(36, 44, 76, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================================
   Encabezado y logo
   ============================================================ */

.auth-header {
    margin-bottom: 25px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    text-decoration: none;
}

.auth-logo {
    display: block;
    width: auto;
    max-width: 190px;
    max-height: 82px;
    object-fit: contain;
}

.auth-title {
    margin: 0 0 7px;
    color: #202431;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.auth-subtitle {
    margin: 0;
    color: #686d7a;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================
   Formulario
   ============================================================ */

.auth-form {
    display: grid;
    gap: 18px;
}

.form-group {
    width: 100%;
    min-width: 0;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    color: #242834;
    font-size: 14px;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    min-height: 39px;
    padding: 8px 12px;
    border: 1px solid #d9dee8;
    border-radius: 6px;
    background: rgba(248, 250, 252, 0.96);
    color: #222733;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-control::placeholder {
    color: #7a7f89;
    opacity: 1;
}

.form-control:hover {
    border-color: #c5cddd;
}

.form-control:focus {
    border-color: #669af5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 154, 245, 0.16);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.14);
}

/* ============================================================
   Contraseña
   ============================================================ */

.auth-password {
    position: relative;
    width: 100%;
}

.auth-password-control {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #2d323c;
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password-toggle:hover {
    background: rgba(45, 50, 60, 0.07);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid #669af5;
    outline-offset: 1px;
}

.auth-eye {
    display: block;
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.auth-eye[hidden] {
    display: none;
}

/* ============================================================
   Recordarme
   ============================================================ */

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -2px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #343944;
    font-size: 13px;
    cursor: pointer;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid #d2d8e2;
    border-radius: 4px;
    accent-color: #5c95f5;
    cursor: pointer;
}

.form-check {
    display: flex;
    align-items: center;
    min-height: auto;
    margin: 0;
    padding: 0;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    accent-color: #5c95f5;
    cursor: pointer;
}

.form-check-label {
    color: #343944;
    font-size: 13px;
    cursor: pointer;
}

/* ============================================================
   Botón
   ============================================================ */

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    margin: 1px 0 0;
    padding: 9px 16px;
    border: 1px solid #5c95f5;
    border-radius: 6px;
    background: #5c95f5;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-submit:hover:not(:disabled) {
    border-color: #4d86e7;
    background: #4d86e7;
}

.auth-submit:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(92, 149, 245, 0.25);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.auth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.auth-submit-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-loading[hidden],
.auth-submit-text[hidden] {
    display: none;
}

/* ============================================================
   Pie del formulario
   ============================================================ */

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 28px;
    color: #686d78;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.auth-recovery {
    color: #276ded;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-recovery:hover {
    color: #174fb5;
}

/* ============================================================
   Alertas
   ============================================================ */

.auth-alert {
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.45;
}

.auth-alert[hidden] {
    display: none;
}

.auth-alert.is-danger {
    border-color: rgba(220, 53, 69, 0.25);
    background: rgba(220, 53, 69, 0.09);
    color: #a72633;
}

.auth-alert.is-success {
    border-color: rgba(25, 135, 84, 0.25);
    background: rgba(25, 135, 84, 0.09);
    color: #146c43;
}

/* ============================================================
   Resoluciones medianas
   ============================================================ */

@media (max-width: 991.98px) {
    .auth-shape-primary {
        top: -54%;
        left: -76%;
        width: 147vw;
        height: 119vh;
    }

    .auth-shape-primary-soft {
        top: -59%;
        left: -74%;
        width: 118vw;
        height: 105vh;
    }

    .auth-shape-success {
        right: -68%;
        bottom: -65%;
        width: 145vw;
        height: 102vh;
    }

    .auth-shape-info {
        right: -47%;
        bottom: -87%;
        width: 113vw;
        height: 102vh;
    }
}

/* ============================================================
   Dispositivos móviles
   ============================================================ */

@media (max-width: 575.98px) {
    body.auth-page {
        overflow-y: auto;
    }

    .auth-container {
        padding: 24px 16px;
    }

    .auth-card {
        max-width: 360px;
        padding: 32px 24px 26px;
        border-radius: 12px;
    }

    .auth-brand {
        margin-bottom: 27px;
    }

    .auth-logo {
        max-width: 170px;
        max-height: 72px;
    }

    .auth-shape-primary {
        top: -29%;
        left: -90%;
        width: 173vw;
        height: 80vh;
    }

    .auth-shape-primary-soft {
        top: -31%;
        left: -84%;
        width: 136vw;
        height: 66vh;
    }

    .auth-shape-success {
        right: -92%;
        bottom: -34%;
        width: 178vw;
        height: 70vh;
    }

    .auth-shape-info {
        right: -57%;
        bottom: -50%;
        width: 125vw;
        height: 66vh;
    }
}

/* ============================================================
   Pantallas con poca altura
   ============================================================ */

@media (max-height: 690px) and (min-width: 576px) {
    .auth-container {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .auth-card {
        padding-top: 27px;
        padding-bottom: 23px;
    }

    .auth-brand {
        margin-bottom: 20px;
    }

    .auth-header {
        margin-bottom: 18px;
    }

    .auth-form {
        gap: 14px;
    }

    .auth-footer {
        margin-top: 20px;
    }

    .auth-logo {
        max-height: 65px;
    }
}

/* ============================================================
   Accesibilidad
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .auth-shape {
        animation: none;
    }

    .form-control,
    .auth-submit,
    .auth-password-toggle {
        transition: none;
    }
}