/* ==========================================================================
   HEON - Landing "Tu depa en cuotas" - v02
   Variante: todo el diseño contenido en una tarjeta centrada (máx 1400px)
   ========================================================================== */

:root {
    --primary: #23434A;
    --secondary: #294C4B;
    --accent: #C9831F;
    --light: #F5F5F3;
    --text: #263E45;

    --card-bg: #1F3D47;
    --input-bg: #F4F5F4;
    --input-placeholder: #9AA5A8;
    --success-bg: #E7F6EC;
    --success-text: #2E7D4F;
    --error-bg: #FDECEC;
    --error-text: #C0392B;

    --page-bg: #E9EBE4;
    --header-h: 90px;
    --radius-card: 35px;
}

/* ---------- Reset básico ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Montserrat", "Helvetica Neue", Arial, Helvetica, sans-serif;
    background-color: var(--page-bg);
    color: var(--text);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    padding: 48px 24px;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

/* Etiqueta accesible oculta visualmente */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   TARJETA CENTRAL
   ========================================================================== */
.landing-card {
    width: 100%;
    max-width: 1400px;
    margin: auto;
    background-color: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(23, 42, 48, 0.25);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    background-color: var(--secondary);
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px 0 30px;
}

.site-header .logo {
    height: 52px;
    width: auto;
}

.header-slogan {
    color: #F4F6F5;
    font-size: 34px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    background-color: #fff;
}

/* Fondo fotográfico */
.hero-media {
    position: absolute;
    inset: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

/* Overlay degradado para legibilidad del texto */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.65) 42%,
        rgba(255, 255, 255, 0.05) 72%,
        rgba(255, 255, 255, 0) 100%
    );
}

/* Patrón geométrico sutil (abajo-izquierda) */
.hero-deco-pattern {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 310px;
    height: auto;
    pointer-events: none;
}

/* Línea punteada sutil cerca del borde inferior derecho */
.hero-deco-dots {
    position: absolute;
    right: 14px;
    bottom: 24px;
    width: 4px;
    height: 220px;
    background-image: radial-gradient(circle, rgba(35, 67, 74, 0.35) 1.5px, transparent 1.6px);
    background-size: 4px 14px;
    background-repeat: repeat-y;
    pointer-events: none;
}

/* Contenido textual del hero */
.hero-content {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(100% - 560px);
    display: flex;
    align-items: center;
    padding-left: 60px;
}

.hero-text {
    max-width: 620px;
}

/* Icono de dos flechas hacia abajo */
.hero-chevrons {
    display: block;
    width: 46px;
    height: 52px;
    margin-bottom: 26px;
}

.hero-title {
    font-size: 46px;
    font-weight: 500;
    line-height: 1.12;
    color: var(--primary);
    margin-bottom: 22px;
}

.hero-title b {
    font-weight: 800;
}

.hero-sub {
    font-size: 27px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--secondary);
    margin-bottom: 26px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    height: 40px;
    padding: 0 26px;
    border-radius: 999px;
}

/* ==========================================================================
   TARJETA DE FORMULARIO
   ========================================================================== */
.form-card {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    background-color: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 44px 46px 46px;
    box-shadow: 0 18px 45px rgba(23, 42, 48, 0.28);
}

.form-title {
    color: #fff;
    font-size: 30px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 30px;
}

/* Campos */
.form-group {
    margin-bottom: 18px;
}

.form-input {
    width: 100%;
    height: 52px;
    background-color: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-input::placeholder {
    color: var(--input-placeholder);
}

.form-input:focus {
    border-color: var(--accent);
    background-color: #fff;
}

/* Estado de error de validación (JS) */
.form-input.is-invalid {
    border-color: #D9534F;
    background-color: #FFF6F6;
}

/* Selección de tipología */
.tipologia-label {
    display: block;
    text-align: center;
    color: #C7D2D5;
    font-size: 17px;
    font-weight: 500;
    margin: 26px 0 14px;
}

.tipologia-options {
    display: flex;
    justify-content: center;
    gap: 42px;
    margin-bottom: 30px;
}

.tipologia-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tipologia-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.tipologia-option img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tipologia-option .tipologia-name {
    color: #E8EDEC;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

/* Punto indicador bajo el nombre */
.tipologia-option .tipologia-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #E8EDEC;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Estado seleccionado */
.tipologia-option input[type="radio"]:checked ~ img {
    opacity: 1;
    transform: scale(1.05);
}

.tipologia-option input[type="radio"]:checked ~ .tipologia-name {
    color: #fff;
    font-weight: 700;
}

.tipologia-option input[type="radio"]:checked ~ .tipologia-dot {
    background-color: var(--accent);
    transform: scale(1.35);
}

/* Foco accesible */
.tipologia-option input[type="radio"]:focus-visible ~ img {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Botón enviar */
.form-submit {
    display: block;
    width: 220px;
    margin: 0 auto;
    height: 54px;
    background-color: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: filter 0.25s ease, transform 0.15s ease;
}

.form-submit:hover:not(:disabled) {
    filter: brightness(1.08);
}

.form-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Mensajes de feedback */
.form-feedback {
    display: none;
    margin-top: 22px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
}

.form-feedback.is-visible {
    display: block;
}

.form-feedback.is-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    white-space: pre-line;
}

.form-feedback.is-error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

/* Estado de éxito: se oculta el formulario y se muestra el mensaje */
.form-card.is-sent .contact-form {
    display: none;
}

/* ==========================================================================
   RESPONSIVE - DESKTOP PEQUEÑO (1025px a 1279px)
   ========================================================================== */
@media (min-width: 1025px) and (max-width: 1279px) {
    .hero-content {
        width: calc(100% - 540px);
    }

    .form-card {
        width: 460px;
        right: 34px;
    }
}

/* ==========================================================================
   RESPONSIVE - TABLET (768px a 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    body {
        padding: 24px 12px;
    }

    .header-slogan {
        font-size: 28px;
    }

    .hero-content {
        width: calc(100% - 470px);
        padding-left: 44px;
    }

    .hero-title {
        font-size: 38px;
    }

    .hero-sub {
        font-size: 23px;
    }

    .form-card {
        width: 430px;
        padding: 36px 34px 38px;
        right: 30px;
    }

    .form-title {
        font-size: 26px;
    }

    .tipologia-options {
        gap: 30px;
    }

    .tipologia-option img {
        width: 84px;
        height: 84px;
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
    body {
        padding: 0;
    }

    .landing-card {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .site-header {
        height: 64px;
        padding: 0 18px;
    }

    .site-header .logo {
        height: 38px;
    }

    .header-slogan {
        font-size: 21px;
    }

    /* Estructura vertical: imagen, texto, formulario */
    .hero {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .hero-media {
        position: relative;
        inset: auto;
        height: 300px;
        flex-shrink: 0;
    }

    .hero-img {
        position: absolute;
        inset: 0;
        object-position: center 30%;
    }

    /* Overlay vertical suave sobre la foto */
    .hero-overlay {
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 45%,
            rgba(255, 255, 255, 0.55) 100%
        );
    }

    .hero-deco-pattern {
        width: 200px;
    }

    .hero-deco-dots {
        display: none;
    }

    .hero-content {
        position: static;
        width: 100%;
        align-items: flex-start;
        padding: 30px 20px 6px;
    }

    .hero-text {
        max-width: none;
    }

    .hero-chevrons {
        width: 38px;
        height: 44px;
        margin-bottom: 18px;
    }

    .hero-title {
        font-size: 31px;
        margin-bottom: 16px;
    }

    .hero-sub {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .hero-pill {
        font-size: 15px;
        height: 36px;
        padding: 0 20px;
    }

    /* Formulario a ancho completo centrado */
    .form-card {
        position: static;
        transform: none;
        width: calc(100% - 30px);
        margin: 26px auto 34px;
        border-radius: 26px;
        padding: 32px 22px 34px;
        box-shadow: none;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .form-input {
        height: 54px;
        font-size: 16px;
    }

    .tipologia-options {
        gap: 26px;
        margin-bottom: 26px;
    }

    .tipologia-option img {
        width: 88px;
        height: 88px;
    }

    /* Targets táctiles más grandes */
    .form-submit {
        width: 100%;
        max-width: 320px;
        height: 58px;
        font-size: 21px;
    }
}

/* ============================================
   ENTRADA / ANIMACIONES DE CARGA
   ============================================ */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes media-in {
    from { opacity: 0; transform: scale(1.035); }
    to   { opacity: 1; transform: scale(1); }
}

/* Desktop: la tarjeta se centra con transform: translateY(-50%);
   el keyframe debe terminar en ese mismo valor para no romper el layout */
@keyframes card-deploy {
    from { opacity: 0; transform: translateY(calc(-50% + 36px)) scale(0.985); }
    to   { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Mobile: la tarjeta es position: static sin transform */
@keyframes card-deploy-mobile {
    from { opacity: 0; transform: translateY(36px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.site-header {
    animation: fade-down 0.6s ease-out both;
}

.hero-chevrons {
    animation: fade-up 0.6s ease-out 0.15s both;
}

.hero-title {
    animation: fade-up 0.7s ease-out 0.28s both;
}

.hero-sub {
    animation: fade-up 0.7s ease-out 0.42s both;
}

.hero-pill {
    animation: fade-up 0.6s ease-out 0.55s both;
}

.hero-media {
    animation: media-in 1s ease-out 0.3s both;
}

.hero-deco-pattern {
    animation: fade-in 0.9s ease-out 0.9s both;
}

.hero-deco-dots {
    animation: fade-in 0.9s ease-out 1s both;
}

/* La tarjeta se "despliega" con un leve rebote (bezier con overshoot) */
.form-card {
    animation: card-deploy 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) 0.5s both;
}

.form-card .form-title {
    animation: fade-up 0.55s ease-out 0.8s both;
}

.form-card .form-group {
    animation: fade-up 0.55s ease-out both;
}

.form-card .form-group:nth-of-type(1) { animation-delay: 0.95s; }
.form-card .form-group:nth-of-type(2) { animation-delay: 1.03s; }
.form-card .form-group:nth-of-type(3) { animation-delay: 1.11s; }

.form-card .tipologia-label {
    animation: fade-up 0.55s ease-out 1.19s both;
}

.form-card .tipologia-options {
    animation: fade-up 0.55s ease-out 1.27s both;
}

/* El botón tiene transform en hover: animar solo opacidad */
.form-card .form-submit {
    animation: fade-in 0.6s ease-out 1.35s both;
}

.form-card .form-feedback {
    animation: fade-in 0.6s ease-out 1.4s both;
}

@media (max-width: 768px) {
    .form-card {
        animation-name: card-deploy-mobile;
    }
}

/* Accesibilidad: sin animaciones si el usuario prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .hero-chevrons,
    .hero-title,
    .hero-sub,
    .hero-pill,
    .hero-media,
    .hero-deco-pattern,
    .hero-deco-dots,
    .form-card,
    .form-card .form-title,
    .form-card .form-group,
    .form-card .tipologia-label,
    .form-card .tipologia-options,
    .form-card .form-submit,
    .form-card .form-feedback {
        animation: none !important;
    }
}
