/* public/css/filament-custom-login.css */

/* === VARIABLES PARA MODO OSCURO/CLARO === */
:root {
    --login-bg-image: url('/portadalogin.jpg');
    --login-bg-overlay-light: rgba(255, 255, 255, 0);
    --login-bg-overlay-dark: rgba(0, 0, 0, 0.6);
    --card-bg-light: rgba(255, 255, 255, 0.95);
    --card-bg-dark: rgba(31, 41, 55, 0.95);
    --text-primary-light: #1f2937;
    --text-primary-dark: #f3f4f6;
    --text-secondary-light: #4b5563;
    --text-secondary-dark: #9ca3af;
}

/* === RESET Y MEJORAS DE RESPONSIVE === */
* {
    box-sizing: border-box;
}

/* === FONDO PRINCIPAL CON IMAGEN === */
.fi-simple-layout {
    background-image: var(--login-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay mejorado */
.fi-simple-layout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--login-bg-overlay-light);
    transition: all 0.3s ease;
    pointer-events: none;
}

html.dark .fi-simple-layout::before {
    background: var(--login-bg-overlay-dark);
}

/* === CONTENEDOR PRINCIPAL RESPONSIVE === */
.fi-simple-main {
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 1rem;
}

.fi-simple-main-ctn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* === TARJETA DEL FORMULARIO (FULL RESPONSIVE) === */
form#form {
    background: var(--card-bg-light);
    border-radius: 1.5rem;
    max-width: 450px;
    width: 90%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* Modo oscuro */
html.dark form#form {
    background: #18181b;
}

/* Responsive para tablets */
@media (min-width: 640px) {
    form#form {
        width: 100%;
    }
}

/* Responsive para móviles grandes */
@media (max-width: 640px) {
    form#form {
        width: 95%;
        border-radius: 1rem;
    }
}

/* Responsive para móviles pequeños */
@media (max-width: 480px) {
    form#form {
        width: 100%;
        border-radius: 0.75rem;
        padding: 1rem;
    }
}

/* === HEADER RESPONSIVE - MANTENIENDO TU LÓGICA DEL LOGO === */
.fi-simple-header {
    text-align: center;
}

/* Logo personalizado - TU CÓDIGO ORIGINAL MANTENIDO */
.fi-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.fi-logo img {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Responsive para el logo */
@media (max-width: 640px) {
    .fi-logo img {
        max-width: 100px;
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .fi-logo img {
        max-width: 80px;
        max-height: 50px;
    }
}

/* Si no hay imagen, mostrar texto - TU CÓDIGO ORIGINAL */
.fi-logo:not(:has(img)) {
    font-size: 1.875rem;
    font-weight: bold;
    color: #f59e0b;
    text-align: center;
}

/* TU CÓDIGO ESPECIAL DEL LOGO - RESTAURADO COMPLETAMENTE */
.fi-logo {
    font-size: 0 !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    color: transparent !important;
    position: relative;
    width: 100%;
    min-height: 100px;
}

/* Mostrar imagen de fondo */
.fi-logo:not(:has(img)) {
    background-image: url('/images/logo.png') !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: block !important;
}

/* Para modo oscuro, otra imagen si es necesario */
html .fi-logo:not(:has(img)) {
    background-image: url('/yelaologoblanco.png') !important;
}

/* Responsive para tu logo especial */
@media (max-width: 640px) {
    .fi-logo {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .fi-logo {
        min-height: 70px;
    }
}

/* Título responsivo */
.fi-simple-header-heading {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary-light);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

html.dark .fi-simple-header-heading {
    color: var(--text-primary-dark);
}

/* === FORMULARIO RESPONSIVE === */
.fi-fo-field {
    margin-bottom: 1.25rem;
}

.fi-fo-field-label {
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.3s ease;
}

html.dark .fi-fo-field-label {
    color: var(--text-secondary-dark);
}

.fi-fo-field-label-required-mark {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* === INPUTS RESPONSIVOS === */
.fi-input-wrp {
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    background: white;
}

html.dark .fi-input-wrp {
    border-color: #4b5563;
    background: #1f2937;
}

.fi-input-wrp:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.fi-input {
    padding: 0.75rem 1rem;
    font-size: clamp(0.875rem, 4vw, 1rem);
    border-radius: 0.75rem;
    width: 100%;
    background: transparent;
    color: var(--text-primary-light);
}

html.dark .fi-input {
    color: var(--text-primary-dark);
}

.fi-input::placeholder {
    color: #9ca3af;
}

/* === BOTÓN REVEAL PASSWORD === */
.fi-icon-btn {
    color: #9ca3af;
    transition: color 0.2s;
}

.fi-icon-btn:hover {
    color: #f59e0b;
}

/* === CHECKBOX COMPLETO MODO OSCURO === */
.fi-fo-field:has(.fi-checkbox-input) {
    margin: 0;
}

.fi-checkbox-input {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 2px solid #d1d5db;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-color: white;
    position: relative;
    flex-shrink: 0;
}

html.dark .fi-checkbox-input {
    border-color: #6b7280;
    background-color: #374151;
}

.fi-checkbox-input:hover {
    border-color: #f59e0b;
}

.fi-checkbox-input:checked {
    background-color: #f59e0b;
    border-color: #f59e0b;
}

.fi-checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

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

label[for="form.remember"] {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary-light);
    transition: color 0.3s ease;
    font-size: 0.875rem;
}

html.dark label[for="form.remember"] {
    color: var(--text-secondary-dark);
}

label[for="form.remember"]:hover {
    color: #f59e0b;
}

/* === BOTÓN DE ENVÍO RESPONSIVE === */
button.fi-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 0.75rem;
    padding: clamp(0.75rem, 4vw, 0.875rem);
    font-weight: 600;
    font-size: clamp(0.875rem, 4vw, 1rem);
    color: white;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button.fi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, #f59e0b 0%, #f59e0b 100%);
}

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

/* Estado de carga del botón */
button.fi-btn.fi-processing {
    position: relative;
    cursor: wait;
}

button.fi-btn.fi-processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* === ENLACE "OLVIDÉ CONTRASEÑA" === */
.fi-link {
    color: #f59e0b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.fi-link:hover {
    color: #d97706;
    text-decoration: underline;
}

/* === NOTIFICACIONES RESPONSIVAS === */
.fi-no {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.fi-notification {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ef4444;
    animation: slideInRight 0.3s ease-out;
}

html.dark .fi-notification {
    background: #1f2937;
    color: #f3f4f6;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .fi-simple-main {
        padding: 1rem;
    }
    
    .fi-no {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* === ESTADO DE CARGA === */
.fi-processing {
    opacity: 0.8;
    cursor: wait;
}

/* === AJUSTE DEL CONTENEDOR === */
.fi-sc-component {
    width: 100%;
}

/* === SOPORTE PARA ALTO CONTRASTE === */
@media (prefers-contrast: high) {
    .fi-input-wrp {
        border-width: 2px;
    }
    
    button.fi-btn {
        border: 2px solid #ffffff;
    }
    
    .fi-checkbox-input:checked {
        background-color: #f59e0b;
    }
}

/* === ANIMACIÓN SUTIL === */
form#form {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === SOPORTE LANDSCAPE EN MÓVILES === */
@media (max-height: 600px) and (orientation: landscape) {
    .fi-simple-main {
        padding: 0.5rem;
    }
    
    form#form {
        max-width: 500px;
    }
    
    .fi-logo {
        min-height: 60px;
    }
    
    .fi-logo img {
        max-width: 80px;
        max-height: 50px;
    }
    
    .fi-simple-header-heading {
        margin-bottom: 0.5rem;
    }
    
    .fi-fo-field {
        margin-bottom: 0.75rem;
    }
}