/* ========================================
   OAuth Login - Styles
   ======================================== */

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility classes (reemplazo de Tailwind) */
.hidden {
    display: none;
}

.flex {
    display: flex;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-5>*+* {
    margin-top: 1.25rem;
}

.gap-3 {
    gap: 0.75rem;
}

.w-full {
    width: 100%;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.max-w-md {
    max-width: 28rem;
}

.min-h-screen {
    min-height: 100vh;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-10 {
    padding: 2.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.pt-8 {
    padding-top: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.block {
    display: block;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-gray-500 {
    color: #6B7280;
}

.text-gray-600 {
    color: #4B5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-900 {
    color: #111827;
}

.text-red-700 {
    color: #B91C1C;
}

.text-white {
    color: #FFFFFF;
}

.bg-red-50 {
    background-color: #FEF2F2;
}

.border-red-500 {
    border-color: #EF4444;
}

.border-l-4 {
    border-left-width: 4px;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.underline {
    text-decoration: underline;
}

.shrink-0 {
    flex-shrink: 0;
}

.list-disc {
    list-style-type: disc;
}

.list-inside {
    list-style-position: inside;
}

.focus\:outline-none:focus {
    outline: none;
}

.focus\:ring-4:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.focus\:ring-blue-200:focus {
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.5);
}

.hover\:text-gray-700:hover {
    color: #374151;
}

.hover\:text-gray-900:hover {
    color: #111827;
}

/* Paleta de colores SCP */
:root {
    --scp-blue-dark: #2C5F7C;
    --scp-blue-darker: #1a3d52;
    --scp-orange: #F59E0B;
    --scp-input-bg: #FFFBEB;
}

/* Fondo con imagen */
body {
    background-image: url('../img/fondoLogin.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Overlay azul con gradiente para mejorar legibilidad */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(39, 60, 95, 0.10) 0%, rgba(26, 40, 68, 0.10) 100%);
    z-index: 0;
}

/* Asegurar que el contenido esté sobre el overlay */
body>* {
    position: relative;
    z-index: 1;
}

/* Animación sutil de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Estilos para inputs con fondo amarillo claro */
.input-scp {
    background-color: var(--scp-input-bg);
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
}

.input-scp:focus {
    outline: none;
    border-color: var(--scp-blue-dark);
    background-color: #FEF3C7;
}

/* Botón corporativo */
.btn-scp {
    background-color: var(--scp-blue-dark);
    transition: all 0.2s ease;
}

.btn-scp:hover {
    background-color: var(--scp-blue-darker);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.3);
}

.btn-scp:active {
    transform: translateY(0);
}

/* Card con sombra suave */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Texto del subtítulo */
.subtitle-text {
    color: #4B5563;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    position: relative;
    display: inline-block;
    padding: 0 1rem;
}

/* Adorno sutil con líneas decorativas */
.subtitle-text::before,
.subtitle-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2C5F7C, transparent);
}

.subtitle-text::before {
    left: -50px;
}

.subtitle-text::after {
    right: -50px;
}

/* Alert info box */
.info-box {
    background-color: #EFF6FF;
    border-left: 3px solid var(--scp-blue-dark);
}

/* Animación de respiración suave del logo (optimizada para móviles) */
@keyframes logoBreathing {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.02);
        opacity: 0.92;
    }
}

.logo-animate {
    animation: logoBreathing 3.5s ease-in-out infinite;
    will-change: transform, opacity;
}

/* Respeto a usuarios con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .logo-animate {
        animation: none;
    }
}

/* Flip Card Container (3D perspective) */
.flip-card-container {
    perspective: 1000px;
    width: 100%;
    max-width: 28rem;
    /* max-w-md */
}

/* Flip Card Inner (la tarjeta que rota) */
.flip-card {
    position: relative;
    width: 100%;
    height: auto;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Clase para activar el flip */
.flip-card.flipped {
    transform: rotateY(180deg);
}

/* Caras del card (front y back) */
.flip-card-face {
    width: 100%;
    backface-visibility: hidden;
    position: relative;
}

/* Cara frontal (login normal) */
.flip-card-front {
    transform: rotateY(0deg);
}

/* Cara trasera (2FA) */
.flip-card-back {
    transform: rotateY(180deg);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* Inputs de código 2FA (estilo único, 5 dígitos) */
.code-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    background-color: var(--scp-input-bg);
    transition: all 0.2s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--scp-blue-dark);
    background-color: #FEF3C7;
    box-shadow: 0 0 0 3px rgba(44, 95, 124, 0.1);
}

.code-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animación de shake para error */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Mensaje de error 2FA */
.error-message-2fa {
    background-color: #FEE2E2;
    border-left: 3px solid #EF4444;
    color: #DC2626;
}

/* Mensaje de éxito 2FA */
.success-message-2fa {
    background-color: #D1FAE5;
    border-left: 3px solid #10B981;
    color: #059669;
}

/* Estilo para botón resend cuando está deshabilitado (cooldown) */
#resend-code-btn:disabled {
    color: #9CA3AF !important;
    text-decoration: none !important;
    cursor: not-allowed !important;
}

/* Responsive: ajustes para móviles */
@media (max-width: 640px) {
    body {
        padding: 1rem;
        padding-top: 1.5rem;
    }

    #main-container {
        width: 100%;
        max-width: 100%;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .logo-animate {
        height: 100px !important;
    }
}

/* ========================================
   SELECTOR DE IDIOMA
   ======================================== */
.language-selector {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #2C5F7C;
    border-radius: 2rem;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.15);
    transition: all 0.3s ease;
}

.language-toggle:hover {
    box-shadow: 0 6px 16px rgba(44, 95, 124, 0.25);
    transform: translateY(-2px);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6B7280;
    background: transparent;
    border: none;
    outline: none;
}

.language-option:hover {
    color: #2C5F7C;
}

.language-option.active {
    background: linear-gradient(135deg, #2C5F7C 0%, #273C5F 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(44, 95, 124, 0.3);
}

.language-flag {
    width: 1.5rem;
    height: 1rem;
    border-radius: 0.125rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-text {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .language-selector {
        top: 1rem;
        right: 1rem;
    }

    .language-toggle {
        padding: 0.375rem 0.5rem;
        gap: 0.25rem;
    }

    .language-option {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }

    /* Ocultar texto en móviles pequeños, solo mostrar banderas */
    .language-text {
        display: none;
    }

    .language-flag {
        width: 1.75rem;
        height: 1.125rem;
    }
}

/* Responsive - Tablets */
@media (min-width: 641px) and (max-width: 1024px) {
    .language-selector {
        top: 1.25rem;
        right: 1.25rem;
    }
}
