/*
 * Tool-be | Estilos de las pantallas de acceso
 *
 * Cubre login tradicional, ingreso con código (OTP), verificación del código y
 * recuperación de contraseña. Se carga DESPUÉS de bootstrap.min.css y de
 * mainStyle.css, de modo que lo que aquí se define gana sobre el tema por
 * defecto sin tener que recurrir a !important.
 *
 * El proyecto sigue en Bootstrap 3, así que la retícula original (.row, .col-*)
 * se conserva en las vistas; estas reglas sólo cambian la piel.
 */

:root {
    /* Colores de marca. Los tonos *-hover son los mismos oscurecidos ~10%
       para el estado activo; el resto son los valores oficiales. */
    --tb-rojo: #e4373a;
    --tb-rojo-hover: #c92e31;
    --tb-azul: #47bfea;
    --tb-azul-hover: #2ba5d2;
    --tb-gris-texto: #828383;
    --tb-gris-titulo: #828383;
    --tb-borde-input: #47bfea;
    --tb-placeholder: #b2b2b2;
    --tb-fondo: #ffffff;
    --tb-radio: 28px;
}

/* ------------------------------------------------------------------ *
 * Lienzo
 * ------------------------------------------------------------------ */

html,
body {
    height: 100%;
}

body.tb-auth {
    margin: 0;
    padding: 0;
    color: var(--tb-gris-texto);
    font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* El SVG se ancla al centro y cubre la ventana. `fixed` evita que el
       patrón de nubes se desplace cuando el teclado del móvil empuja la
       página hacia arriba. */
    background-color: var(--tb-fondo);
    background-image: url("../images/fondo-login-nuevo.svg?v=2");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* En pantallas muy angostas el fondo se amplía para que las nubes de las
   esquinas no invadan el área del formulario. */
@media (max-width: 767px) {
    body.tb-auth {
        background-size: 180% auto;
        background-position: center top;
        background-attachment: scroll;
    }
}

/* Centra la tarjeta vertical y horizontalmente en toda la altura visible. */
.tb-auth-wrap {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
    box-sizing: border-box;
}

.tb-auth-card {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
}

/* ------------------------------------------------------------------ *
 * Logo y textos de cabecera
 * ------------------------------------------------------------------ */

.tb-logo {
    display: block;
    width: 200px;
    max-width: 62%;
    height: auto;
    margin: 0 auto 22px;
}

.tb-titulo {
    margin: 0 0 6px;
    color: var(--tb-gris-titulo);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
}

.tb-subtitulo {
    margin: 0 0 26px;
    color: var(--tb-gris-texto);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
}

/* Cuando el subtítulo va pegado al título (pantalla de bienvenida) no
   necesita el respiro completo. */
.tb-titulo + .tb-subtitulo {
    margin-top: -2px;
}

.tb-subtitulo strong,
.tb-subtitulo b {
    color: var(--tb-gris-titulo);
    font-weight: 700;
}

/* ------------------------------------------------------------------ *
 * Campos
 * ------------------------------------------------------------------ */

.tb-campo {
    margin-bottom: 14px;
}

.tb-auth-card .form-control,
input.tb-input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 12px 22px;
    box-sizing: border-box;

    color: var(--tb-gris-titulo);
    font-size: 15px;
    text-align: center;

    background-color: #fff;
    border: 1.5px solid var(--tb-borde-input);
    border-radius: var(--tb-radio);
    box-shadow: none;

    -webkit-transition: border-color .18s ease, box-shadow .18s ease;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.tb-auth-card .form-control::-webkit-input-placeholder,
input.tb-input::-webkit-input-placeholder {
    color: var(--tb-placeholder);
}

.tb-auth-card .form-control:-ms-input-placeholder,
input.tb-input:-ms-input-placeholder {
    color: var(--tb-placeholder);
}

.tb-auth-card .form-control::placeholder,
input.tb-input::placeholder {
    color: var(--tb-placeholder);
}

.tb-auth-card .form-control:focus,
input.tb-input:focus {
    outline: none;
    border-color: var(--tb-azul);
    box-shadow: 0 0 0 3px rgba(71, 191, 234, .22);
}

/* ------------------------------------------------------------------ *
 * Botón principal
 * ------------------------------------------------------------------ */

.tb-boton {
    display: block;
    width: 100%;
    height: 52px;
    margin: 20px 0 14px;
    padding: 0 22px;
    box-sizing: border-box;

    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 52px;
    text-align: center;
    text-decoration: none;

    background-color: var(--tb-rojo);
    border: none;
    border-radius: var(--tb-radio);
    cursor: pointer;

    -webkit-transition: background-color .18s ease, transform .08s ease;
    transition: background-color .18s ease, transform .08s ease;
}

.tb-boton:hover,
.tb-boton:focus {
    color: #fff;
    background-color: var(--tb-rojo-hover);
    text-decoration: none;
    outline: none;
}

.tb-boton:active {
    -webkit-transform: translateY(1px);
    transform: translateY(1px);
}

.tb-boton[disabled] {
    background-color: #eda0a2;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ *
 * Enlaces secundarios
 * ------------------------------------------------------------------ */

.tb-enlaces {
    margin-top: 4px;
}

.tb-enlace {
    display: block;
    margin: 9px 0;
    color: var(--tb-azul);
    font-size: 15px;
    text-decoration: none;
}

.tb-enlace:hover,
.tb-enlace:focus {
    color: var(--tb-azul-hover);
    text-decoration: underline;
}

/* El enlace de acción destacada va en cursiva, como en el diseño. */
.tb-enlace-destacado {
    font-style: italic;
    font-weight: 600;
}

/* Botón que debe verse como enlace (reenviar código). Hereda el submit del
   formulario, por eso se neutraliza la apariencia nativa. */
.tb-enlace-boton {
    display: inline;
    padding: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--tb-azul);
    background: none;
    border: none;
    cursor: pointer;
}

.tb-enlace-boton:hover,
.tb-enlace-boton:focus {
    color: var(--tb-azul-hover);
    text-decoration: underline;
    outline: none;
}

.tb-enlace-boton[disabled] {
    color: var(--tb-placeholder);
    text-decoration: none;
    cursor: default;
}

/* ------------------------------------------------------------------ *
 * Avisos (flashdata y errores de validación)
 * ------------------------------------------------------------------ */

.tb-auth-card .alert {
    margin-bottom: 14px;
    padding: 11px 16px;
    font-size: 14px;
    text-align: center;
    border: none;
    border-radius: 16px;
}

.tb-auth-card .alert-danger {
    color: #a32a2e;
    background-color: #fde4e5;
}

.tb-auth-card .alert-success {
    color: #1f7a4d;
    background-color: #dff5e8;
}

.tb-auth-card .alert-info {
    color: #17627f;
    background-color: #ddf1fb;
}

/* El controlador de "olvidé mi contraseña" inyecta el aviso con col-md-12;
   dentro de la tarjeta esa clase sólo añadiría padding lateral inútil. */
.tb-auth-card .alert.col-md-12 {
    float: none;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

/* ------------------------------------------------------------------ *
 * Código de verificación (6 casillas)
 * ------------------------------------------------------------------ */

.tb-codigo-titulo {
    margin: 0 0 14px;
    color: var(--tb-gris-titulo);
    font-size: 18px;
    font-weight: 700;
}

/* `display:flex` gana sobre el atributo `hidden`, así que hay que anularlo
   explícitamente: sin JS las casillas no deben ocupar espacio. */
.tb-codigo[hidden] {
    display: none;
}

.tb-codigo {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

/* `gap` no existe en navegadores antiguos; el margen sirve de respaldo y se
   anula con el selector de arriba en los que sí lo soportan. */
.tb-codigo-casilla {
    width: 34px;
    height: 44px;
    margin: 0 5px;
    padding: 0;
    box-sizing: border-box;

    color: var(--tb-gris-titulo);
    font-size: 24px;
    font-weight: 700;
    text-align: center;

    background: transparent;
    border: none;
    border-bottom: 3px solid var(--tb-gris-titulo);
    border-radius: 0;

    -webkit-transition: border-color .18s ease;
    transition: border-color .18s ease;
}

@supports (gap: 10px) {
    .tb-codigo-casilla {
        margin: 0;
    }
}

.tb-codigo-casilla:focus {
    outline: none;
    border-bottom-color: var(--tb-azul);
}

.tb-codigo-casilla.tb-lleno {
    border-bottom-color: var(--tb-rojo);
}

.tb-vigencia {
    margin: 10px 0 0;
    color: var(--tb-gris-texto);
    font-size: 14px;
}

.tb-reenvio {
    margin: 4px 0 0;
    color: var(--tb-gris-texto);
    font-size: 14px;
}

/* ------------------------------------------------------------------ *
 * Ajustes finos para móvil
 * ------------------------------------------------------------------ */

@media (max-width: 380px) {
    .tb-titulo {
        font-size: 19px;
    }

    .tb-codigo-casilla {
        width: 30px;
        height: 40px;
        font-size: 21px;
    }
}
