/* Módulo complementario de contraste WCAG AAA, ergonomía Apple HIG y limpieza visual en accesos SICOAS */

.login-terms-check-wrap {
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.9rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

.login-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    margin: 0;
}

.login-terms-checkbox {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: #519BE9;
    cursor: pointer;
}

.login-terms-text,
.login-card label[for="acceptTerms"] span,
.login-card label[for="alumno-acceptTerms"] span,
.login-card label[for="tutor-acceptTerms"] span,
.login-card label[for="profesor-acceptTerms"] span,
.terms-checkbox-label .terms-text {
    font-size: 0.84rem;
    color: #334155 !important;
    line-height: 1.5;
    font-weight: 500;
}

.login-terms-link,
.terms-checkbox-label .terms-link {
    color: #2563EB !important;
    text-decoration: underline;
    font-weight: 600;
}

.login-terms-link:hover,
.terms-checkbox-label .terms-link:hover {
    color: #1D4ED8 !important;
}

.login-terms-error {
    color: #D44A59;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.45rem;
    display: none;
}

.login-terms-error.visible {
    display: block;
}

/* Contraste WCAG AAA en avisos de primer acceso y enlaces legales sobre tarjetas blancas */
.student-first-access-notice p,
.tutor-first-access-notice p {
    color: #334155 !important;
}

.student-first-access-notice strong,
.tutor-first-access-notice strong {
    color: #0F172A;
}

.login-legal-links {
    text-align: center;
    margin-top: 1.15rem;
    font-size: 0.8rem;
    color: #475569;
}

.login-legal-links a {
    color: #475569;
    text-decoration: underline;
    margin: 0 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    transition: color 0.18s ease;
}

.login-legal-links a:hover,
.login-legal-links a:focus-visible {
    color: #2563EB;
}

/* Sección biométrica docente con contraste real sobre fondo blanco */
.biometric-divider {
    display: flex;
    align-items: center;
    margin: 14px 0 12px;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.biometric-divider-line {
    flex: 1;
    height: 1px;
    background: #CBD5E1;
}

.biometric-divider-text {
    padding: 0 10px;
}

.btn-biometric-auth {
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    background: #519BE9 !important;
    border: 1.5px solid #3D7CC4 !important;
    border-radius: 12px;
    color: #FFFFFF !important;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(81, 155, 233, 0.22);
}

.btn-biometric-auth:hover,
.btn-biometric-auth:focus-visible {
    background: #3D7CC4 !important;
}

.btn-biometric-auth svg {
    width: 22px;
    height: 22px;
    color: #FFFFFF !important;
    flex-shrink: 0;
}

#biometric-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #475569 !important;
    font-weight: 500;
}

/* Áreas táctiles mínimas de 44x44 px conforme a Apple HIG */
.toggle-password,
.toggle-password-btn,
.mode-toggle-btn,
.mode-btn,
.tab-btn,
.btn-change-tenant,
.btn-change-tenant-action,
.tenant-badge-change,
.login-button,
.btn-login,
.btn-biometric,
.btn-otp-action,
.confirm-btn-primary,
.confirm-btn-secondary,
.close-modal-x-btn {
    min-height: 44px;
}

.toggle-password,
.toggle-password-btn,
.close-modal-x-btn {
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Prevenir auto-zoom en iOS Safari manteniendo tipografía de al menos 16px en móviles */
@media (max-width: 768px) {
    .login-form input[type="text"],
    .login-form input[type="password"],
    .login-form input[type="email"],
    .login-form input[type="tel"],
    .login-card input[type="text"],
    .login-card input[type="password"],
    .login-card input[type="email"],
    .login-card input[type="tel"],
    .confirm-modal input[type="text"],
    .confirm-modal input[type="password"],
    .confirm-modal input[type="email"],
    .confirm-modal input[type="tel"],
    .modal-card input[type="text"],
    .modal-card input[type="password"],
    .modal-card input[type="email"],
    .modal-card input[type="tel"] {
        font-size: 16px !important;
    }
}

.otp-code-input {
    text-align: center;
    letter-spacing: 0.45rem;
    font-size: 1.35rem !important;
    font-weight: 700;
    color: #0F172A !important;
    background: #FFFFFF !important;
}

.tenant-option-item {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
    color: #0F172A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.18s ease, background-color 0.18s ease;
    min-height: 48px;
}

.tenant-option-item:hover,
.tenant-option-item:focus-visible {
    border-color: #519BE9;
    background: #EFF6FF;
    outline: none;
}

.tenant-option-item.is-selected {
    border-color: #519BE9;
    background: #EFF6FF;
}

.tenant-option-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0F172A;
    display: block;
}

.tenant-option-sub {
    font-size: 0.78rem;
    color: #334155;
    display: block;
}

.tenant-empty-state {
    padding: 1.25rem;
    text-align: center;
    color: #334155;
    font-size: 0.88rem;
}

.modal-security-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #EFF6FF;
    color: #519BE9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem;
}

.modal-security-icon svg {
    width: 26px;
    height: 26px;
}

.login-portal-alt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 44px;
    padding: 0.35rem 0.5rem;
}

.login-portal-alt-link:hover {
    color: #519BE9;
}

/* Foco visible accesible para navegación por teclado (WCAG / Apple HIG) */
.mode-btn:focus-visible,
.tab-btn:focus-visible,
.forgot-link:focus-visible,
.toggle-password-btn:focus-visible,
.close-modal-x-btn:focus-visible,
.confirm-btn-primary:focus-visible,
.confirm-btn-secondary:focus-visible,
.login-actions button[type="submit"]:focus-visible {
    outline: 2px solid #519BE9;
    outline-offset: 2px;
}

/* Botón flecha de regreso al selector de portales en esquina superior izquierda */
.login-back-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 20;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.login-back-btn:hover {
    background: #EFF6FF;
    border-color: #519BE9;
    color: #3D7CC4;
    transform: translateX(-2px);
}

.login-back-btn:focus-visible {
    outline: 2px solid #519BE9;
    outline-offset: 2px;
}

.login-back-btn svg {
    width: 20px;
    height: 20px;
}

/* Optimización móvil: priorizar el formulario sin empujarlo con el panel informativo */
@media (max-width: 768px) {
    .login-back-btn {
        top: 14px;
        left: 14px;
    }

    .login-visual,
    .info-section {
        display: none !important;
    }

    .confirm-modal {
        width: 92% !important;
        max-width: 460px !important;
        margin: auto !important;
        border-radius: 18px !important;
    }
}
