/* =====================================================
   EIDAL TEST DE NIVEL — CSS MODERNO
   Fuentes: Syne (display) + DM Sans (body)
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── Variables ── */
:root {
    --et-bg:         #fff;
    --et-surface:    #161922;
    --et-surface2:   #1E2330;
    --et-border:     #2A3040;
    --et-accent:     #45bdab;     /* teal */
    --et-accent2:    #818CF8;     /* indigo */
    --et-accent3:    #FB923C;     /* orange */
    --et-text:       #E8EAF0;
    --et-muted:      #6B7280;
    --et-white:      #FFFFFF;
    --et-radius:     16px;
    --et-radius-sm:  10px;
    --et-shadow:     0 8px 32px rgba(0,0,0,.45);
    --et-font-head:  'Syne', sans-serif;
    --et-font-body:  'DM Sans', sans-serif;
    --et-transition: 0.28s cubic-bezier(.4,0,.2,1);
}

/* ── Reset base ── */
.et-wrapper *, .et-wrapper *::before, .et-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Wrapper ── */
.et-wrapper {
    font-family: var(--et-font-body);
    background: var(--et-bg);
    color: var(--et-text);
    min-height: 60vh;
    padding: 40px 20px 80px;
    position: relative;
    overflow: hidden;
}

/* Fondo decorativo */
.et-wrapper::before {
    content: '';
    position: fixed;
    top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(94,234,212,.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.et-wrapper::after {
    content: '';
    position: fixed;
    bottom: -200px; left: -100px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(129,140,248,.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.et-step {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    animation: etFadeUp .5s ease both;
}

.et-hidden { display: none !important; }

/* ── Animaciones ── */
@keyframes etFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes etPop {
    0%   { transform: scale(.9); opacity: 0; }
    70%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes etPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94,234,212,.4); }
    50%       { box-shadow: 0 0 0 14px rgba(94,234,212,0); }
}
@keyframes etSpin {
    to { transform: rotate(360deg); }
}
@keyframes etConfettiFall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(350px) rotate(720deg); opacity: 0; }
}

/* ════════════════════════════════════════════════════
   PASO 1 — HERO + SELECTOR
════════════════════════════════════════════════════ */
.et-hero {
    text-align: center;
    padding: 60px 20px 48px;
}
.et-hero__badge {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    animation: etPop .6s ease .1s both;
}
.et-hero__title {
    font-family: var(--et-font-head);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--et-accent), var(--et-accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 16px;
    animation: etFadeUp .5s ease .2s both;
}
.et-hero__sub {
    font-size: 1.1rem;
    color: var(--et-muted);
    font-weight: 300;
    animation: etFadeUp .5s ease .3s both;
}

/* ── Tarjetas de tipo ── */
.et-type-grid {
    display: grid;
    gap: 14px;
    animation: etFadeUp .5s ease .35s both;
}

.et-type-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 28px;
    background: var(--et-surface);
    border: 1.5px solid var(--et-border);
    border-radius: var(--et-radius);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: var(--et-transition);
    position: relative;
    overflow: hidden;
}
.et-type-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(94,234,212,.08), rgba(129,140,248,.06));
    opacity: 0;
    transition: var(--et-transition);
}
.et-type-card:hover {
    border-color: var(--et-accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(94,234,212,.15);
}
.et-type-card:hover::before { opacity: 1; }

.et-type-card__icon { font-size: 32px; flex-shrink: 0; }
.et-type-card__name {
    font-family: var(--et-font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--et-white);
    flex: 1;
}
.et-type-card__count {
    font-size: .85rem;
    color: var(--et-muted);
    margin-right: 12px;
}
.et-type-card__arrow {
    font-size: 1.3rem;
    color: var(--et-accent);
    transition: var(--et-transition);
}
.et-type-card:hover .et-type-card__arrow { transform: translateX(6px); }

.et-empty {
    text-align: center;
    color: var(--et-muted);
    padding: 40px;
    background: var(--et-surface);
    border-radius: var(--et-radius);
    border: 1px dashed var(--et-border);
}

/* ════════════════════════════════════════════════════
   PASO 2 — QUIZ
════════════════════════════════════════════════════ */
.et-quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 12px;
    flex-wrap: wrap;
}
.et-back-btn {
    background: none;
    border: 1px solid var(--et-border);
    color: var(--et-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--et-font-body);
    font-size: .9rem;
    transition: var(--et-transition);
}
.et-back-btn:hover { color: var(--et-text); border-color: var(--et-text); }

.et-quiz-type-label {
    font-size: .9rem;
    color: var(--et-accent);
    font-weight: 500;
    background: rgba(94,234,212,.1);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Barra de progreso */
.et-progress-bar {
    height: 6px;
    background: var(--et-surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.et-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--et-accent), var(--et-accent2));
    border-radius: 3px;
    width: 0%;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}
.et-progress-text {
    text-align: right;
    font-size: .85rem;
    color: var(--et-muted);
    margin-bottom: 28px;
}

/* Loading */
.et-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--et-muted);
}
.et-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--et-border);
    border-top-color: var(--et-accent);
    border-radius: 50%;
    animation: etSpin .8s linear infinite;
    margin: 0 auto 16px;
}

/* Pregunta */
.et-question {
    background: var(--et-surface);
    border: 1.5px solid var(--et-border);
    border-radius: var(--et-radius);
    padding: 36px 32px 28px;
    animation: etFadeUp .4s ease both;
}
.et-question__number {
    font-size: .8rem;
    color: var(--et-accent);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.et-question__text {
    font-family: var(--et-font-head);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--et-white);
    line-height: 1.3;
    margin-bottom: 8px;
}
.et-question__content {
    color: var(--et-muted);
    font-size: .95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}
.et-question__content p { margin-bottom: 8px; }

/* Opciones */
.et-options {
    display: grid;
    gap: 10px;
}
.et-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--et-surface2);
    border: 1.5px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    cursor: pointer;
    transition: var(--et-transition);
    user-select: none;
}
.et-option:hover {
    border-color: var(--et-accent);
    background: rgba(94,234,212,.07);
}
.et-option.selected {
    border-color: var(--et-accent);
    background: rgba(94,234,212,.12);
}
.et-option__letter {
    width: 32px; height: 32px;
    background: var(--et-border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--et-muted);
    flex-shrink: 0;
    transition: var(--et-transition);
}
.et-option.selected .et-option__letter {
    background: var(--et-accent);
    color: var(--et-bg);
}
.et-option__text {
    font-size: .95rem;
    color: var(--et-text);
    line-height: 1.4;
}

/* Navegación del quiz */
.et-quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

/* ════════════════════════════════════════════════════
   PASO 3 — FORMULARIO
════════════════════════════════════════════════════ */
.et-form-header {
    text-align: center;
    padding: 40px 20px 32px;
}
.et-form-header__icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    animation: etPop .5s ease both;
}
.et-form-header h2 {
    font-family: var(--et-font-head);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--et-surface);
    margin-bottom: 12px;
}
.et-form-header p {
    color: var(--et-muted);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

.et-errors {
    background: rgba(251,146,60,.12);
    border: 1px solid rgba(251,146,60,.4);
    border-radius: var(--et-radius-sm);
    padding: 14px 18px;
    margin-bottom: 24px;
    color: var(--et-accent3);
    font-size: .9rem;
}
.et-errors p { margin-bottom: 4px; }
.et-errors p:last-child { margin-bottom: 0; }

.et-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 580px) {
    .et-form-grid { grid-template-columns: 1fr; }
}

.et-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.et-field--full { grid-column: 1 / -1; }

.et-field label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--et-muted);
    letter-spacing: .02em;
}
.et-field label small { font-weight: 400; margin-left: 4px; }

.et-field input[type="text"],
.et-field input[type="email"],
.et-field input[type="tel"],
.et-field input[type="number"],
.et-field select {
    background: var(--et-surface);
    border: 1.5px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    color: var(--et-text);
    font-family: var(--et-font-body);
    font-size: .95rem;
    padding: 13px 16px;
    transition: var(--et-transition);
    width: 100%;
    -webkit-appearance: none;
}
.et-field input:focus,
.et-field select:focus {
    outline: none;
    border-color: var(--et-accent);
    box-shadow: 0 0 0 3px rgba(94,234,212,.15);
}
.et-field__hint {
    font-size: .78rem;
    color: var(--et-muted);
    line-height: 1.5;
    margin-top: 4px;
}

.et-select-wrap { position: relative; }
.et-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--et-muted);
    pointer-events: none;
    font-size: .8rem;
}

.et-radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.et-radio-group--col { flex-direction: column; gap: 8px; }
.et-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--et-text);
}
.et-radio input[type="radio"] { accent-color: var(--et-accent); width: 16px; height: 16px; }
.et-inline-input {
    display: inline-block !important;
    width: auto !important;
    padding: 6px 10px !important;
    margin-left: 8px;
    font-size: .85rem !important;
}

.et-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 4px;
}
.et-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--et-text);
    background: var(--et-surface);
    border: 1.5px solid var(--et-border);
    border-radius: 8px;
    padding: 10px 14px;
    transition: var(--et-transition);
}
.et-checkbox:hover { border-color: var(--et-accent); }
.et-checkbox input[type="checkbox"] { accent-color: var(--et-accent); width: 16px; height: 16px; flex-shrink: 0; }

.et-checkbox--legal {
    grid-column: 1 / -1;
    background: rgba(94,234,212,.06);
    border-color: rgba(94,234,212,.25);
    padding: 14px 18px;
}
.et-checkbox--legal a { color: var(--et-accent); text-decoration: none; }
.et-checkbox--legal a:hover { text-decoration: underline; }

.et-others-text {
    grid-column: 1 / -1;
    background: var(--et-surface) !important;
    border: 1.5px solid var(--et-border) !important;
    border-radius: 8px !important;
    color: var(--et-text) !important;
    font-family: var(--et-font-body) !important;
    font-size: .9rem !important;
    padding: 10px 14px !important;
    width: 100% !important;
}

.et-form-submit {
    margin-top: 32px;
    text-align: center;
}

/* ════════════════════════════════════════════════════
   BOTONES
════════════════════════════════════════════════════ */
.et-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 10px;
    font-family: var(--et-font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--et-transition);
    text-decoration: none;
    line-height: 1;
}
.et-btn--primary {
    background: linear-gradient(135deg, var(--et-accent), #2DD4BF);
    color: var(--et-bg);
    box-shadow: 0 4px 20px rgba(94,234,212,.3);
}
.et-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(94,234,212,.45);
    filter: brightness(1.08);
}
.et-btn--ghost {
    background: transparent;
    color: var(--et-muted);
    border: 1.5px solid var(--et-border);
}
.et-btn--ghost:hover { color: var(--et-text); border-color: var(--et-text); }
.et-btn--large { padding: 16px 36px; font-size: 1.05rem; }
.et-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ════════════════════════════════════════════════════
   RESULTADO
════════════════════════════════════════════════════ */
.et-result-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 80px;
}
.et-result-confetti {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 400px;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}
.et-confetti-piece {
    position: absolute;
    top: 0;
    animation: etConfettiFall linear forwards;
}

.et-result-card {
    background: var(--et-surface);
    border: 1.5px solid var(--et-border);
    border-radius: 24px;
    padding: 52px 40px 48px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: var(--et-shadow);
    animation: etPop .6s ease both;
    position: relative;
    z-index: 1;
}
@media (max-width: 480px) {
    .et-result-card { padding: 36px 22px 36px; }
}

/* Badge de nivel */
.et-result-badge {
    width: 120px; height: 120px;
    margin: 0 auto 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.et-result-badge__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--level-color, var(--et-accent)) 0%, var(--et-surface2) 0%);
    padding: 5px;
    animation: etSpin 2s ease-out 1 forwards;
}
.et-result-badge__ring::after {
    content: '';
    position: absolute;
    inset: 5px;
    background: var(--et-surface);
    border-radius: 50%;
}
.et-result-badge__level {
    font-family: var(--et-font-head);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--level-color, var(--et-accent));
    position: relative;
    z-index: 1;
    line-height: 1;
    animation: etPop .6s ease .4s both;
}
.et-result-badge__label {
    font-size: .7rem;
    color: var(--et-muted);
    letter-spacing: .12em;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-top: 2px;
}

.et-result-title {
    font-family: var(--et-font-head);
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--et-white);
    margin-bottom: 10px;
}
.et-result-level-name {
    font-size: 1rem;
    color: var(--et-muted);
    margin-bottom: 14px;
}
.et-result-level-name strong { color: var(--et-accent); font-size: 1.15rem; }
.et-result-desc {
    color: var(--et-muted);
    font-size: .95rem;
    line-height: 1.65;
    margin-bottom: 32px;
    padding: 16px 20px;
    background: var(--et-surface2);
    border-radius: var(--et-radius-sm);
    border-left: 3px solid var(--et-accent);
    text-align: left;
}

/* Stats */
.et-result-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    border: 1.5px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    overflow: hidden;
}
.et-stat {
    flex: 1;
    padding: 18px 12px;
    text-align: center;
    border-right: 1.5px solid var(--et-border);
}
.et-stat:last-child { border-right: none; }
.et-stat__value {
    font-family: var(--et-font-head);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--et-white);
    line-height: 1;
    margin-bottom: 6px;
}
.et-stat__label {
    font-size: .73rem;
    color: var(--et-muted);
    letter-spacing: .03em;
}

/* Barra progreso resultado */
.et-result-progress {
    height: 8px;
    background: var(--et-surface2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 32px;
}
.et-result-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color, var(--et-accent)), var(--et-accent2));
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.et-result-progress__fill--animate { width: var(--pct, 0%); }

.et-result-cta p {
    color: var(--et-muted);
    font-size: .9rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .et-question { padding: 24px 18px; }
    .et-quiz-nav { flex-direction: column-reverse; }
    .et-btn { width: 100%; justify-content: center; }
    .et-result-stats { flex-direction: column; }
    .et-stat { border-right: none; border-bottom: 1.5px solid var(--et-border); }
    .et-stat:last-child { border-bottom: none; }
}
