/* ==============================================================
   Diagnóstico Supply Chain IA
   Se apoya en los tokens de assets/css/pdx.css (--pdx-*): misma
   paleta, mismas tipografías y mismo radio que el resto de PDX.
   ============================================================== */

.dg-body {
    background: #edf0f3;
    color: var(--pdx-text, #334155);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- topbar ---------- */
.dg-topbar {
    background: var(--pdx-topbar-bg, #edf0f3);
    border-bottom: 1px solid var(--pdx-border, #e8e6e1);
    position: sticky;
    top: 0;
    z-index: 20;
}
.dg-topbar-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dg-brand { display: flex; align-items: center; flex-shrink: 0; }
.dg-brand img { height: 38px; object-fit: contain; display: block; }
.dg-topbar-tag {
    margin-left: auto;
    font-size: .8rem;
    font-weight: 600;
    color: var(--pdx-text-light, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ---------- layout ---------- */
.dg-main {
    flex: 1;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 16px 40px;
}
.dg-card {
    background: #fff;
    border: 1px solid var(--pdx-border, #e8e6e1);
    border-radius: var(--pdx-radius, 10px);
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.dg-screen { display: none; }
.dg-screen.is-active { display: block; animation: dgIn .25s ease; }
.dg-center { text-align: center; }
@keyframes dgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.dg-eyebrow {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--pdx-primary, #0a66c2);
    margin-bottom: 10px;
}
.dg-h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--pdx-dark, #1b1f23);
    line-height: 1.2;
    margin: 0 0 12px;
}
.dg-h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--pdx-dark, #1b1f23);
    margin: 0 0 10px;
}
.dg-lead { font-size: 1rem; line-height: 1.65; margin: 0 0 20px; }

/* ---------- fichas de la intro ---------- */
.dg-facts { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.dg-facts li {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px;
    background: #f7f9fb;
    border: 1px solid var(--pdx-border, #e8e6e1);
    border-radius: var(--pdx-radius-sm, 6px);
}
.dg-facts i { color: var(--pdx-primary, #0a66c2); font-size: 1.1rem; width: 22px; text-align: center; }
.dg-facts strong { display: block; font-size: .94rem; color: var(--pdx-dark, #1b1f23); }
.dg-facts span { font-size: .82rem; color: var(--pdx-text-light, #64748b); }

.dg-note {
    display: flex; gap: 11px;
    padding: 13px 15px;
    background: #fff8ec;
    border: 1px solid #f3ddb5;
    border-radius: var(--pdx-radius-sm, 6px);
    font-size: .88rem;
    line-height: 1.55;
    margin-bottom: 22px;
}
.dg-note i { color: var(--pdx-accent, #f59e0b); margin-top: 2px; }
.dg-note--soft { background: #f4f8fc; border-color: #d6e4f2; text-align: left; margin: 20px 0; }
.dg-note--soft i { color: var(--pdx-primary, #0a66c2); }

/* ---------- botones ---------- */
.dg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    background: var(--pdx-primary, #0a66c2);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 26px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .08s, opacity .18s;
}
.dg-btn:hover:not(:disabled) { background: var(--pdx-primary-dark, #004182); color: #fff; }
.dg-btn:active:not(:disabled) { transform: translateY(1px); }
.dg-btn:disabled { opacity: .42; cursor: not-allowed; }
.dg-btn-lg { width: 100%; padding: 15px 26px; font-size: 1rem; }
.dg-btn-ghost {
    background: #fff;
    color: var(--pdx-primary, #0a66c2);
    border: 1.5px solid var(--pdx-primary, #0a66c2);
}
.dg-btn-ghost:hover { background: var(--pdx-primary, #0a66c2); color: #fff; }

.dg-fineprint {
    font-size: .78rem;
    color: var(--pdx-text-light, #64748b);
    line-height: 1.5;
    margin: 12px 0 0;
}

/* ---------- cabecera del quiz ---------- */
.dg-quizhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dg-qmeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dg-badge {
    background: #eaf2fb;
    color: var(--pdx-primary-dark, #004182);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.dg-qcount { font-size: .85rem; color: var(--pdx-text-light, #64748b); }
.dg-qcount strong { color: var(--pdx-dark, #1b1f23); }

/* cronómetro circular */
.dg-timer { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.dg-timer svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.dg-timer circle { fill: none; stroke-width: 3.5; }
.dg-timer-bg { stroke: #e8e6e1; }
.dg-timer-fg {
    stroke: var(--pdx-primary, #0a66c2);
    stroke-linecap: round;
    stroke-dasharray: 119.4;   /* 2πr con r=19 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke .3s;
}
.dg-timer.is-warning .dg-timer-fg { stroke: var(--pdx-accent, #f59e0b); }
.dg-timer.is-danger  .dg-timer-fg { stroke: #e11d48; }
.dg-timer.is-danger  #dgTimerNum { color: #e11d48; }
#dgTimerNum {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .84rem; font-weight: 700;
    color: var(--pdx-dark, #1b1f23);
}

.dg-progress { height: 4px; background: #e8e6e1; border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.dg-progress-fill { height: 100%; width: 0; background: var(--pdx-primary, #0a66c2); border-radius: 4px; transition: width .3s ease; }

.dg-question {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.13rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--pdx-dark, #1b1f23);
    margin: 0 0 18px;
}

/* ---------- opciones ---------- */
.dg-options { display: grid; gap: 9px; margin-bottom: 22px; }
.dg-opt {
    display: flex; align-items: flex-start; gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid var(--pdx-border, #e8e6e1);
    border-radius: var(--pdx-radius-sm, 6px);
    font: inherit;
    font-size: .94rem;
    line-height: 1.5;
    color: var(--pdx-text, #334155);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dg-opt:hover { border-color: #9dc3e8; background: #fafcfe; }
.dg-opt.is-picked { border-color: var(--pdx-primary, #0a66c2); background: #f2f8fd; }
.dg-opt-key {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1.5px solid #c9ccd1;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .76rem; font-weight: 700;
    color: var(--pdx-text-light, #64748b);
    transition: all .15s;
}
.dg-opt.is-picked .dg-opt-key {
    background: var(--pdx-primary, #0a66c2);
    border-color: var(--pdx-primary, #0a66c2);
    color: #fff;
}

.dg-quizfoot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dg-hint { font-size: .82rem; color: var(--pdx-text-light, #64748b); }

/* ---------- formulario ---------- */
.dg-done-mark {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: #e7f8f2;
    color: var(--pdx-secondary, #13c296);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.dg-center .dg-done-mark { margin: 0 auto 16px; }
.dg-done-mark--sent { background: #eaf2fb; color: var(--pdx-primary, #0a66c2); }

.dg-field { margin-bottom: 15px; }
.dg-field label {
    display: block;
    font-size: .87rem;
    font-weight: 600;
    color: var(--pdx-dark, #1b1f23);
    margin-bottom: 6px;
}
.dg-req { color: #e11d48; }
.dg-opt-label, .dg-opt { }
.dg-field .dg-opt { display: inline; padding: 0; border: 0; }
.dg-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--pdx-border, #e8e6e1);
    border-radius: var(--pdx-radius-sm, 6px);
    font: inherit;
    font-size: .95rem;
    color: var(--pdx-text, #334155);
    background: #fff;
    transition: border-color .15s;
}
.dg-field input:focus { outline: none; border-color: var(--pdx-primary, #0a66c2); }
.dg-field input.is-invalid { border-color: #e11d48; background: #fff5f7; }
.dg-help { display: block; font-size: .78rem; color: var(--pdx-text-light, #64748b); margin-top: 5px; }
.dg-field .dg-opt { color: var(--pdx-text-light, #64748b); font-weight: 400; }

/* honeypot: fuera de pantalla, nunca oculto con display:none (algunos bots lo detectan) */
.dg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.dg-error {
    background: #fff5f7;
    border: 1px solid #f5c2ce;
    color: #b3123c;
    border-radius: var(--pdx-radius-sm, 6px);
    padding: 11px 14px;
    font-size: .87rem;
    margin-bottom: 14px;
}

.dg-contact { margin-top: 24px; }
.dg-contact-label { font-size: .87rem; color: var(--pdx-text-light, #64748b); margin-bottom: 10px; }
.dg-contact-org { font-size: .8rem; color: var(--pdx-text-light, #64748b); margin-top: 9px; }

.dg-footer {
    text-align: center;
    padding: 20px 16px 28px;
    font-size: .78rem;
    color: var(--pdx-text-light, #64748b);
}

/* estado "enviando" */
.dg-btn.is-busy { pointer-events: none; opacity: .7; }

@media (max-width: 560px) {
    .dg-card { padding: 22px 18px; }
    .dg-h1 { font-size: 1.5rem; }
    .dg-quizfoot { flex-direction: column-reverse; align-items: stretch; }
    .dg-quizfoot .dg-btn { width: 100%; }
    .dg-hint { text-align: center; }
}
