/* ============================================================
   RESET & VARIABLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
    /* --- Paleta principal --- */
    --color-bg:           #192722;
    --color-bg-soft:      #2a8265;
    --color-primary:      #d7e7dd;
    --color-primary-dark: #c2d9c9;
    --color-primary-text: #1f6f54;

    /* --- Superficies --- */
    --color-card:         rgba(255, 255, 255, .08);
    --color-card-solid:   #2a8265;
    --color-surface:      rgba(255, 255, 255, .06);

    /* --- Textos --- */
    --color-text:         #ffffff;
    --color-text-soft:    #e8f3ec;
    --color-muted:        #b8d4c4;

    /* --- Bordes --- */
    --color-border:       rgba(215, 231, 221, .25);
    --color-border-focus: #d7e7dd;

    /* --- Estados --- */
    --color-error:        #ff8a8a;
    --color-success:      #b9e8c9;

    /* --- Layout --- */
    --radius:             14px;
    --radius-sm:          10px;
    --shadow:             0 6px 24px rgba(0, 0, 0, .18);
    --shadow-btn:         0 6px 20px rgba(215, 231, 221, .25);
    --shadow-btn-hover:   0 8px 25px rgba(215, 231, 221, .35);
    --transition:         .2s ease;
}

/* ============================================================
   BASE
   ============================================================ */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    margin: 0 0 .4rem;
    letter-spacing: -.02em;
    color: var(--color-text);
}

.hero p {
    color: var(--color-muted);
    font-size: 1rem;
    margin: 0;
}

/* ============================================================
   SELECTOR DE IDIOMA
   ============================================================ */
.lang-switch {
    position: sticky;
    top: 1rem;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    max-width: 640px;
    margin: 1rem auto 0;
    padding: 0 1.25rem;
}

.lang-switch button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-soft);
    padding: .5rem .9rem;
    border-radius: 999px;
    font-size: .875rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lang-switch button:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
}

.lang-switch button.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
    font-weight: 700;
}

/* ============================================================
   BARRA DE PROGRESO
   ============================================================ */
.progress-wrap {
    margin-bottom: 1.25rem;
    position: sticky;
    top: 4.5rem;
    z-index: 5;
    padding: .5rem 0;
}

.progress-bar {
    height: 8px;
    background: rgba(215, 231, 221, .18);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 12px rgba(215, 231, 221, .5);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--color-muted);
    margin-top: .4rem;
    font-weight: 500;
}

/* ============================================================
   PASOS (WIZARD)
   ============================================================ */
.step {
    display: none;
    animation: slideIn .35s cubic-bezier(.4, 0, .2, 1) both;
}

.step.active { display: block; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   TARJETAS
   ============================================================ */
.card {
    background: var(--color-card);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.card.has-error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 4px rgba(255, 138, 138, .15);
}

.pregunta-header {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-primary-text);
    font-weight: 700;
    font-size: .9rem;
    display: grid;
    place-items: center;
}

.pregunta-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.45;
    color: var(--color-text);
}

.step.required .pregunta-header h2::after {
    content: " *";
    color: var(--color-error);
}

.hint {
    font-size: .875rem;
    color: var(--color-muted);
    margin: 0 0 .75rem;
    font-style: italic;
}

.error-msg {
    color: var(--color-error);
    font-size: .875rem;
    margin: .75rem 0 0;
    font-weight: 500;
}

/* ============================================================
   CAMPOS DE TEXTO
   ============================================================ */
.field { display: block; }

.field-label {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-muted);
    margin-bottom: .5rem;
}

input[type="text"],
textarea {
    width: 100%;
    padding: .9rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    transition: var(--transition);
    resize: vertical;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: rgba(232, 243, 236, .5);
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 4px rgba(215, 231, 221, .18);
}

/* Ocultar autofill amarillo de Chrome/Edge/Safari */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text);
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, .06) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--color-text);
}

/* ============================================================
   OPCIONES (radios & checkboxes)
   ============================================================ */
.options {
    display: grid;
    gap: .65rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    user-select: none;
    background: rgba(255, 255, 255, .04);
    color: var(--color-text);
}

.option:hover {
    border-color: var(--color-primary);
    background: rgba(215, 231, 221, .08);
    transform: translateX(2px);
}

.option input {
    appearance: none;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px solid var(--color-border-focus);
    background: transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.option input[type="radio"]    { border-radius: 50%; }
.option input[type="checkbox"] { border-radius: 6px; }

.option input:checked {
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--color-primary-text);
}

.option input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: var(--color-primary-text);
    font-size: 15px;
    font-weight: 800;
    display: grid;
    place-items: center;
    line-height: 1;
}

.option:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(215, 231, 221, .18);
    font-weight: 500;
}

/* ============================================================
   OPCIÓN "OTRO" + CAMPO DE TEXTO
   ============================================================ */
.otro-wrap {
    padding-left: 2.4rem;
    animation: otroIn .25s cubic-bezier(.4, 0, .2, 1) both;
}

.otro-wrap[hidden] { display: none; }

.otro-wrap input[type="text"] {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px dashed var(--color-border-focus);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .05);
    color: var(--color-text);
    font: inherit;
    font-size: .95rem;
    transition: var(--transition);
}

.otro-wrap input[type="text"]:focus {
    outline: none;
    border-style: solid;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 4px rgba(215, 231, 221, .18);
}

.otro-wrap input[type="text"]::placeholder {
    color: rgba(232, 243, 236, .5);
    font-style: italic;
}

@keyframes otroIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   NAVEGACIÓN (botones)
   ============================================================ */
.wizard-nav {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    justify-content: space-between;
}

.btn {
    padding: .95rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
    font-family: inherit;
    flex: 1;
    min-height: 52px;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-primary-text);
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(215, 231, 221, .12);
    color: var(--color-primary);
}

.btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.btn[hidden] { display: none; }

/* ============================================================
   PANTALLA FINAL
   ============================================================ */
.card-final {
    text-align: center;
    padding: 2.75rem 1.75rem;
    background: var(--color-card-solid);
    border: 1.5px solid rgba(215, 231, 221, .35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeUp .45s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-final .final-icon {
    font-size: 3.5rem;
    margin-bottom: .5rem;
    animation: pop .55s cubic-bezier(.34, 1.56, .64, 1) both;
}

.card-final h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .75rem;
    color: var(--color-text);
    letter-spacing: -.01em;
    line-height: 1.35;
}

.card-final .hint {
    font-size: .975rem;
    color: var(--color-text-soft);
    font-style: normal;
    margin: 0 auto 1.75rem;
    max-width: 480px;
    line-height: 1.6;
}

.final-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.final-actions .btn {
    flex: 0 1 auto;
    min-width: 220px;
    padding: 1rem 2rem;
    font-size: 1rem;
    letter-spacing: .2px;
}

.final-actions .btn-primary {
    box-shadow: 0 8px 28px rgba(215, 231, 221, .35);
}

.final-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(215, 231, 221, .5);
}

@keyframes pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ============================================================
   TOAST (notificaciones)
   ============================================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 150%);
    background: #0f3d2e;
    color: #ffffff;
    padding: .95rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    border: 1px solid rgba(215, 231, 221, .25);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
    max-width: 90vw;
    text-align: center;
}

.toast.show    { transform: translate(-50%, 0); }
.toast.success { background: #2d8659; border-color: var(--color-success); }
.toast.error   { background: #a83232; border-color: var(--color-error); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .container     { padding: 1rem .9rem 3rem; }
    .card          { padding: 1.35rem; }
    .lang-switch   { padding: 0 .9rem; }
    .btn           { padding: .85rem 1.1rem; font-size: .95rem; }
    .progress-wrap { top: 4rem; }

    .card-final       { padding: 2rem 1.25rem; }
    .card-final h2    { font-size: 1.3rem; }
    .final-actions .btn { width: 100%; min-width: 0; }
}

/* ============================================================
   TOGGLE IDIOMA EN PANTALLA DE GRACIAS
   ============================================================ */
.gracias-lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-bottom: .5rem;
}

.gracias-lang-switch button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-soft);
    padding: .5rem .9rem;
    border-radius: 999px;
    font-size: .875rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: inherit;
}

.gracias-lang-switch button:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
}

.gracias-lang-switch button.active {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
    font-weight: 700;
}
/* ============================================================
   DESCRIPCIÓN DEL HERO
   ============================================================ */
.hero-descripcion {
    color: var(--color-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

/* Móvil: más pequeño */
@media (max-width: 480px) {
    .hero-descripcion {
        font-size: .82rem;
        line-height: 1.45;
    }
}