/* =======================================
   1. RESET Y CONFIGURACIÓN BASE
   ======================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    /* Fuente utilizada en el archivo original */
    font-family: 'Poppins', sans-serif;
    background-color: #0d1117;
    color: #f0f6fc;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: opacity 0.8s ease;
}

/* Selección de texto personalizada */
::selection {
    background-color: rgba(88, 166, 255, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(88, 166, 255, 0.3);
    color: #ffffff;
}

/* =======================================
   2. PANTALLA DE CARGA (LOADER)
   ======================================= */
#loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.logo-cargando {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(88, 166, 255, 0.3);
    filter: drop-shadow(0 0 10px #ff6600); /* Color de sombra para el logo */
    box-shadow: 
        0 0 25px rgba(255, 255, 255, 0.1),
        0 0 50px rgba(88, 166, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: logoSpin 4s linear infinite, logoPulse 2s ease-in-out infinite alternate;
}

.loader-text {
    margin-top: 20px;
    font-size: 18px;
    color: #8b949e;
    font-weight: 600;
    letter-spacing: 1px;
    animation: textPulse 1.5s ease-in-out infinite alternate;
}

/* =======================================
   3. PANTALLA DE LOGIN (body.login-page)
   ======================================= */
body.login-page {
    /* Consolida los estilos de fondo y centrado */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: 
        linear-gradient(135deg, rgba(13, 17, 23, 0.95), rgba(22, 27, 34, 0.9)),
        url('../autos_atenas/assets/images/Auto_gris.jpg'); /* Asegúrate de que esta ruta sea correcta */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
    padding: 0;
    margin: 0;
    position: relative; /* Necesario para los pseudo-elementos */
}

/* Capa de efectos dinámicos (::before y ::after consolidados para limpieza) */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Combina los gradientes de ::before y ::after */
    background: 
        radial-gradient(circle at 20% 80%, rgba(88, 166, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(88, 166, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundDynamicFloat 25s ease-in-out infinite;
}

/* =======================================
   4. CONTENEDORES PRINCIPALES (General)
   ======================================= */

/* Contenedor principal de formularios (Registro, Cliente) */
.container {
    max-width: 1000px;
    margin: 50px auto; /* Centrado vertical y horizontal cuando no es login-page */
    padding: 30px;
    background-color: #1f2937; /* Fondo oscuro consistente */
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    width: 90%;
    color: #e5e7eb;
    animation: slideIn 0.6s ease;
}

/* Contenedor específico de Login/Registro */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    width: 360px;
    padding: 40px 20px;
    border-radius: 20px;
    background: rgba(13, 17, 23, 0.1);
    backdrop-filter: blur(8px); /* Aumento del blur para mejor efecto */
    box-shadow: 
        0 0 50px rgba(0, 0, 0, 0.5),
        inset 0 0 50px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: containerEntranceAnimated 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Caja del formulario de Login/Registro */
.login-box {
    background: rgba(25, 25, 25, 0.7); /* Ligeramente más transparente para ver el fondo */
    backdrop-filter: blur(6px);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(21, 101, 192, 0.3);
    padding: 30px;
    width: 90%;
    max-width: 320px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.5s ease-out;
}

/* Título dentro de login-box */
.login-box h1 {
    font-size: 1.7em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 2px 2px 5px #0d47a1;
    letter-spacing: 1px;
    text-align: center;
    animation: titleWelcome 2s ease-out;
}

/* Ícono de usuario */
.icono-usuario {
    font-size: 75px;
    margin-bottom: -5px;
    padding: 20px 0 10px;
    text-align: center;
    animation: fadeInDown 1.2s ease;
}

.icono-usuario i {
    background: linear-gradient(45deg, #2196f3, #64b5f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: userIconAnimation 4s ease-in-out infinite;
    filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.6));
}

/* Barra decorativa superior (Consolidada) */
.barra-superior {
    width: 220px;
    height: 6px;
    background: linear-gradient(to right, #0d47a1, #1976d2);
    border-radius: 8px;
    margin-top: 30px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(21, 101, 192, 0.9);
    animation: fadeInDown 1s ease, breatheBar 4s ease-in-out infinite;
}

/* Logo (Consolidado) */
.logo {
    text-align: center;
    padding: 10px 0 20px;
    animation: fadeInUp 2s ease-out;
}

.logo img {
    width: 550px;
    max-width: 100%;
    filter: drop-shadow(0 0 18px #0d47a1) brightness(1.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo img:hover {
    transform: scale(1.05) rotate(1deg);
    filter: drop-shadow(0 0 25px #2196f3) brightness(1.15);
}


/* =======================================
   5. ENCABEZADO (Header)
   ======================================= */
header {
    /* Consolida las reglas del header y la sección de header del final */
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363d;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    animation: headerSlideDown 0.8s ease-out;
}

header h1 {
    font-size: 26px;
    font-weight: 600;
    background: linear-gradient(45deg, #58a6ff, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 2s ease-in-out infinite alternate;
    position: relative;
}

header h2 {
    /* Usado para títulos como "Agregar Nuevo Auto" */
    margin: 0;
    font-size: 30px;
    color: #fff;
    letter-spacing: 2px;
}

header img {
    height: 60px;
    border-radius: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

header img:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(88, 166, 255, 0.4));
}

/* =======================================
   6. FORMULARIOS, INPUTS Y SELECTS
   ======================================= */

.form-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 28px;
    color: #3b82f6;
}

.client-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

/* Labels (Consolidado) */
.login-box label,
.form-group label,
.client-form label,
label {
    display: block;
    margin: 15px 0 5px 0; /* Unificar margen superior/inferior */
    font-weight: bold;
    color: #cbd5e1;
    text-align: left;
    font-size: 0.9em;
}

/* Inputs, Selects y Textareas (Consolidado y Unificado) */
.login-box input,
.client-form input,
.form-group input,
.form-group select,
.form-group textarea,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"], /* Añadido para consistencia */
input[type="date"] { /* Añadido para consistencia */
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: #f1f5f9;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    font-size: 0.92em;
    outline: none;
    box-shadow: inset 0 0 5px rgba(33, 150, 243, 0.1);
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box; /* Asegura que padding no afecte el ancho total */
}

/* Enfoque (Focus) Consolidado */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    background-color: #181818;
}

input::placeholder {
    color: #777;
}

/* =======================================
   7. BOTONES
   ======================================= */

/* Botones de Acción (Guardar/Registrar/Acceder) */
.register-button,
.login-box button,
.form-container button { /* Unificación de selectores para botones principales */
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, #0d47a1, #1976d2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    box-shadow: 0 6px 14px rgba(21, 101, 192, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    font-family: 'Poppins', sans-serif;
}

.register-button:hover,
.login-box button:hover,
.form-container button:hover {
    background: linear-gradient(to right, #1976d2, #0d47a1);
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(21, 101, 192, 0.7);
}


/* Botón de Regresar (Consolidado) */
.contenedor-boton-regresar {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 30px;
}

.boton-regresar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #1976d2;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.boton-regresar:hover {
    background-color: #0d47a1;
    transform: scale(1.05);
}

/* Enlace Olvidé Contraseña (Consolidado) */
.olvido-contraseña {
    margin-top: 15px;
    text-align: center;
}

.olvido-contraseña a {
    color: #64b5f6;
    font-size: 0.9em;
    text-decoration: none;
    transition: color 0.3s;
}

.olvido-contraseña a:hover {
    color: #bbdefb;
    text-decoration: underline;
}

/* =======================================
   8. TABLAS (Consolidado)
   ======================================= */

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    margin: 20px auto;
}

table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background-color: #111;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 14px 18px; /* Unifica padding de th y td */
    text-align: center;
    border-bottom: 1px solid #444;
    white-space: nowrap;
}

th {
    background-color: #000;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

td {
    color: #ccc;
    font-size: 14px;
}

tr:hover {
    background-color: #222;
}

tr.selected {
    background-color: #3b82f6;
    color: white;
}

/* =======================================
   9. CARRUSEL (Sin cambios mayores, solo limpieza)
   ======================================= */
.carrusel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 60px auto;
    max-width: 900px;
    padding: 0 80px;
    animation: containerFadeInUp 1s ease-out 0.5s both;
}

.carrusel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    perspective: 1000px;
}

.accion {
    background: linear-gradient(145deg, #21262d, #161b22);
    padding: 30px 25px;
    border-radius: 16px;
    width: 320px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 0 1px rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transform-style: preserve-3d;
}

.carrusel-btn {
    /* Corregido: La posición se define correctamente para evitar la redundancia y errores */
    background: linear-gradient(145deg, #21262d, #161b22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.carrusel-prev {
    left: -70px;
    animation: bounceLeft 2s ease-in-out infinite;
}

.carrusel-next {
    right: -70px;
    animation: bounceRight 2s ease-in-out infinite;
}

/* ERROR CORREGIDO: Línea redundante y con error de sintaxis eliminada:
   .carrusel-btn:hover i transform 
*/

/* =======================================
   10. ANIMACIONES (Todas consolidadas al final)
   ======================================= */
@keyframes logoSpin { to { transform: rotate(360deg); } }
@keyframes logoPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.2); }
}
@keyframes textPulse {
  0% { opacity: 0.4; transform: translateY(0px); }
  100% { opacity: 1; transform: translateY(-2px); }
}

@keyframes headerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes headerShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}
@keyframes titleGlow {
  from { filter: drop-shadow(0 0 5px rgba(88, 166, 255, 0.3)); }
  to { filter: drop-shadow(0 0 15px rgba(88, 166, 255, 0.8)); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes backgroundDynamicFloat {
  0% { transform: translateY(0px) scale(1) rotate(0deg); }
  50% { transform: translateY(-25px) scale(1.04) rotate(0deg); }
  100% { transform: translateY(0px) scale(1) rotate(0deg); }
}

@keyframes particleFloat {
  0% { transform: translateX(0px) translateY(0px) rotate(0deg); }
  33% { transform: translateX(-20px) translateY(-15px) rotate(120deg); }
  66% { transform: translateX(20px) translateY(-25px) rotate(240deg); }
  100% { transform: translateX(0px) translateY(0px) rotate(360deg); }
}

@keyframes neonRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes containerEntranceAnimated {
  0% { opacity: 0; transform: translateY(100px) scale(0.8) rotateX(15deg); filter: blur(10px); }
  50% { opacity: 0.7; transform: translateY(-10px) scale(1.05) rotateX(-5deg); filter: blur(2px); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateX(0deg); filter: blur(0px); }
}

@keyframes breatheBar {
  0%, 100% { box-shadow: 0 2px 12px rgba(21, 101, 192, 0.9); transform: scaleX(1); }
  50% { box-shadow: 0 2px 20px rgba(21, 101, 192, 1); transform: scaleX(1.05); }
}

@keyframes userIconAnimation {
  0%, 100% { transform: translateY(0px) scale(1); text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.6); }
  50% { transform: translateY(-12px) scale(1.1); text-shadow: 8px 8px 20px rgba(33, 150, 243, 1); }
}

@keyframes shimmerBox {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes titleWelcome {
  0% { opacity: 0; transform: translateY(-20px); text-shadow: 2px 2px 5px #0d47a1; }
  100% { opacity: 1; transform: translateY(0); text-shadow: 2px 2px 15px #0d47a1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes buttonPulse {
  0% { box-shadow: 0 6px 14px rgba(21, 101, 192, 0.5); transform: scale(1); }
  50% { box-shadow: 0 10px 25px rgba(21, 101, 192, 0.8); transform: scale(1.03); }
  100% { box-shadow: 0 6px 14px rgba(21, 101, 192, 0.5); transform: scale(1); }
}

@keyframes containerFadeInUp {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInScale {
  0% { opacity: 0; transform: translateX(-50px) scale(0.8) rotateY(-15deg); }
  50% { opacity: 0.7; transform: translateX(0) scale(1.1) rotateY(0deg); }
  100% { opacity: 1; transform: translateX(0) scale(1) rotateY(0deg); }
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1.3) rotateY(360deg); }
  50% { transform: scale(1.4) rotateY(180deg); }
}

@keyframes bounceLeft {
  0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) translateX(0); }
  40% { transform: translateY(-50%) translateX(-8px); }
  60% { transform: translateY(-50%) translateX(-4px); }
}

@keyframes bounceRight {
  0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) translateX(0); }
  40% { transform: translateY(-50%) translateX(8px); }
  60% { transform: translateY(-50%) translateX(4px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 0 rgba(88, 166, 255, 0); }
  50% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(88, 166, 255, 0.5); }
}

@keyframes slowRotateIn {
  0% { opacity: 0; transform: rotateY(-90deg) scale(0.9); }
  100% { opacity: 1; transform: rotateY(0deg) scale(1); }
}


/* =======================================
   11. RESPONSIVE DESIGN (Consolidado)
   ======================================= */

@media (max-width: 768px) {
    /* Header */
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    header h1 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    header h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    /* Carrusel */
    .carrusel-container {
        margin: 40px auto;
        padding: 0 15px;
    }

    .carrusel-btn {
        display: none;
    }

    .accion {
        /* Fuerza la visualización en móvil, desactiva el carrusel */
        display: block !important;
        margin-bottom: 25px;
        width: 100%;
        max-width: 350px;
        animation: slideInUp 0.8s ease-out !important;
    }

    .carrusel {
        flex-direction: column;
        gap: 20px;
    }
    
}
/* =======================================
   RESPONSIVE DESIGN (Revisión y Ajuste)
   ======================================= */

@media (max-width: 1024px) {
    /* Mantenemos 3 columnas para el formulario de auto en tablets (1024px) */
    .grid-form {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Para pantallas más pequeñas (tabletas verticales) */
    
    /* El formulario de auto (3 columnas) pasa a 2 columnas */
    .grid-form {
        grid-template-columns: 1fr 1fr; /* Pasa a 2 columnas */
    }

    /* El formulario de cliente (2 columnas) pasa a 1 columna */
    .client-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    /* Para móviles, forzamos ambos formularios a 1 columna */
    .grid-form,
    .client-form {
        grid-template-columns: 1fr;
    }
}