/* ═══════════════════════════════════════════════════════════
   AIA Consultores — Encuesta Detalle v2.0
   5-step survey with real questions from PDF
   ENCUESTAS AIA CONSULTORES Y CONSTRUCTORES
═══════════════════════════════════════════════════════════ */


/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --orange:        #f0842c;
    --orange-gold:   #fca311;
    --orange-glow:   rgba(240,132,44,.18);
    --navy:          #0f172a;
    --navy-mid:      #1e293b;
    --slate:         #64748b;
    --slate-light:   #94a3b8;
    --light:         #f7f8fc;
    --border:        #e2e8f0;
    --white:         #ffffff;
    --green:         #10b981;
    --red:           #ef4444;
    --radius-sm:     12px;
    --radius-md:     20px;
    --radius-lg:     32px;
    --ease:          cubic-bezier(.19,1,.22,1);
    --shadow-card:   0 20px 60px -10px rgba(15,23,42,.12);
    --shadow-glow:   0 14px 40px rgba(240,132,44,.22);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    
    color: var(--navy);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    /* Imagen de fondo fija */
    background:
        linear-gradient(
            135deg,
            rgba(10, 25, 70, 0.72) 0%,
            rgba(15, 60, 120, 0.58) 50%,
            rgba(8, 35, 90, 0.68) 100%
        ),
        url('../img/fondo/encuesta-bg.jpg') center center / cover fixed no-repeat;
}

/* ════════════════════════════════════════════════════════════
   TOP BAR
════════════════════════════════════════════════════════════ */
.edet-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(8, 20, 55, 0.65);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 48px;
    gap: 16px;
}

.edet-topbar__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.80);
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    transition: color .3s var(--ease), gap .3s;
}
.edet-topbar__back { color: rgba(255,255,255,.80); }
.edet-topbar__back:hover { color: var(--orange-gold); gap: 12px; }
.edet-topbar__back i { font-size: .95rem; }

.edet-topbar__cat {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(240,132,44,.10);
    border: 1.5px solid rgba(240,132,44,.20);
    color: var(--orange);
    padding: 7px 20px;
    border-radius: 100px;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.edet-topbar__brand {
    font-size: .95rem;
    font-weight: 800;
    color: rgba(255,255,255,.90);
    letter-spacing: -.5px;
}

/* ════════════════════════════════════════════════════════════
   MAIN LAYOUT
════════════════════════════════════════════════════════════ */
.edet-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 130px);
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    gap: 30px;
    align-items: start;
}

/* ════════════════════════════════════════════════════════════
   LEFT INFO PANEL
════════════════════════════════════════════════════════════ */
.edet-panel {
    background: rgba(8, 18, 50, 0.70);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(255,255,255,.10);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    position: sticky;
    top: 90px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
    overflow: hidden;
}

/* Decorative accent glow */
.edet-panel::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    background: rgba(240,132,44,.10);
    border-radius: 50%;
    top: -80px; right: -80px;
    pointer-events: none;
}

.edet-panel__header { position: relative; z-index: 1; margin-bottom: 36px; }

.edet-panel__icon {
    width: 50px; height: 50px;
    background: rgba(240,132,44,.18);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--orange-gold);
    margin-bottom: 18px;
}

.edet-panel__cat {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    color: var(--white);
}

.edet-panel__desc {
    font-size: .9rem;
    color: rgba(255,255,255,.6);
    line-height: 1.65;
}

.edet-panel__stats {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.edet-panel__stat { display: flex; flex-direction: column; }

.edet-panel__stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--orange-gold);
    letter-spacing: -1px;
    line-height: 1;
}
.edet-panel__stat-num .fa-star { font-size: 1.4rem; color: #fbbf24; vertical-align: middle; }

.edet-panel__stat-label {
    font-size: .82rem;
    color: rgba(255,255,255,.50);
    font-weight: 600;
    margin-top: 4px;
}

.edet-panel__divider {
    border: none;
    border-top: 1.5px solid rgba(255,255,255,.10);
    margin-bottom: 28px;
}

/* Step Tracker */
.edet-steps { display: flex; flex-direction: column; gap: 24px; position: relative; z-index: 1; }

.edet-step {
    display: flex; align-items: center; gap: 16px;
    opacity: .3;
    transition: opacity .5s var(--ease);
}
.edet-step.active { opacity: 1; }

.edet-step__dot {
    width: 42px; height: 42px; min-width: 42px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; color: rgba(255,255,255,.5);
    transition: background .4s, color .4s, border-color .4s, box-shadow .4s;
}
.edet-step.active .edet-step__dot {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
    box-shadow: 0 6px 18px rgba(240,132,44,.35);
}

.edet-step__info strong {
    display: block;
    font-size: .9rem;
    font-weight: 800;
    color: var(--white);
}
.edet-step__info p {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   RIGHT FORM PANEL
════════════════════════════════════════════════════════════ */
.edet-form-wrap {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(8,20,55,.22), inset 0 1px 0 rgba(255,255,255,.6);
    padding: 48px 56px;
}

/* ── Progress ─────────────────────────────────────────────── */
.edet-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 56px;
}
.edet-progress__track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.edet-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--orange-gold));
    border-radius: 10px;
    width: 0%;
    transition: width .7s var(--ease);
}
.edet-progress__label {
    font-size: .82rem;
    font-weight: 800;
    color: var(--slate);
    white-space: nowrap;
}

/* ── Skeleton Loader ──────────────────────────────────────── */
.edet-skeleton { padding: 8px 0; }
.sk-line {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 10px;
    margin-bottom: 16px;
}
.sk-title  { height: 36px; width: 60%; }
.sk-sub    { height: 18px; width: 40%; margin-bottom: 36px; }
.sk-grid   { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.sk-card   { height: 54px; border-radius: 12px;
             background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
             background-size: 200% 100%; animation: shimmer 1.6s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Loading spinner (sidebar) ────────────────────────────── */
.edet-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 24px 0; opacity: .6;
}
.edet-loading__spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: var(--orange-gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.edet-loading p { font-size: .82rem; color: rgba(255,255,255,.5); }

/* ── Questions wrap (scroll within pane) ─────────────────── */
.edet-questions-wrap { display: flex; flex-direction: column; gap: 0; }

/* ── Step Panes ───────────────────────────────────────────── */
.edet-step-pane { display: none; animation: paneIn .55s var(--ease); }
.edet-step-pane.active { display: block; }

@keyframes paneIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Pane Header ──────────────────────────────────────────── */
.edet-pane-hdr { margin-bottom: 32px; }

.edet-pane-tag {
    display: inline-block;
    color: var(--orange);
    font-weight: 800;
    font-size: .75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.edet-pane-hdr h2 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.1;
}

.edet-pane-hdr p {
    font-size: 0.92rem;
    color: var(--slate);
    line-height: 1.6;
}

/* ── Fields ───────────────────────────────────────────────── */
.edet-fields { display: flex; flex-direction: column; gap: 22px; }

.edet-field { display: flex; flex-direction: column; }

.edet-field label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: .88rem;
    color: var(--navy-mid);
    margin-bottom: 10px;
}
.edet-field label i { color: var(--orange); }

.edet-field input,
.edet-field textarea {
    width: 100%;
    padding: 14px 18px;
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    
    color: var(--navy);
    transition: border-color .3s, box-shadow .3s, background .3s;
    resize: none;
}
.edet-field input:focus,
.edet-field textarea:focus {
    outline: none;
    background: var(--white);
    border-color: var(--orange);
    box-shadow: 0 0 0 4px var(--orange-glow);
}
.edet-field input.edet-error,
.edet-field textarea.edet-error {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

.edet-char-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}
.edet-char-counter, .edet-char-min {
    font-size: .82rem;
    color: var(--slate-light);
    font-weight: 600;
}
.edet-char-counter.danger { color: var(--red); }

/* ── Star Rating ──────────────────────────────────────────── */
.edet-stars { text-align: center; padding: 16px 0; }

.edet-stars__row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.edet-star {
    background: none;
    border: none;
    font-size: 3rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: color .2s, transform .28s cubic-bezier(.68,-.55,.265,1.55);
    line-height: 1;
}
.edet-star:hover { transform: scale(1.3); }
.edet-star.lit { color: #fbbf24; }
.edet-star.selected { color: #f59e0b; transform: scale(1.15); }

.edet-stars__hint {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate);
    height: 28px;
    transition: color .3s;
}

/* ── Pills ─────────────────────────────────────────────────── */
.edet-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.edet-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--white);
    transition: border-color .3s, background .3s, transform .35s var(--ease), box-shadow .3s;
}
.edet-pill:hover {
    border-color: var(--orange);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(240,132,44,.10);
}
.edet-pill.selected {
    border-color: var(--orange);
    background: #fff8f2;
    box-shadow: 0 8px 24px rgba(240,132,44,.14);
}

.edet-pill__icon {
    width: 44px; height: 44px; min-width: 44px;
    background: #f1f5f9;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: var(--orange);
    transition: background .3s, color .3s;
}
.edet-pill.selected .edet-pill__icon { background: var(--orange); color: var(--white); }
.edet-pill strong { font-size: .9rem; font-weight: 700; color: var(--navy); }

/* ── Success Screen ───────────────────────────────────────── */
.edet-success {
    display: none;
    text-align: center;
    padding: 40px 0 20px;
    animation: paneIn .8s var(--ease);
}

.edet-success__anim {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
}

.edet-success__circle {
    width: 100px; height: 100px;
    background: linear-gradient(135deg, var(--green), #34d399);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2.8rem; color: var(--white);
    box-shadow: 0 16px 48px rgba(16,185,129,.30);
    position: relative; z-index: 2;
    animation: popIn .65s cubic-bezier(.68,-.55,.265,1.55);
}

.edet-success__rings {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.edet-success__rings span {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(16,185,129,.25);
    animation: ringPulse 2s ease-out infinite;
}
.edet-success__rings span:nth-child(1) { width: 130px; height: 130px; animation-delay: 0s; }
.edet-success__rings span:nth-child(2) { width: 165px; height: 165px; animation-delay: .4s; }
.edet-success__rings span:nth-child(3) { width: 200px; height: 200px; animation-delay: .8s; }

@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ringPulse {
    0%   { transform: scale(.8); opacity: .8; }
    100% { transform: scale(1.3); opacity: 0; }
}

.edet-success h2 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 14px;
    color: var(--navy);
}
.edet-success p {
    font-size: 1rem;
    color: var(--slate);
    max-width: 420px;
    margin: 0 auto 36px;
    line-height: 1.65;
}

.edet-success__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */
.edet-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 36px;
    border-radius: 100px;
    font-size: .97rem;
    font-weight: 800;
    
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all .4s var(--ease);
}

.edet-btn--primary {
    background: var(--orange);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}
.edet-btn--primary:hover { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(240,132,44,.28); }

.edet-btn--ghost {
    background: transparent;
    color: var(--slate);
    border-color: var(--border);
}
.edet-btn--ghost:hover { border-color: var(--navy); color: var(--navy); }

/* Navigation buttons */
.edet-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 52px;
    padding-top: 36px;
    border-top: 2px solid var(--border);
}

.edet-btn--prev {
    background: transparent;
    border-color: var(--border);
    color: var(--slate);
}
.edet-btn--prev:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.edet-btn--prev:disabled { opacity: .3; cursor: not-allowed; }

.edet-btn--next {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 12px 32px rgba(15,23,42,.18);
}
.edet-btn--next:hover:not(:disabled) {
    background: var(--orange);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}
.edet-btn--next:disabled { opacity: .5; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .edet-main { grid-template-columns: 1fr; padding: 36px 24px 60px; }
    .edet-panel { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    .edet-panel__header { grid-column: 1 / -1; }
    .edet-panel::before { display: none; }
    .edet-panel__divider { grid-column: 1 / -1; }
    .edet-steps { grid-column: 1 / -1; grid-template-columns: repeat(2,1fr); display: grid; }
    .edet-form-wrap { padding: 48px 44px; }
}

@media (max-width: 768px) {
    .edet-topbar { padding: 12px 20px; }
    .edet-topbar__brand { display: none; }
    .edet-form-wrap { padding: 32px 22px; }
    .edet-pane-hdr h2 { font-size: 1.7rem; }
    .edet-pills { grid-template-columns: 1fr; }
    .edet-stars { padding: 8px 0; }
    .edet-star { font-size: 2.6rem; }
    .edet-panel { grid-template-columns: 1fr; }
    .edet-steps { grid-template-columns: 1fr; }
    .edet-nav { flex-direction: column-reverse; gap: 12px; }
    .edet-btn { width: 100%; justify-content: center; }
    .edet-options { grid-template-columns: 1fr; }
    .edet-options--binary { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   SURVEY QUESTIONS  (new in v2.0 — questions from PDF)
════════════════════════════════════════════════════════════ */

/* ── Question block ──────────────────────────────────────── */
.edet-question {
    margin-bottom: 30px;
}
.edet-question:last-child { margin-bottom: 0; }

.edet-question__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 14px;
    line-height: 1.4;
}
.edet-question__label i {
    color: var(--orange);
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* ── Radio option cards ──────────────────────────────────── */
.edet-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.edet-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #f8fafc;
    transition: border-color .3s var(--ease), background .3s, transform .3s var(--ease), box-shadow .3s;
    text-align: center;
}
.edet-option:hover {
    border-color: var(--orange);
    background: #fff8f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240,132,44,.10);
}
.edet-option.selected {
    border-color: var(--orange);
    background: linear-gradient(135deg, #fff5eb, #fff8f2);
    box-shadow: 0 6px 24px rgba(240,132,44,.15);
}
.edet-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}
.edet-option span {
    font-size: .88rem;
    font-weight: 700;
    color: var(--slate);
    transition: color .3s;
    pointer-events: none;
}
.edet-option.selected span { color: var(--orange); }

/* ── Binary Yes / No options ─────────────────────────────── */
.edet-options--binary {
    display: flex;
    gap: 14px;
}
.edet-options--binary .edet-option {
    flex: 1;
    padding: 18px 24px;
    border-radius: var(--radius-md);
    gap: 10px;
    flex-direction: row;
    justify-content: center;
}
.edet-options--binary .edet-option span {
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.edet-option--yes.selected { border-color: var(--green); background: #f0fdf9; }
.edet-option--yes.selected span { color: var(--green); }
.edet-option--yes:hover { border-color: var(--green); background: #f0fdf9; }

.edet-option--no.selected { border-color: var(--red); background: #fff5f5; }
.edet-option--no.selected span { color: var(--red); }
.edet-option--no:hover { border-color: var(--red); background: #fff5f5; }

/* ── Group error highlight ────────────────────────────────── */
.edet-group-error {
    border-radius: var(--radius-sm);
    outline: 2.5px solid var(--red);
    outline-offset: 4px;
    animation: shakeGroup .4s ease;
}
@keyframes shakeGroup {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-8px); }
    75%       { transform: translateX(8px); }
}

/* ── Star rating inside step pane (not full width) ────────── */
.edet-step-pane .edet-stars {
    text-align: left;
    padding: 12px 0 4px;
}
.edet-step-pane .edet-stars .edet-stars__row {
    justify-content: flex-start;
}
.edet-step-pane .edet-star { font-size: 2.8rem; }

@media (max-width: 480px) {
    .edet-step-pane .edet-star { font-size: 2.1rem; }
    .edet-options { grid-template-columns: repeat(2, 1fr); }
    .edet-options--binary { flex-direction: column; }
}
