/* ==========================================================================
   BASE
   ========================================================================== */

* {
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    color: #1e293b;
}



/* ==========================================================================
   PÁGINA LOGIN
   ========================================================================== */

.login-body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: clamp(20px, 4vw, 60px);

    background:
        linear-gradient(
            135deg,
            #f4f7fb 0%,
            #e9eef5 100%
        );
}



/* ==========================================================================
   CONTENEDOR
   ========================================================================== */

.login-container {
    width: 100%;

    max-width: 1000px;

    margin: auto;
}



/* ==========================================================================
   TARJETA
   ========================================================================== */

.login-card {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(280px, 0.8fr)
        minmax(480px, 1.6fr);

    background: #ffffff;

    border:
        1px solid #e2e8f0;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 20px 50px
        rgba(15, 23, 42, 0.10);
}



/* ==========================================================================
   PANEL IZQUIERDO
   ========================================================================== */

.login-side {
    min-height: 430px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 42px 36px 28px;

    background:
        linear-gradient(
            145deg,
            #172033 0%,
            #202d47 100%
        );

    color: #ffffff;
}


.login-side-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


.login-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 26px;

    background: #ffffff;

    color: #172033;

    border-radius: 14px;

    font-size: 27px;
    font-weight: 700;

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.18);
}


.login-side h1 {
    margin: 0 0 10px;

    font-size: 28px;
    font-weight: 650;

    letter-spacing: -0.6px;
}


.login-description {
    max-width: 280px;

    margin: 0;

    color: #aeb9cb;

    font-size: 14px;

    line-height: 1.6;
}



/* ==========================================================================
   ESTADO
   ========================================================================== */

.login-status {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    margin-top: 35px;

    padding: 9px 12px;

    background:
        rgba(255, 255, 255, 0.06);

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 8px;

    color: #cbd5e1;

    font-size: 12px;
}


.status-dot {
    width: 8px;
    height: 8px;

    flex-shrink: 0;

    background: #22c55e;

    border-radius: 50%;

    box-shadow:
        0 0 0 3px
        rgba(34, 197, 94, 0.13);
}


.login-side-footer {
    margin-top: 40px;

    color: #7f8da4;

    font-size: 11px;
}



/* ==========================================================================
   PANEL PRINCIPAL
   ========================================================================== */

.login-main {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding:
        clamp(35px, 5vw, 55px);
}



/* ==========================================================================
   CABECERA DEL FORMULARIO
   ========================================================================== */

.login-main-header {
    margin-bottom: 28px;
}


.login-eyebrow {
    display: block;

    margin-bottom: 7px;

    color: #4057d6;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1.4px;
}


.login-main-header h2 {
    margin: 0 0 7px;

    color: #172033;

    font-size: 26px;
    font-weight: 650;

    letter-spacing: -0.4px;
}


.login-main-header p {
    margin: 0;

    color: #7b8799;

    font-size: 13px;
}



/* ==========================================================================
   FORMULARIO
   ========================================================================== */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}


.form-field {
    min-width: 0;
}


.form-label {
    margin-bottom: 8px;

    color: #334155;

    font-size: 13px;
    font-weight: 600;
}


.form-control {
    width: 100%;

    height: 48px;

    padding: 10px 13px;

    border:
        1px solid #d8dee8;

    border-radius: 8px;

    color: #1e293b;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.form-control::placeholder {
    color: #a7b0bf;
}


.form-control:focus {
    border-color: #4763e4;

    box-shadow:
        0 0 0 3px
        rgba(71, 99, 228, 0.11);
}


.form-control:disabled {
    background: #f1f3f6;

    color: #8a94a4;

    cursor: not-allowed;
}


.form-help {
    margin-top: 9px;

    color: #8a94a4;

    font-size: 11px;
}



/* ==========================================================================
   ACCIONES
   ========================================================================== */

.login-actions {
    display: flex;

    justify-content: flex-end;

    margin-top: 26px;
}


.btn-warp {
    min-width: 190px;
    min-height: 46px;

    padding: 10px 24px;

    background: #4057d6;

    border:
        1px solid #4057d6;

    border-radius: 8px;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}


.btn-warp:hover {
    background: #3449bd;

    border-color: #3449bd;

    color: #ffffff;

    box-shadow:
        0 5px 15px
        rgba(64, 87, 214, 0.20);
}


.btn-warp:active {
    transform: translateY(1px);
}


.btn-warp:focus {
    box-shadow:
        0 0 0 3px
        rgba(64, 87, 214, 0.20);
}


.btn-warp:disabled {
    background: #aab2c5;

    border-color: #aab2c5;

    color: #ffffff;

    opacity: 1;

    cursor: not-allowed;
}



/* ==========================================================================
   ALERTA
   ========================================================================== */

.login-alert {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 20px;

    padding: 11px 13px;

    border: 0;

    border-left:
        4px solid #dc3545;

    border-radius: 7px;

    font-size: 12px;
}


.login-alert strong {
    flex-shrink: 0;
}



/* ==========================================================================
   BLOQUEO
   ========================================================================== */

.bloqueo-login {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;

    padding: 14px 16px;

    background: #fff7ed;

    border:
        1px solid #fed7aa;

    border-radius: 9px;
}


.bloqueo-info {
    display: flex;
    flex-direction: column;

    gap: 2px;
}


.bloqueo-info strong {
    color: #9a3412;

    font-size: 13px;
}


.bloqueo-info span {
    color: #9a6546;

    font-size: 11px;
}


.contador-bloqueo {
    flex-shrink: 0;

    color: #c2410c;

    font-size: 25px;
    font-weight: 700;

    font-variant-numeric:
        tabular-nums;

    letter-spacing: 1px;
}



/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 850px) {

    .login-body {
        padding: 25px;
    }


    .login-container {
        max-width: 620px;
    }


    .login-card {
        grid-template-columns: 1fr;
    }


    .login-side {
        min-height: auto;

        padding: 28px 32px;

        flex-direction: row;
        align-items: center;

        gap: 25px;
    }


    .login-side-content {
        display: grid;

        grid-template-columns:
            auto 1fr;

        align-items: center;

        column-gap: 18px;
    }


    .login-icon {
        grid-row: 1 / 4;

        margin: 0;
    }


    .login-side h1 {
        margin-bottom: 3px;

        font-size: 23px;
    }


    .login-description {
        font-size: 12px;
    }


    .login-status {
        margin-top: 9px;

        padding: 0;

        background: transparent;

        border: 0;
    }


    .login-side-footer {
        display: none;
    }


    .login-main {
        padding: 35px 32px;
    }

}



/* ==========================================================================
   MÓVIL
   ========================================================================== */

@media (max-width: 576px) {

    .login-body {
        min-height: 100svh;

        align-items: flex-start;

        padding: 15px;
    }


    .login-card {
        border-radius: 13px;
    }


    .login-side {
        padding: 23px 20px;
    }


    .login-side-content {
        column-gap: 14px;
    }


    .login-icon {
        width: 48px;
        height: 48px;

        border-radius: 11px;

        font-size: 22px;
    }


    .login-side h1 {
        font-size: 20px;
    }


    .login-description {
        line-height: 1.4;
    }


    .login-status {
        display: none;
    }


    .login-main {
        padding: 27px 20px;
    }


    .login-main-header {
        margin-bottom: 23px;
    }


    .login-main-header h2 {
        font-size: 22px;
    }


    /*
     * Los campos dejan de estar lado a lado
     * en pantallas pequeñas.
     */

    .form-grid {
        grid-template-columns: 1fr;

        gap: 17px;
    }


    .login-actions {
        margin-top: 22px;
    }


    .btn-warp {
        width: 100%;
    }


    /*
     * Bloqueo vertical en móvil.
     */

    .bloqueo-login {
        flex-direction: column;

        align-items: flex-start;

        gap: 7px;
    }


    .contador-bloqueo {
        font-size: 23px;
    }


    /*
     * Error vertical para que no
     * comprima el texto.
     */

    .login-alert {
        display: block;
    }


    .login-alert strong {
        display: block;

        margin-bottom: 3px;
    }

}



/* ==========================================================================
   PANTALLAS MUY PEQUEÑAS
   ========================================================================== */

@media (max-width: 360px) {

    .login-body {
        padding: 8px;
    }


    .login-main {
        padding: 23px 16px;
    }


    .login-side {
        padding: 20px 16px;
    }

}



/* ==========================================================================
   OVERRIDE - PÁGINA
   ========================================================================== */

.override-body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: clamp(20px, 4vw, 60px);

    background:
        linear-gradient(
            135deg,
            #f4f7fb 0%,
            #e9eef5 100%
        );
}



/* ==========================================================================
   OVERRIDE - CONTENEDOR
   ========================================================================== */

.override-container {
    width: 100%;
    max-width: 1000px;

    margin: auto;
}



/* ==========================================================================
   OVERRIDE - TARJETA
   ========================================================================== */

.override-card {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(280px, 0.8fr)
        minmax(480px, 1.6fr);

    background: #ffffff;

    border:
        1px solid #e2e8f0;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 20px 50px
        rgba(15, 23, 42, 0.10);
}



/* ==========================================================================
   PANEL IZQUIERDO
   ========================================================================== */

.override-side {
    min-height: 450px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 42px 36px 30px;

    background:
        linear-gradient(
            145deg,
            #172033 0%,
            #202d47 100%
        );

    color: #ffffff;
}


.override-side-content {
    display: flex;
    flex-direction: column;
}


.override-side h1 {
    margin: 0 0 4px;

    font-size: 27px;
    font-weight: 650;

    letter-spacing: -0.6px;
}


.override-side-description {
    margin: 0;

    color: #9ba9bd;

    font-size: 13px;
}



/* ==========================================================================
   EQUIPO
   ========================================================================== */

.device-card {
    margin-top: 35px;

    padding: 16px;

    background:
        rgba(255, 255, 255, 0.055);

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 10px;
}


.device-label {
    display: block;

    margin-bottom: 9px;

    color: #7f8da4;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1.2px;
}


.device-name {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;

    color: #ffffff;

    font-size: 14px;
}


.device-name strong {
    min-width: 0;

    overflow-wrap: anywhere;
}



/* ==========================================================================
   SESIÓN
   ========================================================================== */

.session-status {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 18px;

    color: #b5c0d0;
}


.session-status-icon {
    width: 27px;
    height: 27px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(34, 197, 94, 0.12);

    border:
        1px solid
        rgba(34, 197, 94, 0.20);

    border-radius: 50%;

    color: #4ade80;

    font-size: 12px;
    font-weight: 700;
}


.session-status div {
    display: flex;
    flex-direction: column;
}


.session-status strong {
    color: #d8e0eb;

    font-size: 11px;
    font-weight: 600;
}


.session-status span:not(.session-status-icon) {
    margin-top: 1px;

    color: #7f8da4;

    font-size: 9px;
}



/* ==========================================================================
   CERRAR SESIÓN
   ========================================================================== */

.logout-form {
    margin-top: 35px;
}


.btn-logout {
    width: 100%;

    min-height: 42px;

    padding: 9px 15px;

    background:
        rgba(255, 255, 255, 0.05);

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 8px;

    color: #cbd5e1;

    font-size: 12px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


.btn-logout:hover {
    background:
        rgba(255, 255, 255, 0.10);

    border-color:
        rgba(255, 255, 255, 0.20);

    color: #ffffff;
}



/* ==========================================================================
   PANEL PRINCIPAL
   ========================================================================== */

.override-main {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding:
        clamp(35px, 5vw, 55px);
}



/* ==========================================================================
   HEADER
   ========================================================================== */

.override-main-header {
    margin-bottom: 27px;
}


.override-main-header h2 {
    margin: 0 0 7px;

    color: #172033;

    font-size: 27px;
    font-weight: 650;

    letter-spacing: -0.5px;
}


.override-main-header p {
    margin: 0;

    color: #7b8799;

    font-size: 13px;
}



/* ==========================================================================
   TARJETA DEL CÓDIGO
   ========================================================================== */

.override-code-card {
    padding: 27px 25px 22px;

    background: #f8fafc;

    border:
        1px solid #e2e8f0;

    border-radius: 12px;

    text-align: center;
}


.override-code-label {
    display: block;

    margin-bottom: 13px;

    color: #8a96a8;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1.5px;
}


.override-code {
    display: block;

    max-width: 100%;

    color: #172033;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size:
        clamp(24px, 3.4vw, 34px);

    font-weight: 700;

    line-height: 1.25;

    letter-spacing: 2px;

    overflow-wrap: anywhere;
}



/* ==========================================================================
   METADATOS DEL CÓDIGO
   ========================================================================== */

.override-meta {
    display: flex;
    align-items: stretch;
    justify-content: center;

    margin-top: 23px;
    padding-top: 18px;

    border-top:
        1px solid #e4e9ef;
}


.override-meta-item {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;

    padding: 0 15px;
}


.override-meta-item span {
    color: #8a96a8;

    font-size: 10px;
}


.override-meta-item strong {
    color: #475569;

    font-size: 12px;
    font-weight: 600;

    overflow-wrap: anywhere;
}


.override-meta-divider {
    width: 1px;

    background: #e2e8f0;
}



/* ==========================================================================
   BOTÓN COPIAR
   ========================================================================== */

.override-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 20px;
}


.btn-copy {
    min-width: 175px;
}



/* ==========================================================================
   AVISO
   ========================================================================== */

.override-notice {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid #edf0f4;
}


.override-notice-icon {
    width: 19px;
    height: 19px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 1px;

    background: #eef2ff;

    border-radius: 50%;

    color: #4057d6;

    font-family: Georgia, serif;

    font-size: 11px;
    font-weight: 700;
}


.override-notice p {
    margin: 0;

    color: #8994a4;

    font-size: 10px;

    line-height: 1.5;
}



/* ==========================================================================
   ERROR CLOUDFLARE
   ========================================================================== */

.override-error {
    display: flex;
    align-items: flex-start;

    gap: 13px;

    padding: 17px;

    background: #fef2f2;

    border:
        1px solid #fecaca;

    border-radius: 10px;
}


.override-error-icon {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fee2e2;

    border-radius: 50%;

    color: #dc2626;

    font-size: 15px;
    font-weight: 700;
}


.override-error strong {
    display: block;

    margin-bottom: 3px;

    color: #991b1b;

    font-size: 13px;
}


.override-error p {
    margin: 0;

    color: #b45353;

    font-size: 11px;
}



/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 850px) {

    .override-body {
        padding: 25px;
    }


    .override-container {
        max-width: 620px;
    }


    .override-card {
        grid-template-columns: 1fr;
    }


    /*
     * El panel lateral se convierte
     * en cabecera.
     */

    .override-side {
        min-height: auto;

        display: grid;

        grid-template-columns:
            1fr auto;

        align-items: center;

        gap: 25px;

        padding: 27px 32px;
    }


    .override-side-content {
        display: grid;

        grid-template-columns:
            auto 1fr;

        align-items: center;

        column-gap: 17px;
    }


    .override-side .login-icon {
        grid-row: 1 / 3;

        width: 50px;
        height: 50px;

        margin: 0;

        border-radius: 12px;

        font-size: 23px;
    }


    .override-side h1 {
        font-size: 22px;
    }


    .override-side-description {
        font-size: 11px;
    }


    /*
     * En tablet ocultamos información
     * secundaria del panel lateral.
     */

    .device-card,
    .session-status {
        display: none;
    }


    .logout-form {
        margin: 0;
    }


    .btn-logout {
        width: auto;

        min-width: 120px;
    }


    .override-main {
        padding: 35px 32px;
    }

}



/* ==========================================================================
   MÓVIL
   ========================================================================== */

@media (max-width: 576px) {

    .override-body {
        min-height: 100svh;

        align-items: flex-start;

        padding: 15px;
    }


    .override-card {
        border-radius: 13px;
    }


    /*
     * HEADER
     */

    .override-side {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 18px;

        padding: 22px 20px;
    }


    .override-side-content {
        display: grid;

        grid-template-columns:
            auto 1fr;

        column-gap: 13px;
    }


    .override-side .login-icon {
        width: 45px;
        height: 45px;

        border-radius: 10px;

        font-size: 20px;
    }


    .override-side h1 {
        font-size: 19px;
    }


    .btn-logout {
        width: 100%;
    }


    /*
     * CONTENIDO
     */

    .override-main {
        padding: 27px 20px;
    }


    .override-main-header {
        margin-bottom: 22px;
    }


    .override-main-header h2 {
        font-size: 22px;
    }


    /*
     * CÓDIGO
     */

    .override-code-card {
        padding: 23px 16px 19px;
    }


    .override-code {
        font-size:
            clamp(21px, 7vw, 28px);

        letter-spacing: 1px;
    }


    /*
     * INFORMACIÓN
     */

    .override-meta {
        flex-direction: column;

        gap: 13px;
    }


    .override-meta-item {
        padding: 0;
    }


    .override-meta-divider {
        width: 100%;
        height: 1px;
    }


    /*
     * BOTÓN
     */

    .override-actions {
        margin-top: 18px;
    }


    .btn-copy {
        width: 100%;
    }

}



/* ==========================================================================
   PANTALLAS MUY PEQUEÑAS
   ========================================================================== */

@media (max-width: 360px) {

    .override-body {
        padding: 8px;
    }


    .override-main {
        padding: 23px 16px;
    }


    .override-side {
        padding: 19px 16px;
    }


    .override-code-card {
        padding:
            20px 12px 17px;
    }

}