/* ==========================================================================
   TB Diagnósticos — formulario público
   Todos los colores, tipografías y radios salen de las variables que inyecta
   "Marca y estilos" (class-tbd-marca.php). Los valores de reserva mantienen la
   identidad original de TB Consulting: navy #0d2340 / naranja #ff7a1a.
   ========================================================================== */

.tbd-wrap {
    --tbd-primario: #ff7a1a;
    --tbd-primario-osc: #e0691a;
    --tbd-primario-15: rgba(255,122,26,.15);
    --tbd-primario-20: rgba(255,122,26,.2);
    --tbd-secundario: #0d2340;
    --tbd-secundario-60: rgba(13,35,64,.6);
    --tbd-fondo: #f4f6fa;
    --tbd-borde: #e2e6ee;
    --tbd-texto: #1a1a2e;
    --tbd-whatsapp: #25d366;
    --tbd-whatsapp-osc: #1ebe5b;
    --tbd-fuente-titulos: 'Sora', sans-serif;
    --tbd-fuente-texto: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --tbd-radio: 10px;
    --tbd-radio-sm: 6px;
    --tbd-ancho: 820px;

    font-family: var(--tbd-fuente-texto);
    max-width: var(--tbd-ancho);
    margin: 0 auto;
    color: var(--tbd-texto);
    line-height: 1.5;
}
.tbd-wrap *, .tbd-wrap *::before, .tbd-wrap *::after { box-sizing: border-box; }

/* ── Progreso ───────────────────────────────────────────────────────────── */
.tbd-progress-outer { margin-bottom: 28px; }
.tbd-progress-bar { background: var(--tbd-fondo); border-radius: 20px; height: 10px; overflow: hidden; }
.tbd-progress-fill { background: linear-gradient(90deg, var(--tbd-primario), var(--tbd-primario-osc)); height: 100%; transition: width .35s ease; }
.tbd-progress-text { text-align: right; font-size: 13px; color: #667; margin: 6px 0 0; }

/* ── Pasos ──────────────────────────────────────────────────────────────── */
.tbd-step { display: none; animation: tbdFadeIn .3s ease; }
.tbd-step.is-active { display: block; }
@keyframes tbdFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tbd-step-title { font-family: var(--tbd-fuente-titulos); color: var(--tbd-secundario); font-size: 22px; margin: 0 0 4px; line-height: 1.25; }
.tbd-area-meta {
    display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
    background: var(--tbd-fondo); color: var(--tbd-secundario); border-radius: 99px;
    padding: 3px 12px; margin: 0 0 8px;
}
.tbd-step-sub { color: #667; font-size: 14px; margin: 0 0 20px; }

/* ── Campos ─────────────────────────────────────────────────────────────── */
.tbd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.tbd-field-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .tbd-grid-2 { grid-template-columns: 1fr; } }

.tbd-field label { display: block; font-size: 13px; font-weight: 600; color: var(--tbd-secundario); margin-bottom: 5px; }
.tbd-field input, .tbd-field select, .tbd-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--tbd-borde); border-radius: var(--tbd-radio-sm);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--tbd-texto);
}
.tbd-field textarea { resize: vertical; min-height: 76px; }
.tbd-field input:focus, .tbd-field select:focus, .tbd-field textarea:focus {
    outline: none; border-color: var(--tbd-primario); box-shadow: 0 0 0 3px var(--tbd-primario-15);
}
.tbd-field input.tbd-invalid, .tbd-field select.tbd-invalid { border-color: #d64545; }

/* ── Preguntas y escala ─────────────────────────────────────────────────── */
.tbd-question {
    background: var(--tbd-fondo); border-radius: var(--tbd-radio); padding: 16px 18px;
    margin-bottom: 14px; border: 1px solid var(--tbd-borde);
}
.tbd-question.tbd-answered { border-color: var(--tbd-primario); }
.tbd-question.tbd-missing { border-color: #d64545; }
.tbd-question-text { font-weight: 600; font-size: 14.5px; color: var(--tbd-secundario); margin: 0 0 4px; }
.tbd-question-help {
    font-size: 12.5px; color: #6b7280; line-height: 1.45; margin: 0 0 12px;
    padding-left: 10px; border-left: 2px solid var(--tbd-borde);
}
.tbd-question-tag {
    display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; color: var(--tbd-primario); background: var(--tbd-primario-15);
    border-radius: 99px; padding: 2px 10px; margin-bottom: 7px;
}
.tbd-likert-simple .tbd-likert-option { flex: 0 0 auto; }
.tbd-likert-simple .tbd-likert-circle { margin-bottom: 0; width: 42px; height: 42px; font-size: 15px; }
.tbd-likert-simple { justify-content: flex-start; gap: 8px; }
.tbd-likert-extremos {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 11.5px; color: #7a828f; margin-top: 8px;
}
.tbd-area-desc {
    background: var(--tbd-fondo); border-left: 3px solid var(--tbd-primario);
    border-radius: var(--tbd-radio-sm); padding: 10px 14px; margin: 0 0 14px;
    font-size: 13.5px; color: #4b5563; line-height: 1.5;
}

.tbd-likert { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.tbd-likert-option {
    flex: 1 1 18%; display: flex; flex-direction: column; align-items: center; text-align: center;
    cursor: pointer; padding: 8px 4px; border-radius: var(--tbd-radio-sm);
    border: 1px solid transparent; transition: all .15s; position: relative;
}
.tbd-likert-option:hover { background: #fff; }
.tbd-likert-option input { position: absolute; opacity: 0; pointer-events: none; }
.tbd-likert-circle {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid #ccd4e0; display: flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #667;
    margin-bottom: 6px; background: #fff; transition: all .15s;
}
.tbd-likert-option input:checked + .tbd-likert-circle {
    background: var(--tbd-primario); border-color: var(--tbd-primario); color: #fff; transform: scale(1.08);
}
.tbd-likert-option input:focus-visible + .tbd-likert-circle { box-shadow: 0 0 0 3px var(--tbd-primario-20); }
.tbd-likert-option input:checked ~ .tbd-likert-label { color: var(--tbd-secundario); font-weight: 700; }
.tbd-likert-label { font-size: 10.5px; color: #889; line-height: 1.2; }

/* Escalas largas: se reparten en dos filas en pantallas pequeñas. */
.tbd-likert-6 .tbd-likert-option, .tbd-likert-7 .tbd-likert-option { flex: 1 1 14%; }
.tbd-likert-8 .tbd-likert-option, .tbd-likert-9 .tbd-likert-option, .tbd-likert-10 .tbd-likert-option { flex: 1 1 12%; }
@media (max-width: 640px) {
    .tbd-likert { justify-content: center; }
    .tbd-likert-option { flex: 1 1 30%; }
}

/* ── Navegación ─────────────────────────────────────────────────────────── */
.tbd-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 10px; }
.tbd-wrap .tbd-btn,
.tbd-wrap button.tbd-btn {
    padding: 12px 26px; border-radius: var(--tbd-radio-sm); border: 1px solid transparent;
    font-weight: 700; font-size: 14px; font-family: inherit; cursor: pointer;
    transition: all .15s; background: #fff; color: var(--tbd-secundario); line-height: 1.2;
}
.tbd-wrap .tbd-btn-primary,
.tbd-wrap button.tbd-btn-primary {
    background: var(--tbd-primario) !important;
    border-color: var(--tbd-primario) !important;
    color: #fff !important;
}
.tbd-wrap .tbd-btn-primary:hover,
.tbd-wrap button.tbd-btn-primary:hover {
    background: var(--tbd-primario-osc) !important;
    border-color: var(--tbd-primario-osc) !important;
}
.tbd-wrap .tbd-btn-secondary,
.tbd-wrap button.tbd-btn-secondary {
    background: #fff !important; color: var(--tbd-secundario) !important;
    border: 1px solid var(--tbd-borde) !important;
}
.tbd-wrap .tbd-btn-secondary:hover { background: var(--tbd-fondo) !important; }
.tbd-wrap .tbd-btn:disabled { opacity: .6; cursor: wait; }

.tbd-error-msg, .tbd-inline-error {
    color: #d64545; font-size: 13px; margin-top: 12px; font-weight: 600; text-align: center;
}

/* ── Resultado ──────────────────────────────────────────────────────────── */
.tbd-results { animation: tbdFadeIn .4s ease; }
.tbd-loading { text-align: center; padding: 60px 0; font-size: 16px; color: var(--tbd-secundario); font-weight: 600; }

.tbd-card {
    background: #fff; border: 1px solid var(--tbd-borde); border-radius: calc(var(--tbd-radio) + 4px);
    padding: 34px 26px; text-align: center;
}
.tbd-thanks-card { max-width: 480px; margin: 0 auto; }
.tbd-thanks-icon {
    width: 56px; height: 56px; border-radius: 50%; background: #2fa84f; color: #fff;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.tbd-check {
    width: 20px; height: 12px; border-left: 3px solid #fff; border-bottom: 3px solid #fff;
    transform: rotate(-45deg); display: inline-block; margin-bottom: 4px;
}
.tbd-thanks-title { font-family: var(--tbd-fuente-titulos); color: var(--tbd-secundario); font-size: 21px; margin: 0 0 8px; }
.tbd-thanks-text { color: #556; font-size: 14px; margin: 0; }

/* Resultados en pantalla (opcional, se activa por diagnóstico) */
.tbd-res-hero { text-align: center; margin-bottom: 22px; }
.tbd-res-circle {
    position: relative; width: 130px; height: 130px; border-radius: 50%;
    border: 9px solid; display: inline-block; background: #fff;
}
.tbd-res-num {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 28px; font-weight: 800; line-height: 1;
}
.tbd-res-nivel { font-size: 17px; font-weight: 800; margin: 12px 0 2px; }
.tbd-res-desc { font-size: 13.5px; color: #667; max-width: 520px; margin: 0 auto; }
.tbd-res-radar { max-width: 520px; margin: 10px auto 18px; }
.tbd-res-subhead {
    font-family: var(--tbd-fuente-titulos); font-size: 16px; color: var(--tbd-secundario);
    margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--tbd-primario);
}
.tbd-res-area { display: grid; grid-template-columns: minmax(120px,1fr) 2fr 48px; align-items: center; gap: 10px; margin-bottom: 7px; }
.tbd-res-area-name { font-size: 13px; font-weight: 600; }
.tbd-res-track { background: var(--tbd-fondo); border-radius: 99px; height: 12px; overflow: hidden; }
.tbd-res-fill { height: 100%; border-radius: 99px; }
.tbd-res-pct { font-size: 12.5px; font-weight: 700; text-align: right; }
.tbd-res-rec {
    display: flex; gap: 12px; background: var(--tbd-fondo); border-radius: var(--tbd-radio);
    padding: 12px 16px; margin-bottom: 8px; border-left: 4px solid var(--tbd-primario);
}
.tbd-res-rec-num { font-family: var(--tbd-fuente-titulos); font-size: 19px; font-weight: 800; color: var(--tbd-primario); min-width: 22px; }
.tbd-res-rec-area { font-weight: 700; color: var(--tbd-secundario); font-size: 14px; margin-bottom: 3px; }
.tbd-res-rec-text { font-size: 13px; color: #445; line-height: 1.45; }
.tbd-res-rec-detail { font-size: 12.5px; color: #667; line-height: 1.5; margin-top: 5px; }
.tbd-res-rec-detail strong { color: var(--tbd-secundario); }
.tbd-res-acciones { text-align: center; margin-top: 18px; }

.tbd-res-resumen {
    background: var(--tbd-fondo); border-left: 4px solid var(--tbd-primario);
    border-radius: var(--tbd-radio-sm); padding: 14px 16px; margin: 16px 0;
}
.tbd-res-resumen-titulo {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    color: var(--tbd-primario); margin-bottom: 5px;
}
.tbd-res-resumen p { font-size: 14px; line-height: 1.6; margin: 0; color: var(--tbd-texto); }
.tbd-res-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tbd-res-chip {
    border: 1.5px solid; border-radius: 99px; padding: 2px 11px;
    font-size: 12px; font-weight: 600; background: #fff; white-space: nowrap;
}

.tbd-res-extremos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
@media (max-width: 640px) { .tbd-res-extremos { grid-template-columns: 1fr; } }
.tbd-res-extremos > div { background: var(--tbd-fondo); border-radius: var(--tbd-radio-sm); padding: 12px 14px; }
.tbd-res-ext-titulo { font-size: 12.5px; font-weight: 800; color: var(--tbd-secundario); margin-bottom: 8px; }
.tbd-res-extremos ul { list-style: none; margin: 0; padding: 0; }
.tbd-res-extremos li { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; }
.tbd-res-extremos li b { margin-left: auto; font-weight: 800; }
.tbd-res-punto { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ── Popup de WhatsApp ──────────────────────────────────────────────────── */
.tbd-modal-overlay {
    position: fixed; inset: 0; background: var(--tbd-secundario-60); z-index: 100000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.tbd-modal-box {
    background: #fff; border-radius: calc(var(--tbd-radio) + 6px); max-width: 400px; width: 100%;
    padding: 30px 26px; text-align: center; box-shadow: 0 20px 60px rgba(13,35,64,.4);
    animation: tbdFadeIn .3s ease;
}
.tbd-modal-title { font-family: var(--tbd-fuente-titulos); color: var(--tbd-secundario); font-size: 19px; margin: 0 0 10px; }
.tbd-modal-text { font-size: 14px; color: #556; line-height: 1.6; margin: 0 0 22px; }
.tbd-whatsapp-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--tbd-whatsapp); color: #fff; font-weight: 700; font-size: 15px;
    padding: 13px 18px; border-radius: var(--tbd-radio-sm); text-decoration: none; margin-bottom: 12px;
    transition: background .15s;
}
.tbd-whatsapp-btn:hover { background: var(--tbd-whatsapp-osc); color: #fff; }
.tbd-modal-close {
    background: none; border: none; color: #889; font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 6px; font-family: inherit;
}
.tbd-modal-close:hover { color: var(--tbd-secundario); }

@media print {
    .tbd-nav, .tbd-progress-outer, .tbd-modal-overlay { display: none !important; }
}

/* Resultado de un test de orientación: manda el camino, no el promedio. */
.tbd-res-hero-voc {
    border: 2px solid var(--tbd-primario); border-radius: var(--tbd-radio);
    padding: 20px 18px; margin-bottom: 22px; background: #fff;
}
.tbd-res-eyebrow {
    margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .6px;
    text-transform: uppercase; color: #8a92a0;
}
.tbd-res-camino { margin: 0 0 8px; font-size: 24px; font-weight: 800; font-family: var(--tbd-fuente-titulos); line-height: 1.2; }
.tbd-res-afinidad {
    display: inline-block; margin: 0 0 12px; padding: 5px 14px; border-radius: 999px;
    color: #fff; font-size: 13px; font-weight: 700;
}
.tbd-res-patron {
    text-align: left; margin: 12px auto 0; max-width: 640px; padding: 10px 14px;
    border-left: 4px solid #999; background: var(--tbd-fondo); border-radius: var(--tbd-radio-sm);
    font-size: 13px; line-height: 1.5; color: #556;
}
