/* Estilos de la sección contact. Todo va dentro de .app-contact-form para no chocar con otras secciones. */

.app-contact-form {
    display: block;
    padding: 3rem 1.5rem;
}

.app-contact-form .contact {
    --brand: #6ea89f;
    --brand-dark: #2f6f65;
    position: relative;
    isolation: isolate;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    background: #3f5a57;
    border-radius: 36px;
    box-shadow: 0 40px 80px -40px rgba(10, 30, 28, 0.6);
}

/* ---------- Video de fondo ---------- */

.app-contact-form .bg {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.app-contact-form .bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 20% center;
    /* mantiene los dientes visibles a la izquierda */
}

/* Degradado: más oscuro a la derecha para dar contraste al vidrio */

.app-contact-form .overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(15, 40, 38, 0) 35%, rgba(15, 40, 38, 0.55) 100%),
        linear-gradient(0deg, rgba(15, 40, 38, 0.45) 0%, transparent 40%);
}

/* ---------- Layout ---------- */

.app-contact-form .contact__inner {
    display: grid;
    grid-template-columns: 1fr minmax(340px, 440px);
    gap: 2rem;
    align-items: center;
    min-height: 560px;
    margin: 0 auto;
    padding: 2.5rem 2.5rem;
}

/* ---------- Píldoras de la izquierda ---------- */

.app-contact-form .perks {
    align-self: end;
    display: grid;
    gap: 0.75rem;
    justify-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-contact-form .perks li {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 40, 38, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: contact-form-bob 5s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -1.4s);
}

.app-contact-form .perks svg {
    flex: none;
    padding: 3px;
    background: var(--brand);
    border-radius: 50%;
}

/* ---------- Tarjeta de vidrio ---------- */

.app-contact-form .card {
    padding: 1.75rem 1.2rem;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 32px;
    box-shadow: 0 40px 80px -30px rgba(10, 30, 28, 0.6);
    animation: contact-form-fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.app-contact-form .eyebrow {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-dark);
    background: color-mix(in srgb, var(--brand) 22%, #fff);
    border-radius: 999px;
}

.app-contact-form h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.2rem, 2.2vw, 2.2rem);
    font-weight: 400;
    line-height: 1.15;
    color: #223746;
    font-family: "Special Gothic Condensed One", sans-serif;
}

.app-contact-form .lead {
    color: #223746;
    font-size: 14px;
}

.app-contact-form .field {
    display: flex;
    flex-direction: column;
    margin-bottom: .5rem;
}

.app-contact-form label {
    margin-bottom: 0.1rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1e293b;
}

.app-contact-form input,
.app-contact-form textarea {
    padding: 0.5rem 0.4rem;
    font: inherit;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(100, 116, 139, 0.45);
    border-radius: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

.app-contact-form input:focus-visible,
.app-contact-form textarea:focus-visible {
    outline: none;
    background: #fff;
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent);
}

.app-contact-form input[aria-invalid='true'],
.app-contact-form textarea[aria-invalid='true'] {
    border-color: #b91c1c;
    background: #fef2f2;
}

/* ---------- Botón ---------- */

.app-contact-form .submit {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem 1.75rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--brand-dark) 80%, transparent);
    transition: transform 0.3s ease;
}

.app-contact-form .submit svg {
    transition: transform 0.3s ease;
}

.app-contact-form .submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: contact-form-shine 4.5s ease-in-out infinite;
}

.app-contact-form .submit:hover:not(:disabled) {
    transform: translateY(-2px);
}

.app-contact-form .submit:hover:not(:disabled) svg {
    transform: translateX(4px);
}

.app-contact-form .submit:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}

.app-contact-form .submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.app-contact-form .spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: contact-form-spin 0.8s linear infinite;
}

.app-contact-form .error {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: #b91c1c;
}

.app-contact-form .success {
    margin: 1rem 0 0;
    font-weight: 600;
    color: #166534;
}

/* ---------- Botón pausa ---------- */

.app-contact-form .video-toggle {
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    cursor: pointer;
    background: rgba(15, 40, 38, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: background 0.2s ease;
}

.app-contact-form .video-toggle:hover {
    background: rgba(15, 40, 38, 0.7);
}

.app-contact-form .video-toggle:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}

/* ---------- Animaciones ---------- */

@keyframes contact-form-fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

@keyframes contact-form-shine {
    0%, 60% {
        left: -120%;
    }
    100% {
        left: 160%;
    }
}

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

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .app-contact-form .contact__inner {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 4rem 1.25rem;
    }

    .app-contact-form .perks {
        order: 2;
        align-self: start;
    }

    .app-contact-form .overlay {
        background: linear-gradient(0deg, rgba(15, 40, 38, 0.55), rgba(15, 40, 38, 0.2));
    }

    .app-contact-form .bg video {
        object-position: 25% center;
    }

}

/* ---------- Sin movimiento: se muestra solo el poster ---------- */

@media (prefers-reduced-motion: reduce) {
    .app-contact-form .bg video,
    .app-contact-form .video-toggle {
        display: none;
    }

    .app-contact-form .bg {
        background: #3f5a57 url('../assets/images/contact/poster.webp') 20% center / cover no-repeat;
    }

    .app-contact-form *,
    .app-contact-form *::before,
    .app-contact-form *::after {
        animation: none !important;
        transition: none !important;
    }

}

/* ---------- Estados controlados desde js/contact.js ---------- */
.app-contact-form .submit .spinner,
.app-contact-form .submit .txt-loading {
    display: none;
}

.app-contact-form .submit.is-loading .spinner {
    display: block;
}

.app-contact-form .submit.is-loading .txt-loading {
    display: inline;
}

.app-contact-form .submit.is-loading .txt-idle,
.app-contact-form .submit.is-loading .arrow {
    display: none;
}

.app-contact-form .video-toggle .icon-play,
.app-contact-form .video-toggle.is-paused .icon-pause {
    display: none;
}

.app-contact-form .video-toggle.is-paused .icon-play {
    display: block;
}
