html { 
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html * {
    font-family: 'Raleway', sans-serif;
}

/* ===================== KEYFRAMES - ANIMACIONES GLOBALES ===================== */

/* Fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Hover animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-2deg);
    }
    75% {
        transform: rotate(2deg);
    }
}

/* Glow animations */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(232, 96, 10, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 15px rgba(232, 96, 10, 0.5), 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Underline animations */
@keyframes slideUnderline {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Flip animation */
@keyframes flip {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

/* ===================== UTILITY ANIMATION CLASSES ===================== */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

.animate-bounce-slow {
    animation: bounce 2s ease-in-out infinite;
}

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

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-flip {
    animation: flip 0.8s ease-in-out;
}

/* Curva SVG hero */
.hero-wave { 
    position: absolute; 
    bottom: -2px; 
    left: 0; 
    width: 100%; 
    animation: fadeIn 1s ease-out 0.3s both;
}
 
/* Línea subrayado título sección */
.section-title {
    animation: fadeInUp 0.6s ease-out;
}

.section-title::after {
    content: '';
    display: block;
    width: 164px;
    height: 2px;
    background: #ffd230;
    margin-top: 1.5rem;
    /* animation: slideUnderline 0.8s ease-out 0.2s both; */
    transform-origin: left;
}

/* Tab activo - Enhanced animations */
.tab-btn.active {
    background-color: #E8600A;
    color: white;
    animation: scaleIn 0.3s ease-out;
}

.tab-btn {
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s ease;
}

.tab-btn:not(.active):hover {
    background-color: #fde0cc;
    transform: translateY(-2px);
}

.tab-btn:active {
    transform: scale(0.98);
}

/* Panel calculadora */
.calc-panel { 
    display: none;
    opacity: 0;
}

.calc-panel.active { 
    display: flex;
    animation: fadeIn 0.4s ease-out;
    opacity: 1;
}

/* Input personalizado - Enhanced */
.calc-input {
    border: 2px solid #ED740B;
    padding: 8px 12px;
    width: 100%;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                background-color 0.2s ease;
    background-color: white;
    border-radius: 8px;
}

.calc-input:focus { 
    border-color: #E8600A;
    box-shadow: 0 0 0 3px rgba(232, 96, 10, 0.1);
    background-color: #fffbf7;
}

.calc-input:hover:not(:focus) {
    border-color: #F07A2A;
}

/* Resultado IMC colores */
.result-box { 
    border-left: 4px solid #ffd230;
    animation: fadeInLeft 0.5s ease-out;
    padding-left: 12px;
}

/* Card hover - Enhanced */
.material-card {
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    border: 1px solid rgba(232, 96, 10, 0.1);
    animation: fadeInUp 0.6s ease-out;
}

.material-card:hover { 
    box-shadow: 0 12px 32px rgba(232, 96, 10, 0.15);
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(232, 96, 10, 0.3);
}

.material-card:active {
    transform: translateY(-4px) scale(1);
}

/* Carousel */
.carousel-track { 
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-track img,
.carousel-track a {
    -webkit-user-drag: none;
    user-drag: none;
}

.carousel-track.is-dragging {
    cursor: grabbing;
    transition: none;
}

.carousel-track.is-dragging a,
.carousel-track.is-dragging button {
    pointer-events: none;
}

/* Miniaturas de video: overlay naranja + play */
.video-thumb {
    position: relative;
    /* display: block; */
    overflow: hidden;
    border-radius: 0.5rem;
}

.video-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(232, 96, 10, 0.5);
    z-index: 1;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.video-thumb:hover::before {
    background-color: rgba(232, 96, 10, 0.65);
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.video-play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.5rem 0 0.5rem 0.85rem;
    border-color: transparent transparent transparent #E8600A;
}

.video-thumb:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.08);
    background-color: #fff;
}

@media (min-width: 768px) {
    .video-play-btn {
        width: 3.5rem;
        height: 3.5rem;
    }

    .video-play-btn::after {
        border-width: 0.65rem 0 0.65rem 1.1rem;
    }
}

@media (min-width: 1024px) {
    .video-play-btn {
        width: 4.5rem;
        height: 4.5rem;
    }

    .video-play-btn::after {
        border-width: 0.85rem 0 0.85rem 1.4rem;
    }
}

/* Scroll-reveal - Enhanced */
.reveal { 
    opacity: 0; 
    transform: translateY(30px); 
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible { 
    opacity: 1; 
    transform: none; 
}

/* Decorative blob hero */
.blob {
    position: absolute;
    border-radius: 50% 60% 40% 70% / 60% 40% 70% 50%;
    animation: fadeInUp 0.8s ease-out;
}

/* ===================== BUTTON ANIMATIONS ===================== */

/* Botones generales - Enhanced */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* button:hover {
    transform: translateY(-2px);
} */

button:active {
    transform: translateY(1px);
}

/* Botón naranja especial */
.bg-naranja, 
.bg-naranja-claro {
    position: relative;
    overflow: hidden;
}

.bg-naranja:hover,
.bg-naranja-claro:hover {
    box-shadow: 0 8px 20px rgba(232, 96, 10, 0.3);
}

/* Efecto ripple en botones */
/* button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
} */

button:active::before {
    width: 300px;
    height: 300px;
}

/* Navbar active link */
nav a {
    position: relative;
    transition: color 0.3s ease;
}

/* nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffd230;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
} */

nav a:hover::after {
    width: 100%;
}

nav a.nav-active { 
    color: #E8600A; 
    border-bottom: 2px solid #E8600A; 
}

/* ===================== MENU ANIMATIONS ===================== */

/* Menú móvil - Enhanced */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 320px;
    opacity: 1;
}

#mobile-menu button {
    animation: fadeInUp 0.3s ease-out;
}

/* Hamburguesa → X animada */
#hamburger-btn {
    transition: background 0.3s ease;
}

#hamburger-btn:hover {
    background-color: rgba(232, 96, 10, 0.1);
}

#hamburger-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: #2D5A4E;
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease;
    transform-origin: center;
}

#hamburger-icon.open span:nth-child(1) { 
    transform: translateY(8px) rotate(45deg); 
}

#hamburger-icon.open span:nth-child(2) { 
    opacity: 0; 
    transform: scaleX(0); 
}

#hamburger-icon.open span:nth-child(3) { 
    transform: translateY(-8px) rotate(-45deg); 
}

/* ===================== MODAL ANIMATIONS ===================== */

/* Video Modal */
#video-modal {
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(5px);
}

#video-modal.hidden {
    animation: fadeIn 0.3s ease-out reverse;
    display: none !important;
}

#video-modal.flex {
    display: flex !important;
}

/* Botón de cerrar mejorado - Video Modal */
.close-video-btn {
    animation: fadeInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: absolute;
    top: -24px;
    right: -24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #E8600A;
    color: white;
    font-size: 32px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(232, 96, 10, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.close-video-btn:hover {
    background-color: #F07A2A;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 8px 25px rgba(232, 96, 10, 0.6);
}

.close-video-btn:active {
    transform: scale(1.05) rotate(90deg);
}

.close-video-btn:focus {
    outline: 3px solid rgba(232, 96, 10, 0.3);
    outline-offset: 2px;
}

/* Responsive - Botón cerrar video mobile */
@media (max-width: 640px) {
    .close-video-btn {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 28px;
        box-shadow: 0 2px 10px rgba(232, 96, 10, 0.3);
    }
}

/* Questionnaire Modal */
#questionnaire-modal {
    animation: fadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(5px);
}

#questionnaire-modal.hidden {
    display: none !important;
}

#questionnaire-modal.flex {
    display: flex !important;
}

#questionnaire-modal > div {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#questionnaire-modal .questionnaire-shell {
    background: #FFF5ED;
    border-top: 15px solid #ED740B;
    box-shadow: 0 24px 45px rgba(15, 23, 42, 0.12);
    scrollbar-width: thin;
    scrollbar-color: #ED740B #FFF5ED;
}

#questionnaire-modal .questionnaire-shell::-webkit-scrollbar {
    width: 10px;
}

#questionnaire-modal .questionnaire-shell::-webkit-scrollbar-track {
    background: #FFF5ED;
    border-radius: 999px;
}

#questionnaire-modal .questionnaire-shell::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ED740B 0%, #F7C101 100%);
    border-radius: 999px;
    border: 2px solid #FFF5ED;
}

#questionnaire-modal .questionnaire-shell::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #E8600A 0%, #E5B400 100%);
}

#questionnaire-modal .questionnaire-close-btn {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #374151;
}

#questionnaire-form .questionnaire-card {
    border-bottom: 2px solid #F7C101;
}

#questionnaire-form .questionnaire-options {
    gap: 0.5rem;
}

#questionnaire-form .questionnaire-option {
    /* border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #fff; */
    font-weight: bold;
    padding: 0.45rem 0.8rem;
    transition: all 0.2s ease;
    flex-direction: row-reverse;
}

#questionnaire-form .questionnaire-option:hover {
    border-color: #E8600A;
    background: #fffaf6;
    transform: translateY(-1px);
}

#questionnaire-form .questionnaire-option input {
    accent-color: #E8600A;
}

#questionnaire-form button {
    box-shadow: 0 10px 18px rgba(13, 27, 41, 0.14);
}

#questionnaire-form button.bg-naranja:hover {
    transform: translateY(-2px);
}

/* #questionnaire-result {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(240, 253, 244, 0.95));
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
} */

/* Estilos para inputs y selects de la modal - Enhanced */
#questionnaire-form input[type="text"],
#questionnaire-form input[type="tel"],
#questionnaire-form select {
    background-color: white;
    border: 2px solid #ED740B;
    padding: 12px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-family: 'Raleway', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#questionnaire-form input[type="text"]::placeholder,
#questionnaire-form input[type="tel"]::placeholder {
    color: #9ca3af;
    transition: color 0.3s ease;
}

#questionnaire-form input[type="text"]:focus,
#questionnaire-form input[type="tel"]:focus,
#questionnaire-form select:focus {
    outline: none;
    border-color: #E8600A;
    box-shadow: 0 0 0 4px rgba(232, 96, 10, 0.15);
    background-color: #fffbf7;
    transform: translateY(-2px);
}

#questionnaire-form select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#questionnaire-form div {
    animation: fadeInUp 0.5s ease-out backwards;
}

#questionnaire-form div:nth-child(1) { animation-delay: 0.1s; }
#questionnaire-form div:nth-child(2) { animation-delay: 0.2s; }
#questionnaire-form div:nth-child(3) { animation-delay: 0.3s; }
#questionnaire-form div:nth-child(4) { animation-delay: 0.4s; }
#questionnaire-form div:nth-child(5) { animation-delay: 0.5s; }
#questionnaire-form div:nth-child(6) { animation-delay: 0.6s; }

/* Botón X para cerrar modal */
#questionnaire-modal button[onclick*="closeQuestionnaireModal"]:first-of-type,
#video-modal button[onclick*="closeVideoModal"] {
    padding: 0;
    /* width: auto;
    height: auto; */
    font-size: 28px;
    line-height: 1;
    color: #ffffff;
    transition: all 0.3s ease;
    background: #ED740B;
    border: none;
}

#questionnaire-modal button[onclick*="closeQuestionnaireModal"]:first-of-type:hover,
#video-modal button[onclick*="closeVideoModal"]:hover {
    color: #4b5563;
    transform: rotate(90deg) scale(1.1);
}

/* Form buttons - Enhanced */
#questionnaire-form button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#questionnaire-form button.bg-naranja {
    box-shadow: 0 4px 15px rgba(232, 96, 10, 0.2);
}

#questionnaire-form button.bg-naranja:hover {
    box-shadow: 0 6px 25px rgba(232, 96, 10, 0.35);
    transform: translateY(-3px);
}

#questionnaire-form button.bg-gray-400 {
    transition: all 0.3s ease;
}

#questionnaire-form button.bg-gray-400:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Error message animation */
#form-error-message {
    animation: fadeInUp 0.3s ease-out;
    transition: all 0.3s ease;
}

/* Imagen de divisor*/
.img-divisor {
    margin-top: -9rem;
    animation: fadeIn 1s ease-out 0.5s both;
}

/* ===================== CAROUSEL DOTS & CONTROLS ===================== */

.mat-dot, .vid-dot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mat-dot:hover, .vid-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(232, 96, 10, 0.4);
}

.mat-dot.bg-naranja, .vid-dot.bg-naranja {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(232, 96, 10, 0.5);
}

/* ===================== HEADER ANIMATIONS ===================== */

header {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

header nav a {
    position: relative;
}

header nav a:hover {
    color: #ffd230;
}

/* ===================== SECTION ANIMATIONS ===================== */

section {
    animation: fadeInUp 0.8s ease-out;
}

/* Estilo para imágenes */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* img:hover {
    opacity: 0.95;
} */

/* ===================== LINK HOVER EFFECTS ===================== */

a {
    transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

a.hover\:text-yellow-300:hover,
a:hover {
    color: #ffd230;
}

/* ===================== RESPONSIVE ADJUSTMENTS ===================== */

@media screen and (max-width: 1250px) {
    .img-divisor {
        margin-top: -6rem;
    }
}

@media screen and (max-width: 950px) {
    .img-divisor {
        margin-top: -4rem;
    }
}

/* ===================== MICRO-INTERACTIONS ===================== */

/* Efecto de pulse para elementos interactivos */
.pulse-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Zoom suave al cargar */
.zoom-in {
    animation: scaleIn 0.6s ease-out;
}

/* Desvanecimiento suave */
.fade-in-delayed {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Bounce suave */
.bounce-in {
    animation: fadeInUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Wiggle para atención */
.wiggle-on-hover:hover {
    animation: wiggle 0.5s ease-in-out;
}

/* Underline deslizante */
a.underline-animated {
    position: relative;
}

/* a.underline-animated::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffd230;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
} */

a.underline-animated:hover::after {
    width: 100%;
}

/* ===================== SMOOTH TRANSITIONS ===================== */

* {
    scroll-behavior: smooth;
}

input, select, textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.2s ease;
}

