/* ==================== VARIABLES DE TU MARCA ==================== */
:root {
    --primary-color: #955ae8;
    --button-color: #fdb225;
    --dark-color: #21103a;
    --dark-color-alt: #2c1a45;
    --white-color: white;
    --text-color: #f0eef6;
    --text-color-dark: #a9a6b3;
    --error-color: #e74c3c;
    --body-font: 'Montserrat', sans-serif;
    --title-font: 'Bebas Neue', sans-serif;
    --shadow-primary: 0 10px 30px rgba(149, 90, 232, 0.4);
}

/* ==================== BASE ==================== */
* { 
    box-sizing: border-box; 
    padding: 0; 
    margin: 0; 
}

body {
    font-family: var(--body-font);
    background-color: var(--dark-color); /* Fallback */
    
    /* === CORRECCIÓN: Capa oscura sobre el fondo === */
    background-image: linear-gradient(rgba(33, 16, 58, 0.9), rgba(33, 16, 58, 0.9)), url('../img/fondoalgo4.webp');
    
    background-size: cover;
    background-position: center center;
    color: var(--text-color);
    
    width: 100vw;
    height: 100svh;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow: hidden;
    transition: height 0.2s ease;
}

/* ==================== CONTENEDOR DEL FORMULARIO ==================== */
.form-container {
    width: 100%;
    max-width: 550px;
    background-color: var(--dark-color-alt);
    border-radius: 16px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    
    overflow-y: hidden;
    max-height: 95%; 
    
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Cabecera del Form --- */
.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}
.form-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
}
.form-header h1 {
    font-family: var(--title-font);
    font-size: clamp(2rem, 7vw, 2.8rem);
    color: var(--white-color);
    line-height: 1.1;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}
.form-header p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    max-width: 450px;
    margin: 0 auto;
}
.step-indicator {
    font-family: var(--title-font);
    color: var(--button-color);
    font-size: 1.25rem;
    letter-spacing: 1px;
    margin-top: 1rem !important;
}

/* --- Estilos del Formulario --- */
#contact-form {
    transition: all 0.3s ease;
}

.form-step {
    display: none; 
    grid-template-rows: auto auto;
    gap: 0.9rem; 
}
.form-step.active {
    display: grid;
}
.step-subtitle {
    font-family: var(--title-font);
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* --- Estilos de Campos --- */
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-color);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: var(--white-color);
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(149, 90, 232, 0.3);
}

/* --- Estilos de Error --- */
.form-group input.form-error,
.form-group select.form-error,
.form-group textarea.form-error {
    border-color: var(--error-color) !important;
}
.form-group .iti.form-error { /* Error en la banderita */
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

/* --- Estilos Select --- */
.form-group select {
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f0eef6' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}
.form-group select option {
    background-color: var(--dark-color-alt);
    color: var(--white-color);
}

/* --- Estilos Campos Dinámicos --- */
.service-specific-questions {
    display: none;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--dark-color);
    padding-top: 1rem;
}
.service-specific-questions.active {
    display: flex; 
}

/* --- Estilos Botones Radio Personalizados --- */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
}
.radio-label input[type="radio"] {
    display: none; 
}
.radio-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.2s ease;
    position: relative;
}
.radio-label input[type="radio"]:checked + .radio-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    background-color: var(--white-color);
    border-radius: 50%;
}

/* --- Botones de Navegación --- */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    width: 100%;
}
.form-step[data-step="1"] .form-navigation {
    justify-content: flex-end; 
}

.btn-next,
.btn-prev,
.btn-submit {
    font-family: var(--body-font);
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem; 
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0.85rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.btn-next,
.btn-submit {
    background-color: var(--button-color);
    color: var(--white-color);
    min-width: 140px;
}
.btn-prev {
    background-color: transparent;
    color: var(--text-color-dark);
    border: 2px solid var(--text-color-dark);
    min-width: 120px;
}
.btn-next i, .btn-prev i {
    font-size: 1.2rem;
}

.btn-next:hover,
.btn-submit:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}
.btn-prev:hover {
    background-color: var(--text-color-dark);
    color: var(--dark-color-alt);
    border-color: var(--text-color-dark);
    transform: translateY(-3px);
}

/* --- Mensaje de Gracias --- */
#gracias-mensaje {
    display: none; 
    text-align: center;
}
#gracias-mensaje h3 {
    font-family: var(--title-font);
    font-size: 2.5rem;
    color: var(--button-color);
    margin-bottom: 0.5rem;
}
#gracias-mensaje p {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
}
.saludo-final {
    font-family: var(--title-font);
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin-top: 1rem;
}

/* Clases para la transición final */
.form-container.fade-out {
    opacity: 0;
    transform: scale(0.95);
}
.form-container.show-success {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================== */
/* === CORRECCIÓN: ESTILOS INT'L TEL INPUT (BANDERITAS) === */
/* ============================================================== */

/* El contenedor .iti debe verse como el input */
.iti {
    width: 100%;
    /* Hereda los estilos visuales de los otros inputs */
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* El input REAL de teléfono debe ser transparente y sin bordes */
.iti input[type="tel"] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0;
    width: 100%;
    /* Ajusta el padding para dejar espacio a la banderita */
    padding: 0.75rem 1rem 0.75rem 90px !important; /* Aumenta este valor si el +54 se superpone */
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: var(--white-color);
}

/* La banderita y el código de país */
.iti__selected-flag {
    /* Posiciona la bandera */
    background-color: transparent;
    border-radius: 8px 0 0 8px;
    width: 80px; /* Ancho para bandera + código */
}

/* El código de país (ej +54) */
.iti__selected-dial-code {
    color: var(--text-color-dark);
}

/* El dropdown de países */
.iti__country-list {
    background-color: var(--dark-color-alt); 
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-primary);
}
.iti__country {
    color: var(--text-color);
}
.iti__country:hover, .iti__country.iti__highlight {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.iti__dial-code {
    color: var(--text-color-dark);
}

/* Estilo de Foco: Se aplica al contenedor .iti */
.iti:focus-within {
     border-color: var(--primary-color);
     box-shadow: 0 0 0 3px rgba(149, 90, 232, 0.3);
}

/* Quita el foco default del input, ya que lo maneja el .iti */
.iti input[type="tel"]:focus {
    outline: none;
    box-shadow: none;
}