/* =========================================================
   Matlin Step Form Wizard — Gravity Form #27
   CSS adaptado al nuevo JS (cada .gfield = un paso)
   ========================================================= */

/* ---------- Variables de marca ---------- */
#gform_wrapper_27 {
    --matlin-purple: #211747;
    --matlin-purple-deep: #1b1a38;
    --matlin-gold: #dab128;
    --matlin-gold-light: #fde8a4;
    --matlin-gold-gradient: linear-gradient(90deg, #dab128 9.62%, #fde8a4 56.25%, #dab128 100%);
    --matlin-field-bg: rgba(84, 83, 104, 0.35);
    --matlin-field-border: rgba(255, 255, 255, 0.35);
    --matlin-text: #ffffff;
    --matlin-text-muted: rgba(255, 255, 255, 0.7);
    --matlin-radius: 12px;
    --matlin-error: #ff8a8a;
    font-family: "Futura PT Medium", sans-serif;
}

.landing-page-hero .hero-form h3 {
    display: none;
}

/* =========================================================
   1. VISIBILIDAD DE PASOS
   ========================================================= */
#gform_wrapper_27 .matlin-step {
    display: none !important;
}

#gform_wrapper_27 .matlin-step.matlin-step-active {
    display: block !important;
    animation: matlinFade 0.25s ease;
}

/* ---- PANTALLA DE RECHAZO (campo #field_27_13) ----
   El JS NO le pone la clase .matlin-step, así que hay que
   ocultarla por su ID por defecto y mostrarla solo cuando
   el JS le añade .matlin-rejection-active. */
#gform_wrapper_27 #field_27_13 {
    display: none !important;
}

#gform_wrapper_27 #field_27_13.matlin-rejection-active {
    display: block !important;
    animation: matlinFade 0.25s ease;
}

/* =========================================================
   2. TÍTULO / PREGUNTAS  (texto blanco)
   ========================================================= */
#gform_wrapper_27 .gfield_label,
#gform_wrapper_27 legend.gfield_label {
    color: var(--matlin-text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 18px;
    display: block !important;
    text-align: center;
}

#gform_wrapper_27 .gfield_required_text {
    color: var(--matlin-gold);
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

/* Paso HTML (acknowledgement): texto descriptivo centrado */
#gform_wrapper_27 .gfield--type-html {
    color: var(--matlin-text);
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

#gform_wrapper_27 .gfield--type-html a {
    color: var(--matlin-gold-light);
}

/* =========================================================
   3. OPCIONES RADIO / CHECKBOX  ->  tarjetas seleccionables
   ========================================================= */
#gform_wrapper_27 .gfield_radio,
#gform_wrapper_27 .gfield_checkbox {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#gform_wrapper_27 .gchoice {
    position: relative;
    margin: 0;
    padding: 0;
}

/* Ocultar el input nativo pero mantenerlo accesible */
#gform_wrapper_27 .gchoice input[type="radio"],
#gform_wrapper_27 .gchoice input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* La label pasa a ser la "tarjeta" clickeable */
#gform_wrapper_27 .gchoice label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 18px;
    background: var(--matlin-field-bg);
    border: 1.5px solid var(--matlin-field-border);
    border-radius: var(--matlin-radius);
    color: var(--matlin-text);
    font-size: 16px;
    font-weight: 450;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

#gform_wrapper_27 .gchoice label::before {
    content: "";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: 2px solid var(--matlin-field-border);
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Checkbox = cuadrado en vez de círculo */
#gform_wrapper_27 .gfield_checkbox .gchoice label::before {
    border-radius: 5px;
}

/* Hover */
#gform_wrapper_27 .gchoice label:hover {
    border-color: var(--matlin-gold);
    background: rgba(218, 177, 40, 0.12);
}

/* Estado seleccionado */
#gform_wrapper_27 .gchoice input:checked+label {
    border-color: var(--matlin-gold);
    background: rgba(218, 177, 40, 0.18);
    box-shadow: 0 0 0 1px var(--matlin-gold) inset;
}

#gform_wrapper_27 .gchoice input:checked+label::before {
    border-color: var(--matlin-gold);
    background: var(--matlin-gold-gradient);
    box-shadow: inset 0 0 0 3px var(--matlin-purple);
}

/* Foco accesible con teclado */
#gform_wrapper_27 .gchoice input:focus-visible+label {
    outline: 2px solid var(--matlin-gold-light);
    outline-offset: 2px;
}

/* =========================================================
   4. CAMPOS DE TEXTO Y TEXTAREA
   (nombre, teléfono, email + pasos narrativos)
   ========================================================= */
#gform_wrapper_27 input[type="text"],
#gform_wrapper_27 input[type="tel"],
#gform_wrapper_27 input[type="email"],
#gform_wrapper_27 textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--matlin-field-bg);
    border: 1.5px solid var(--matlin-field-border);
    border-radius: var(--matlin-radius);
    color: var(--matlin-text);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#gform_wrapper_27 textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.5;
}

#gform_wrapper_27 input::placeholder,
#gform_wrapper_27 textarea::placeholder {
    color: var(--matlin-text-muted);
}

#gform_wrapper_27 input[type="text"]:focus,
#gform_wrapper_27 input[type="tel"]:focus,
#gform_wrapper_27 input[type="email"]:focus,
#gform_wrapper_27 textarea:focus {
    outline: none;
    border-color: var(--matlin-gold);
    box-shadow: 0 0 0 3px rgba(218, 177, 40, 0.2);
}

/* Sub-labels (First / Last) */
#gform_wrapper_27 .gform-field-label--type-sub,
#gform_wrapper_27 .gfield .ginput_complex label {
    color: var(--matlin-text-muted);
    font-size: 13px;
    margin-top: 6px;
}

/* Campo de nombre en dos columnas */
#gform_wrapper_27 .ginput_complex.ginput_container_name {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

#gform_wrapper_27 .ginput_complex.ginput_container_name>span {
    flex: 1 1 45%;
}

/* =========================================================
   5. BARRA DE PROGRESO  (inyectada por el JS)
   ========================================================= */
#gform_wrapper_27 .matlin-progress {
    margin: 0 0 28px;
}

/* Step counter. The source shipped a bare bar with no label, so the opening
   screen gave no sense of how long the form was - and the bar itself computed
   to 100% on load (see updateProgress in matlin-step-form-v11.js). Both are
   fixed; this is the label half. */
#gform_wrapper_27 .matlin-progress__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 8px;
}

#gform_wrapper_27 .matlin-progress__step {
    font-family: var(--font-body, "Futura PT Medium", sans-serif);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    font-variant-numeric: tabular-nums;
}

#gform_wrapper_27 .matlin-progress__track {
    height: 8px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

#gform_wrapper_27 .matlin-progress__bar {
    height: 100%;
    width: 0;
    background: var(--matlin-gold-gradient);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* =========================================================
   6. NAVEGACIÓN  (botones Back / Next inyectados por el JS)
   ========================================================= */
#gform_wrapper_27 .matlin-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

#gform_wrapper_27 .matlin-btn {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    border-radius: 999px;
    padding: 14px 34px;
    cursor: pointer;
    border: 0;
    transition: transform 0.1s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

#gform_wrapper_27 .matlin-btn:active {
    transform: scale(0.97);
}

/* Next = dorado (acción primaria) */
#gform_wrapper_27 .matlin-btn--next {
    margin-left: auto;
    background: var(--matlin-gold-gradient);
    color: var(--matlin-purple);
}

#gform_wrapper_27 .matlin-btn--next:hover {
    box-shadow: 0 6px 18px rgba(218, 177, 40, 0.35);
}

/* Back = contorno claro (acción secundaria).
   El JS usa visibility:hidden en el primer paso,
   así conserva el espacio y el Next queda a la derecha. */
#gform_wrapper_27 .matlin-btn--back {
    background: transparent;
    color: var(--matlin-text);
    border: 1.5px solid var(--matlin-field-border);
    padding: 14px 28px;
}

#gform_wrapper_27 .matlin-btn--back:hover {
    border-color: var(--matlin-gold);
    color: var(--matlin-gold-light);
}

/* =========================================================
   7. BOTÓN SUBMIT (Gravity nativo, último paso "contact")
   ========================================================= */
#gform_wrapper_27 .gform_footer {
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
}

#gform_wrapper_27 .gform_footer input[type="submit"],
#gform_wrapper_27 .gform_footer button {
    background: var(--matlin-gold-gradient);
    color: var(--matlin-purple);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    border: 0;
    border-radius: 999px;
    padding: 15px 40px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

#gform_wrapper_27 .gform_footer input[type="submit"]:hover {
    box-shadow: 0 6px 18px rgba(218, 177, 40, 0.35);
}

/* =========================================================
   8. PANTALLA DE RECHAZO
   ========================================================= */
#gform_wrapper_27 #field_27_13.matlin-rejection-active {
    text-align: center;
    color: var(--matlin-text);
    font-size: 16px;
    line-height: 1.6;
    padding: 8px 0;
}

#gform_wrapper_27 #field_27_13.matlin-rejection-active a {
    color: var(--matlin-gold-light);
}

/* =========================================================
   9. ERRORES DE VALIDACIÓN (custom del JS)
   ========================================================= */
#gform_wrapper_27 .matlin-custom-error {
    color: var(--matlin-error);
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

@media screen and (max-width:768px) {
    .inner-hero__wrapper .cta {
        display: none;
    }

    .inner-hero__wrapper .inner-hero__content {
        padding-top: 0;
    }

    .hero-form {
        margin-top: 0px !important;
    }

    .landing-page-hero .inner-hero__wrapper .inner-hero__content h1,
    .landing-page-hero .inner-hero__wrapper .inner-hero__content h1 span {
        font-size: 25px;
        line-height: 1.2;
        padding-bottom: 6px;
        display: inline-block;
    }

    .landing-page-hero .inner-hero__wrapper .inner-hero__content .disclaimer h3 {
        font-size: 16px;
        line-height: 13px;
    }

    .landing-page-hero .inner-hero__wrapper .inner-hero__content .disclaimer p {
        font-size: 14px;
        line-height: 16px;
    }

    .landing-page-hero .inner-hero__wrapper .inner-hero__content .disclaimer {
        margin-bottom: 30px;
    }

    #gform_wrapper_27 .gchoice label {
        max-width: unset !important;
        padding: 8px 18px;
    }

    .landing-page-hero .inner-hero__wrapper {
        padding-top: 24px;
    }
}


#gform_wrapper_27 {
    position: relative;
    min-height: 300px;
}

.matlin-form-loader {
    position: absolute;
    inset: 0;
    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff;
}

.matlin-form-loader__spinner {
    width: 42px;
    height: 42px;

    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: currentColor;
    border-radius: 50%;

    animation: matlin-spin 0.8s linear infinite;
}

.matlin-form-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

@keyframes matlin-spin {
    to {
        transform: rotate(360deg);
    }
}
/* =========================================================
   PRE-JS INSTANT PAINT
   Paint the wrapper and the first step at first render,
   before any JavaScript executes. initMatlinWizard() adds
   .matlin-wizard-ready as its first action, and every rule
   below stops applying — the wizard takes over unchanged.
   ========================================================= */

#gform_wrapper_27:not(.matlin-wizard-ready) {
    display: block !important;
    visibility: visible !important;
}

#gform_wrapper_27:not(.matlin-wizard-ready) #field_27_1 {
    display: block !important;
}

/* The wizard manages the submit button; keep it hidden pre-init. */
#gform_wrapper_27:not(.matlin-wizard-ready) .gform_footer {
    display: none !important;
}
