/* Animación TST */
.hero-title-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2.5rem;
}

/* Logo centrado */
.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenedor del texto */
.hero-title {
    position: relative;
    display: grid;
    place-items: center; /* CENTRO X + Y */
    min-height: 260px;
    text-align: left;
}

/* Ambos textos en la misma celda */
.tst-initials,
.tst-full {
    grid-area: 1 / 1;
}

/* === TST INTRO === */
.tst-initials {
    font-size: 5.5rem;
    letter-spacing: 0.25em;
    line-height: 1;
    transform-origin: center;
    animation: tstIntroCentered 1.4s ease forwards;
}

/* === TEXTO FINAL === */
.tst-full {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    animation: tstRevealCentered 1s ease forwards;
    animation-delay: 1.4s;
}

/* ===== ANIMACIONES CENTRADAS ===== */
@keyframes tstIntroCentered {
    0% {
        opacity: 0;
        transform: scale(1.4);
        filter: blur(10px);
    }
    60% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.85);
    }
}

@keyframes tstRevealCentered {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación de entrada de elementos */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación de hover en botones */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-hover-effect:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Animación de loading para formularios */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animación de pulse para elementos importantes */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 174, 154, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(63, 174, 154, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(63, 174, 154, 0);
    }
}

/* Animación de slide-in para mobile menu */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-out-right {
    animation: slideOutRight 0.5s ease-in;
}

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

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

/* Animación de shake para errores */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Transiciones suaves para imágenes */
.img-scale {
    transition: transform 0.5s ease;
}

.img-scale:hover {
    transform: scale(1.05);
}

/* Animación de fade-in escalonado */
.stagger-child > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInStagger 0.5s ease forwards;
}

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

/* === SPLASH SCREEN === */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #2d3a4a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.splash-logo img {
    width: 120px;
    height: 120px;
    animation: splashPulse 2s ease-in-out infinite;
}

@keyframes splashPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(63, 174, 154, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 40px rgba(63, 174, 154, 0.8));
    }
}

.splash-text {
    margin-top: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: #fff;
    overflow: hidden;
}

.splash-text span {
    display: inline-block;
    animation: splashLetter 0.8s ease forwards;
    opacity: 0;
    transform: translateY(50px);
}

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

.splash-tagline {
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5em;
    opacity: 0;
    animation: splashFadeIn 1s ease forwards;
    animation-delay: 2s;
}

@keyframes splashFadeIn {
    to {
        opacity: 1;
    }
}

.splash-spinner {
    position: absolute;
    bottom: 60px;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(63, 174, 154, 0.2);
    border-top-color: #3fae9a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.splash-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(63, 174, 154, 0.6);
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* === SPLASH SCREEN RESPONSIVE === */
@media (max-width: 768px) {
    .splash-logo img {
        width: 80px;
        height: 80px;
    }

    .splash-text {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }

    .splash-tagline {
        font-size: 0.75rem;
        letter-spacing: 0.3em;
    }

    .splash-spinner {
        width: 30px;
        height: 30px;
        bottom: 40px;
    }
}

@media (max-width: 480px) {
    .splash-logo img {
        width: 60px;
        height: 60px;
    }

    .splash-text {
        font-size: 1.2rem;
        letter-spacing: 0.15em;
    }

    .splash-tagline {
        font-size: 0.65rem;
        letter-spacing: 0.2em;
        text-align: center;
        padding: 0 20px;
    }

    .splash-spinner {
        width: 25px;
        height: 25px;
        bottom: 30px;
    }
}