:root {
    /* Paleta de Colores Principales */
    --color-base: #4a618a;
    --color-base-light: #1E2D3B; /* Para hover en header */
    --color-link-default: #0071c1;
    --color-texto-tab: #444;
    --color-fondo-blanco-opaco: rgba(255, 255, 255, 0.75);
    /* Colores de Botones y Enfasis Primario */
    --color-btn-primario-fondo: #1b6ec2;
    --color-alerta-success: #26b050; /* Valid */
    --color-alerta-error: red; /* Invalid & Validation Message */
    /* Gradientes del Header Sticky */
    --gradiente-sticky-base: linear-gradient( 270deg, #4a618a, #566f9c, #3f567d, #1E2D3B );
    /* Medidas y Sombras */
    --border-radius-base: 10px;
    --box-shadow-card: 0 10px 25px rgba(0, 0, 0, 0.3);
    --box-shadow-focus: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    --tab-bar-height: 70px;
}

/* --- Estilos Generales --- */

html, body, #app {
    /* Background */
    min-height: 100vh;
    height: auto !important;
    margin: 0;
}

    body.login-background {
        /*        background: url('/bg.jpg') no-repeat center center fixed;*/
        /*background-size: cover;*/
        background-color: var(--color-base-light)
    }

/* Establecer el tamaño base en el HTML */
html {
    font-size: 15px;
}

/* Estilos generales para todo el sitio */
body {
    font-size: 1rem;
}

h1 {
    font-size: 2rem;
}

p, .btn {
    font-size: 1rem;
}

html, body {
    font-family: 'Inter', sans-serif;
}

h1:focus {
    outline: none;
}

.btn {
    border-radius: var(--border-radius-base);
}

.btn-animado {
    /* Usamos tu gradiente base */
    background: var(--gradiente-sticky-base);
    background-size: 100% 100%;
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;

    transition: all 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, background 1s linear;
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
}

/* El efecto al hacer Hover */
.btn-animado:hover:not(:disabled) {
    filter: brightness(1.2) saturate(1.1);
    background-position: right center;
    box-shadow: 0 8px 20px rgba(30, 45, 59, 0.4);
    transform: translateY(-1px);
}

/* Efecto de "click" */
.btn-animado:active {
    transform: translateY(1px);
    filter: brightness(0.9);
}

/* Estado deshabilitado */
.btn-animado:disabled {
    background: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.titulo {
    color: var(--color-base);
    font-size: 18px;
}

a, .btn-link {
    color: var(--color-link-default);
}

.content {
    padding-top: 1.1rem;
}


/* Animación de vibración más sutil */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos base para inputs  */
.form-control, .form-select {
    border-radius: var(--border-radius-base); 
    border: 1.5px solid #e9ecef;
    transition: all 0.2s ease-in-out;
}

/* --- ESTADO VÁLIDO (Verde Menta Pastel) --- */
.valid.modified:not([type=checkbox]) {
    border-color: #a7f3d0 !important; /* Verde menta suave */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23059669' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.3rem) center;
    background-size: 1.2rem;
}

.form-control.valid:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15); /* Brillo más aireado */
}

/* --- ESTADO INVÁLIDO  --- */
.form-control.invalid, .form-select.invalid {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #fecaca !important; /* Rojo pastel */
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1);
}

    .form-control.invalid:focus {
        border-color: #f87171 !important;
        box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
    }

/* --- MENSAJE DE VALIDACIÓN --- */
.validation-message {
    color: #dc2626; 
    font-size: 0.825rem;
    font-weight: 500;
    margin-top: 5px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

    /* Opcional: Agregar un pequeño punto o icono antes del texto de error */
    .validation-message::before {
        content: '•';
        margin-right: 6px;
        font-size: 1.2rem;
    }

/* --- Media Queries (Valores en rem ya están relativos a la base) --- */

@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    p, .btn {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    p, .btn {
        font-size: 0.8rem;
    }
}

/* --- 404 Not Found --- */

#notfound {
    font-family: 'Roboto', sans-serif;
    text-align: center;
    background-color: inherit;
    color: #333;
    padding: 50px;
}

    #notfound .container {
        max-width: 800px;
        margin: 0 auto;
    }

    #notfound h1 {
        font-size: 120px;
        color: #e74c3c;
        margin: 0;
    }

    #notfound p {
        font-size: 24px;
    }

    #notfound .button {
        display: inline-block;
        padding: 10px 20px;
        font-size: 18px;
        color: #fff;
        background-color: #3498db;
        text-decoration: none;
        border-radius: var(--border-radius-base);
        margin-top: 20px;
    }

        #notfound .button:hover {
            background-color: #2980b9;
        }

/* --- Card --- */

.card {
    height: 100%;
    margin: 2px;
    display: flex;
    flex: 1 1 auto;
    border-radius: 0.9rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-top: 0;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
    background: inherit;
    position: relative;
}

/* Imagen dentro de la card */
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

    /* Shine animado encima de la imagen */
    .card::after {
        content: "";
        position: absolute;
        top: 0;
        left: -75%;
        width: 50%;
        height: 100%;
        background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
        transform: skewX(-25deg);
        opacity: 0.1;
        pointer-events: none;
        animation: shine 4s infinite;
    }

/* Shine animado */
@keyframes shine {
    0% {
        left: -75%;
    }

    100% {
        left: 125%;
    }
}

/* Hover: eleva la card y aumenta sombra */
.card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.14);
}


/* --- Header Sticky --- */

.header-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 9px 15px;
    background: rgba(75, 0, 130, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30), /* sombra inferior más profunda */
    0 0 12px rgba(0, 0, 0, 0.25), /* halo difuso alrededor */
    0 0 2px rgba(255, 255, 255, 0.10) inset; /* leve brillo interior */

    border-bottom: 1px solid rgba(255,255,255,0.25);
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 1000;
    font-weight: 600;
    transition: all 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, background 1s linear;
    pointer-events: auto;
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
    background-image: var(--gradiente-sticky-base);
}

/* Gradiente animado */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Efecto al hacer scroll */
.header-sticky.scrolled {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
}

/* Títulos y textos con glow */
.header-sticky h1, .header-sticky h2, .header-sticky h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.3);
}

/* Botones e íconos con glow al hover */
.header-sticky .btn, .header-sticky .icon {
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

    .header-sticky .btn:hover, .header-sticky .icon:hover {
        transform: scale(1.1);
        color: var(--color-base-light);
        text-shadow: 0 0 10px var(--color-base-light), 0 2px 6px rgba(0,0,0,0.3);
    }

/* --- Tab Bar (Navegación Inferior) --- */

.tab-bar {
    display: grid;
    /* Esto hace que cada hijo ocupe una fracción igual automáticamente */
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    background-color: var(--color-fondo-blanco-opaco);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--tab-bar-height); /* Altura fija para consistencia */

    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    border-top: 1px solid rgba(255, 255, 255, 0.3); /* Borde sutil superior */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 0 10px;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #8E8E93; /* Color iOS style para estado inactivo */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
}

    .tab-item .icon {
        font-size: 1.3rem;
        margin-bottom: 4px;
        transition: transform 0.3s ease;
    }

    .tab-item .label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Efecto de Interacción Pro */
    .tab-item:active {
        transform: scale(0.92);
    }

    .tab-item.active {
        color: var(--color-base);
    }

    /* Indicador Minimalista Superior */
    .tab-item::before {
        content: '';
        position: absolute;
        top: 0;
        width: 0;
        height: 3px;
        background-color: var(--color-base);
        border-radius: 0 0 4px 4px;
        transition: width 0.3s ease;
    }

    .tab-item.active::before {
        width: 30px;
    }

    /* Eliminamos el punto inferior anterior para limpiar el diseño */
    .tab-item::after {
        display: none;
    }

/* --- Botón de Subir (Scroll to Top) --- */

#boton-subir {
    /* Posicionamiento */
    position: fixed;
    bottom: calc(var(--tab-bar-height) + 15px); /* Un poco más de aire */
    right: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    background: rgba(255, 255, 255, 0.1); /* Fondo casi invisible */
    backdrop-filter: blur(8px); /* Efecto cristal (frosted glass) */
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-base); /* El texto/icono toma el color de tu marca */
    border: 2px solid var(--color-base); /* El contorno clave */
    /* Dimensiones y Forma */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    /* Suavidad */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    #boton-subir:hover {
        transform: translateY(-1px); /* Pequeño salto hacia arriba */
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    }

/* --- Autocompletar --- */

.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 2px;
    padding: 0;
    list-style-type: none;
    z-index: 1100;
}

    .autocomplete-suggestions li {
        padding: 5px;
        cursor: pointer;
    }

        .autocomplete-suggestions li:hover {
            background-color: var(--color-base);
            color: white;
        }