/* =============================================
   TEST DEL ELEMENTO DOMINANTE — styles.css
   Base oscura neutra + 4 temas dinámicos:
   theme-fire  🔥  carmesí / naranja
   theme-water 💧  azul profundo / cian
   theme-earth 🌿  verde musgo / marrón
   theme-air   🌬️  lavanda / plata
   ============================================= */

/* ── Variables base ── */
:root {
    --black:    #060608;
    --surface:  #0e0d16;
    --surface-2:#151322;
    --surface-3:#1c1a30;
    --border:   rgba(255,255,255,.06);
    --text:     #ece8f8;
    --text-muted:#6860a0;

    /* Colores activos — se sobreescriben por tema */
    --accent:        #a090d0;
    --accent-light:  #c0b0f0;
    --accent-glow:   rgba(160,144,208,.4);
    --border-accent: rgba(160,144,208,.3);
    --opt-0: #e0603a;
    --opt-1: #3a90c0;
    --opt-2: #6a9a40;
    --opt-3: #9080c0;

    --radius:   16px;
    --radius-sm:10px;
    --transition:.25s ease;
}

/* ── Tema Fuego ── */
body.theme-fire {
    --accent:        #e06030;
    --accent-light:  #f08040;
    --accent-glow:   rgba(224,96,48,.5);
    --border-accent: rgba(224,96,48,.4);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(120,30,10,.4) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(80,20,5,.3)  0%, transparent 55%);
}
/* ── Tema Agua ── */
body.theme-water {
    --accent:        #3090d0;
    --accent-light:  #50b0e8;
    --accent-glow:   rgba(48,144,208,.5);
    --border-accent: rgba(48,144,208,.4);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(10,40,80,.5)  0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(5,25,60,.4)   0%, transparent 55%);
}
/* ── Tema Tierra ── */
body.theme-earth {
    --accent:        #6a9a40;
    --accent-light:  #8aba60;
    --accent-glow:   rgba(106,154,64,.5);
    --border-accent: rgba(106,154,64,.4);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(20,40,10,.5)  0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(40,25,5,.4)   0%, transparent 55%);
}
/* ── Tema Aire ── */
body.theme-air {
    --accent:        #9080d0;
    --accent-light:  #b0a0e8;
    --accent-glow:   rgba(144,128,208,.5);
    --border-accent: rgba(144,128,208,.4);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(30,20,60,.5)  0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(20,15,50,.4)  0%, transparent 55%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--black);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    min-height: 100vh;
    transition: background-image .6s ease;
}

/* ── Steps ── */
.step {
    display: none;
    min-height: 100vh;
    padding: 40px 20px 80px;
    animation: fadeUp .45s ease both;
}
.step.active { display: flex; flex-direction: column; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.container { max-width: 720px; margin: 0 auto; width: 100%; }
.center-col {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; flex: 1; gap: 24px;
}

/* ── Preview 4 elementos ── */
.elements-preview {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}
.el {
    font-size: 2.2rem;
    display: block;
    animation: float-el 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,255,255,.15));
}
.el-fire  { animation-delay: 0s; }
.el-water { animation-delay: .4s; }
.el-earth { animation-delay: .8s; }
.el-air   { animation-delay: 1.2s; }

@keyframes float-el {
    0%, 100% { transform: translateY(0);   opacity: .7; }
    50%       { transform: translateY(-8px); opacity: 1;  }
}

/* ── Título hero ── */
.hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: .03em;
    background: linear-gradient(135deg, #f0e8d8 0%, var(--accent-light, #c0b0f0) 60%, #f0e8d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
    transition: background .5s ease;
}
.hero-sub {
    font-size: 1.05rem;
    color: #8880a8;
    max-width: 480px;
    line-height: 1.7;
    font-style: italic;
}

/* ── Botón principal ── */
.btn-primary {
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--accent, #a090d0) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 15px 42px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 24px var(--accent-glow, rgba(160,144,208,.4));
    margin-top: 8px;
}
.btn-primary:hover {
    opacity: .9;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow, rgba(160,144,208,.5));
}

/* ── Progreso ── */
.progress-bar-wrap {
    width: 100%; height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #a090d0), var(--accent-light, #c0b0f0));
    border-radius: 2px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    width: 0%;
    box-shadow: 0 0 8px var(--accent-glow, rgba(160,144,208,.4));
}
.progress-label {
    font-size: .78rem;
    color: var(--text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 32px;
    text-align: right;
}

/* ── Preguntas ── */
.question-block { width: 100%; }
.question-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem; font-weight: 600;
    color: var(--surface-3);
    line-height: 1; margin-bottom: 8px;
    user-select: none;
}
.question-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600; color: var(--text);
    line-height: 1.3; margin-bottom: 28px;
}

/* ── Opciones ── */
.options-grid { display: flex; flex-direction: column; gap: 10px; }

.opt-btn {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    cursor: pointer; text-align: left;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    width: 100%;
}
.opt-btn:hover { background: var(--surface-2); transform: translateX(4px); }

/* Hover y selected por elemento */
.opt-btn.opt-el-0:hover { border-color: rgba(224,96,58,.5); }
.opt-btn.opt-el-1:hover { border-color: rgba(58,144,192,.5); }
.opt-btn.opt-el-2:hover { border-color: rgba(106,154,64,.5); }
.opt-btn.opt-el-3:hover { border-color: rgba(144,128,192,.5); }

.opt-btn.opt-el-0.selected { border-color: var(--opt-0); box-shadow: 0 0 0 1px var(--opt-0), 0 4px 16px rgba(224,96,58,.3); transform: translateX(6px); }
.opt-btn.opt-el-1.selected { border-color: var(--opt-1); box-shadow: 0 0 0 1px var(--opt-1), 0 4px 16px rgba(58,144,192,.3); transform: translateX(6px); }
.opt-btn.opt-el-2.selected { border-color: var(--opt-2); box-shadow: 0 0 0 1px var(--opt-2), 0 4px 16px rgba(106,154,64,.3); transform: translateX(6px); }
.opt-btn.opt-el-3.selected { border-color: var(--opt-3); box-shadow: 0 0 0 1px var(--opt-3), 0 4px 16px rgba(144,128,192,.3); transform: translateX(6px); }

.opt-icon {
    font-size: 1.3rem; line-height: 1;
    flex-shrink: 0; margin-top: 2px;
}
.opt-text { font-size: .95rem; color: var(--text); line-height: 1.45; }

/* ── Loading ── */
#step-loading { justify-content: center; align-items: center; gap: 28px; }

.loading-elements {
    position: relative;
    width: 130px; height: 130px;
    display: flex; align-items: center; justify-content: center;
}
.elem-ring {
    position: absolute; border-radius: 50%;
    border: 1.5px solid transparent;
    animation: spin-elem linear infinite;
}
.r1 { inset: 0;    border-top-color: var(--accent-light, #c0b0f0); border-right-color: var(--accent-light, #c0b0f0); animation-duration: 3.5s; opacity: .6; }
.r2 { inset: 16px; border-bottom-color: var(--accent, #a090d0);    border-left-color: var(--accent, #a090d0);   animation-duration: 2.5s; animation-direction: reverse; opacity: .5; }
.r3 { inset: 32px; border-top-color: rgba(255,255,255,.3); animation-duration: 1.8s; opacity: .3; }

@keyframes spin-elem { to { transform: rotate(360deg); } }

.elem-core {
    font-size: 2.4rem; z-index: 1;
    animation: float-el 2s ease-in-out infinite;
    filter: drop-shadow(0 0 14px var(--accent-glow, rgba(160,144,208,.5)));
}

.loading-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; font-weight: 600;
    color: #c8c0e8; text-align: center;
}
.loading-sub {
    font-size: .9rem; color: var(--text-muted);
    font-style: italic; text-align: center;
}

/* ── Resultado ── */
#step-result { justify-content: flex-start; }

.result-header {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    margin-bottom: 28px; text-align: center;
}
.result-symbol {
    font-size: 3rem; line-height: 1;
    display: block;
    animation: float-el 4s ease-in-out infinite;
    filter: drop-shadow(0 0 16px var(--accent-glow, rgba(160,144,208,.5)));
}
.result-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    font-weight: 600;
    background: linear-gradient(135deg, #f0e8d8 0%, var(--accent-light, #c0b0f0) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border-accent, rgba(160,144,208,.3));
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-bottom: 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
    position: relative; overflow: hidden;
    transition: border-color .5s ease;
}
.result-card::before {
    content: attr(data-el-symbol);
    position: absolute; top: -10px; right: 10px;
    font-size: 8rem; opacity: .05;
    pointer-events: none; user-select: none; line-height: 1;
}

.result-text p {
    font-size: 1.05rem; line-height: 1.85;
    color: var(--text); margin-bottom: 18px;
}
.result-text p:last-child { margin-bottom: 0; }

/* ── Botones ── */
.result-actions { display: flex; justify-content: center; }
.btn-reset {
    background: transparent;
    color: var(--accent-light, #c0b0f0);
    border: 1px solid var(--accent, #a090d0);
    border-radius: var(--radius-sm);
    padding: 12px 32px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem; font-weight: 500;
    letter-spacing: .04em; cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.btn-reset:hover {
    background: var(--accent, #a090d0);
    color: #fff;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    display: none; align-items: center; justify-content: center;
    z-index: 100; backdrop-filter: blur(6px); padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--surface-2);
    border: 1px solid var(--border-accent, rgba(160,144,208,.3));
    border-radius: var(--radius);
    padding: 40px 32px; max-width: 440px; width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.7);
    animation: fadeUp .3s ease;
}
.modal-icon { font-size: 2.2rem; margin-bottom: 16px; display: block; }
.modal-msg  { color: var(--text); line-height: 1.6; margin-bottom: 20px; }
.btn-modal-close {
    background: var(--accent, #a090d0);
    color: #fff; border: none;
    border-radius: var(--radius-sm);
    padding: 12px 28px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: opacity var(--transition); margin-top: 8px;
}
.btn-modal-close:hover { opacity: .85; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .result-card   { padding: 22px 18px; }
    .question-text { font-size: 1.3rem; }
    .opt-btn       { padding: 12px 14px; }
    .elements-preview { gap: 14px; }
    .el { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
