/* Diagnóstico de marca — formulario (/diagnostico-de-marca/) e informe */

/* ---------- formulario ---------- */
.dg-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 48px; align-items: start; }
.dg-form { grid-column: span 8; display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.dg-aside { grid-column: 10 / span 3; position: sticky; top: 110px; display: flex; flex-direction: column; gap: 20px; }
.dg-step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.dg-num { font-size: 44px; font-weight: 700; letter-spacing: -.05em; line-height: .9; color: var(--orange); }
.dg-step-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dg-step h2 { font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.03em; line-height: 1.1; }
.dg-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dg-span2 { grid-column: 1 / -1; }
.field label small, .dg-chips-field legend small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted-2); }

.dg-drop { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px; border: 1.5px dashed #CFC9BC; background: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; }
.dg-drop:hover, .dg-drop.over { border-color: var(--orange); }
.dg-drop.has-file { border-style: solid; border-color: var(--ink); background: var(--white); }
.dg-drop:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.dg-drop-preview { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; background-color: #fff;
  background-image: linear-gradient(45deg, #EEE 25%, transparent 25%), linear-gradient(-45deg, #EEE 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEE 75%), linear-gradient(-45deg, transparent 75%, #EEE 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; border: 1px solid var(--line); }
.dg-drop-preview img { max-width: 84px; max-height: 84px; object-fit: contain; }
.dg-drop-preview:not(:has(img:not([hidden])))::after { content: "+"; font-size: 40px; font-weight: 300; color: var(--muted-2); }
.dg-drop-text { font-size: 14px; color: var(--muted); line-height: 1.45; min-width: 0; }
.dg-drop-text b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 4px; overflow-wrap: anywhere; }
.dg-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.dg-chips-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.dg-chips-field legend { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 0; margin-bottom: 10px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-chip { position: relative; }
.dg-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dg-chip span { display: inline-block; padding: 10px 14px; font-size: 15px; font-weight: 600; border: 1.5px solid #CFC9BC; background: var(--white); transition: background .2s, color .2s, border-color .2s; }
.dg-chip:hover span { border-color: var(--ink); }
.dg-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dg-chip input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

.dg-submit { align-self: flex-start; min-width: 280px; justify-content: space-between; }
.dg-submit[disabled] { opacity: .6; cursor: wait; }
.dg-legal { font-size: 13px; color: var(--muted-2); max-width: 60ch; }
.err[hidden] { display: none; }

.dg-checks { border-top: 2px solid var(--ink); }
.dg-checks li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); line-height: 1.4; }
.dg-checks b { display: block; color: var(--ink); font-size: 16px; }
.dg-aside-note { font-size: 15px; color: var(--muted); }

.dg-loading { position: fixed; inset: 0; z-index: 90; background: rgba(21, 27, 33, .92); color: var(--paper); display: flex; align-items: center; justify-content: center; text-align: center; }
.dg-loading[hidden] { display: none; }
.dg-loading div { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.dg-loading p { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.dg-loading .spin { animation-duration: 3s; }

@media (max-width: 1024px) {
  .dg-form { grid-column: 1 / -1; }
  .dg-aside { display: none; }
}
@media (max-width: 640px) {
  .dg-step { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 26px 0; }
  .dg-num { font-size: 32px; }
  .dg-row { grid-template-columns: minmax(0, 1fr); }
  .dg-drop { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .dg-drop-preview { width: 72px; height: 72px; }
  .dg-drop-preview img { max-width: 62px; max-height: 62px; }
  .dg-submit { align-self: stretch; min-width: 0; }
}

/* ---------- formulario en pasos ---------- */
.dg-wizard-sec { padding-top: clamp(40px, 5vw, 72px); }
.dg-form { gap: 0; border-top: 0; }
.dg-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.dg-prog-seg { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dg-prog-seg i { display: block; height: 4px; background: var(--line); transition: background .3s; }
.dg-prog-seg.is-on i { background: var(--orange); }
.dg-prog-seg b { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-prog-seg.is-cur b { color: var(--ink); }
.dg-step-count { margin-top: 18px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-text); }
.dg-panel { border: 0; margin: 0; padding: 10px 0 0; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.dg-panel[hidden] { display: none; }
.dg-panel-title { padding: 0; font-size: clamp(30px, 3.4vw, 46px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin-bottom: 4px; }
.dg-panel-title:focus { outline: none; }
.dg-panel-lead { margin-top: -18px; color: var(--muted); font-size: 17px; max-width: 52ch; }
.dg-q { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dg-q[hidden] { display: none; }
.dg-q-label { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.dg-q-label small { display: inline-block; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted-2); margin-left: 4px; }
.dg-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.dg-opts.is-many { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.dg-opts.is-letra { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.dg-opt { position: relative; display: flex; min-width: 0; }
.dg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.dg-opt span { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 16px; font-size: 16px; font-weight: 600; line-height: 1.3; border: 1.5px solid #CFC9BC; background: var(--white); transition: background .2s, color .2s, border-color .2s; }
.dg-opt:hover span { border-color: var(--ink); }
.dg-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dg-opt input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.dg-opt input[type="checkbox"] + span::before { content: ""; flex: 0 0 18px; height: 18px; border: 1.5px solid currentColor; opacity: .5; }
.dg-opt input[type="checkbox"]:checked + span::before { opacity: 1; background: var(--orange); border-color: var(--orange); box-shadow: inset 0 0 0 3px var(--ink); }
.dg-aa { flex: 0 0 auto; width: 40px; font-style: normal; font-size: 24px; line-height: 1; text-align: center; color: var(--orange-text); }
.dg-opt input:checked + span .dg-aa { color: var(--orange); }
.dg-aa-sans { font-family: var(--font); font-weight: 700; }
.dg-aa-serif { font-family: Georgia, "Times New Roman", Times, serif; }
.dg-aa-script { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Dancing Script", cursive; font-size: 27px; }
.dg-aa-deco { font-family: "Cooper Black", "Bauhaus 93", "Rockwell Extra Bold", "Arial Black", Impact, fantasy; font-weight: 900; }
.dg-photo-warn { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: #FDEBDC; border-left: 4px solid var(--orange-text); }
.dg-photo-warn[hidden] { display: none; }
.dg-photo-warn p { color: #6B2E02; font-size: 15px; max-width: 60ch; }
.dg-photo-warn b { color: #6B2E02; }
.dg-photo-warn .btn { height: 48px; font-size: 15px; }
.dg-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.dg-nav .dg-next { margin-left: auto; min-width: 240px; justify-content: space-between; }
.dg-nav .dg-next[hidden] { display: none; }
.dg-prev { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 12px 0; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer; }
.dg-prev[hidden] { display: none; }
.dg-prev:hover { color: var(--orange-text); }
#dgError { margin-top: 20px; }
@media (max-width: 640px) {
  .dg-progress { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .dg-prog-seg b { display: none; }
  .dg-panel-title { font-size: 30px; }
  .dg-opts, .dg-opts.is-many { grid-template-columns: minmax(0, 1fr); }
  .dg-opts.is-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-opts.is-letra { grid-template-columns: minmax(0, 1fr); }
  .dg-opt span { min-height: 50px; padding: 10px 14px; font-size: 15px; }
  .dg-nav { position: sticky; bottom: 0; z-index: 5; background: var(--white); margin-top: 24px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
  .dg-nav .dg-next { min-width: 0; flex: 1; }
  .dg-form-page .wa-float { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- revisión de Santiago en el informe ---------- */
.dg-review { background: #FBF6EF; border-top: 3px solid var(--orange); }
.dg-review-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.dg-review-head p { font-size: 13px; color: var(--muted-2); }
.dg-review-general { font-size: 17px; line-height: 1.55; max-width: 64ch; }

/* ---------- informe ---------- */
.dg-report-sec { padding-top: 32px; }
.dg-report-wrap { max-width: 1040px; display: flex; flex-direction: column; gap: 20px; }
.dg-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dg-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.dg-sheet { background: var(--white); color: var(--ink); border: 1px solid var(--line); min-width: 0; }
.dg-sheet-loading { padding: 48px 32px; color: var(--muted); }
.dg-sh-head { background: var(--ink); color: var(--paper); padding: 32px 36px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.dg-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.dg-sh-head h2 { margin-top: 8px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1; letter-spacing: -.04em; text-wrap: balance; overflow-wrap: anywhere; }
.dg-sh-meta { font-size: 13px; color: var(--muted-dark); text-align: right; }
.dg-s { padding: 30px 36px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.dg-s:first-of-type { border-top: 0; }
.dg-s h3 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-text); }
.dg-summary { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 32px; align-items: center; }
.dg-score { width: 150px; height: 150px; position: relative; }
.dg-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dg-score-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dg-score-num b { font-size: 50px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.dg-score-num span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.dg-verdict { font-size: clamp(20px, 2vw, 26px); line-height: 1.25; letter-spacing: -.02em; font-weight: 700; max-width: 32ch; text-wrap: balance; }
.dg-counts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.dg-dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: 0; }
.dg-dot.good, .dg-st.good { background: #1F7A4D; }
.dg-dot.ok, .dg-st.ok { background: #C98A10; }
.dg-dot.bad, .dg-st.bad { background: #B3261E; }

.dg-views { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dg-views figure { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dg-box { aspect-ratio: 1; max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.dg-box.dark { background: var(--ink); border-color: var(--ink); }
.dg-box canvas { max-width: 100%; max-height: 100%; }
.dg-box.fav canvas { image-rendering: pixelated; }
.dg-box.fav canvas[data-v="16"] { width: 32px; height: 32px; }
.dg-box.fav canvas[data-v="32"] { width: 64px; height: 64px; }
.dg-ig { width: 74%; }
.dg-views figcaption { font-size: 13px; line-height: 1.35; color: var(--muted-2); }
.dg-views figcaption b { display: block; font-size: 14px; color: var(--ink); }

.dg-palette { display: flex; flex-wrap: wrap; border: 1px solid var(--line); }
.dg-sw { flex: 1 1 110px; min-width: 110px; }
.dg-sw i { display: block; height: 64px; border-bottom: 1px solid var(--line); }
.dg-sw div { padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.dg-sw div b { color: var(--ink); }

.dg-crow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); align-items: start; }
.dg-crit .dg-crow:first-child { border-top: 0; padding-top: 0; }
.dg-st { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; margin-top: 1px; }
.dg-crow h4 { font-size: 17px; letter-spacing: -.01em; }
.dg-crow p { margin-top: 3px; font-size: 15px; color: var(--muted); max-width: 62ch; }
.dg-val { font-size: 13px; font-weight: 700; color: var(--muted-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.dg-rubro { padding: 16px 18px; background: var(--paper); border-left: 4px solid var(--orange); font-size: 15px; line-height: 1.5; }
.dg-recs { display: flex; flex-direction: column; }
.dg-recs li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.dg-recs li:first-child { border-top: 0; padding-top: 4px; }
.dg-rn { font-size: 34px; font-weight: 700; line-height: .9; letter-spacing: -.05em; color: var(--orange); }
.dg-recs h4 { font-size: 19px; letter-spacing: -.02em; }
.dg-recs p { margin-top: 4px; font-size: 15px; color: var(--muted); max-width: 64ch; }
.dg-why { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-text); }
.dg-keep { font-size: 15px; color: var(--muted); }

.dg-cta { background: var(--ink); color: var(--paper); padding: 30px 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.dg-cta h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.03em; line-height: 1.1; }
.dg-cta p { margin-top: 8px; color: #D9D5CB; font-size: 16px; max-width: 52ch; }
.dg-cta .btn-primary:hover { background: var(--paper); color: var(--ink); }
.dg-foot { padding: 14px 36px; font-size: 12px; color: var(--muted-2); border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .dg-views { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-views figure:first-child { grid-column: 1 / -1; }
  .dg-views figure:first-child .dg-box { aspect-ratio: auto; height: 110px; }
}
@media (max-width: 640px) {
  .dg-sh-head, .dg-s, .dg-cta { padding-left: 20px; padding-right: 20px; }
  .dg-foot { padding-left: 20px; padding-right: 20px; }
  .dg-sh-meta { text-align: left; }
  .dg-summary { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dg-score { width: 130px; height: 130px; }
  .dg-crow { grid-template-columns: 26px minmax(0, 1fr); }
  .dg-val { grid-column: 2; white-space: normal; }
  .dg-cta { grid-template-columns: minmax(0, 1fr); }
  .dg-actions .btn-row { width: 100%; }
  .dg-actions .btn { flex: 1 1 auto; }
}

/* ---------- PDF (imprimir) ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  .site-header, .site-footer, .wa-float, .skip, .dg-actions, .dg-cta .btn { display: none !important; }
  body, .dg-report-sec { background: #fff !important; }
  .dg-report-sec { padding: 0 !important; }
  .dg-report-wrap { max-width: none; padding: 0 !important; }
  .dg-sheet { border: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dg-s, .dg-recs li, .dg-crow, .dg-views figure { break-inside: avoid; }
  .dg-views { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .dg-views figure:first-child { grid-column: auto !important; }
  .dg-views figure:first-child .dg-box { aspect-ratio: 1 !important; height: auto !important; }
}
