/* Rank Hotelier — free diagnostic questionnaire (diagnostic/index.html).
   Layout: intro + one-step-at-a-time form on the left, a live "hotel at a glance" panel on the right that fills in
   from the answers. After submitting, the form gives way to the confirmation and the panel stays as the result,
   so the page never depends on a photo or a map of the hotel. */

.dg-page {
  --dg-ui: var(--rh-font-ui, "Inter", system-ui, sans-serif);
  --dg-data: var(--rh-font-data, "Inter", system-ui, sans-serif);
  --dg-gds: #B9A887; /* channel-mix third series, same as the landing calculator */
  --dg-navy-line: rgba(197, 214, 236, 0.16);
  --dg-accent-on-navy: #FFB39F; /* tangerine tint readable on navy, as in the current result */
  min-height: 100vh; display: flex; flex-direction: column; background: var(--rh-canvas);
}
.dg-page [hidden] { display: none !important; }

.dg-header { position: sticky; top: 0; z-index: 50; padding: clamp(8px, 1.2vw, 14px) clamp(8px, 1.6vw, 18px) 0; }
.dg-header-bar { max-width: 1280px; margin: 0 auto; padding: 10px clamp(14px, 1.6vw, 22px) 10px clamp(16px, 1.8vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,0.92); backdrop-filter: blur(16px); border: 1px solid var(--rh-border); border-radius: var(--rh-radius-pill); box-shadow: 0 6px 24px rgba(24,52,89,0.07); }

.dg-main { flex: 1; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 28px) clamp(56px, 8vw, 96px); }

/* ---------- Layout ---------- */
.dg-layout {
  max-width: 1120px; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  column-gap: clamp(28px, 4vw, 56px); row-gap: clamp(24px, 3vw, 32px);
  grid-template-areas: "intro snap" "form snap";
  align-items: start;
}
.dg-layout[data-state="result"] { grid-template-areas: "head snap" "next snap"; grid-template-rows: auto 1fr; }
.dg-intro { grid-area: intro; }
.dg-card { grid-area: form; }
.dg-done-head { grid-area: head; }
.dg-done-next { grid-area: next; }
.dg-snap { grid-area: snap; position: sticky; top: 104px; }

/* ---------- Intro ---------- */
.dg-intro { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.dg-eyebrow { margin: 0; display: flex; align-items: center; gap: 9px; font-family: var(--dg-ui); font-size: 11px; font-weight: 500; letter-spacing: 1.8px; text-transform: uppercase; color: var(--rh-ink-muted); }
.dg-eyebrow > span[data-rh-anim] { width: 6px; height: 6px; border-radius: 50%; background: var(--rh-tangerine); display: block; animation: rh-pulse 2.4s ease-in-out infinite; }
.dg-intro h1, .dg-done-head h2 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; color: var(--rh-ink); text-wrap: balance; outline: none; }
.dg-lead { margin: 0; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; color: var(--rh-gris); }
.dg-lead strong { color: var(--rh-ink); font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Form card ---------- */
.dg-card { background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: var(--rh-radius-lg); box-shadow: var(--rh-shadow-sm); padding: clamp(20px, 3.2vw, 36px); display: flex; flex-direction: column; gap: 26px; position: relative; min-width: 0; }

/* Segmented stepper: one segment per step, name under each one on wide screens. */
.dg-progress { display: flex; flex-direction: column; gap: 12px; }
.dg-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.dg-stepper li { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dg-seg { display: block; height: 4px; border-radius: var(--rh-radius-pill); background: var(--rh-offwhite); transition: background 200ms ease; }
.dg-seg-name { font-family: var(--dg-ui); font-size: 12px; font-weight: 500; color: var(--rh-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 200ms ease; }
.dg-stepper li.is-done .dg-seg { background: var(--rh-navy); }
.dg-stepper li.is-done .dg-seg-name { color: var(--rh-gris); }
.dg-stepper li[aria-current="step"] .dg-seg { background: var(--rh-tangerine); }
.dg-stepper li[aria-current="step"] .dg-seg-name { color: var(--rh-ink); font-weight: 600; }
.dg-progress-row { display: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.dg-count { font-family: var(--dg-ui); font-size: 12.5px; font-weight: 500; color: var(--rh-ink-muted); }
.dg-hotel-chip { display: inline-flex; max-width: 60%; padding: 5px 12px; border: 1px solid var(--rh-border); border-radius: var(--rh-radius-pill); background: var(--rh-canvas); font-size: 13.5px; font-weight: 700; color: var(--rh-ink); }
.dg-hotel-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dg-step { display: flex; flex-direction: column; gap: 24px; animation: dg-in 260ms ease-out; }
@keyframes dg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dg-step-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; color: var(--rh-ink); outline: none; text-wrap: balance; }
.dg-step-head p { margin: 8px 0 0; font-size: 16px; line-height: 1.55; color: var(--rh-gris); }

/* ---------- Fields (design system Input: sentence-case label, sunken field) ---------- */
.dg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.dg-span-2 { grid-column: 1 / -1; }
.dg-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dg-fieldset { border: none; margin: 0; padding: 0; }
.dg-fieldset legend { padding: 0; margin-bottom: 10px; }
.dg-label { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--rh-gris); }
.dg-opt { font-weight: 500; color: var(--rh-ink-muted); }

.dg-input, .dg-select, .dg-textarea { width: 100%; box-sizing: border-box; height: 50px; background: var(--rh-surface-sunk); border: 1.5px solid var(--rh-border); border-radius: 8px; padding: 0 14px; font-family: var(--rh-font-body); font-size: 16px; font-weight: 500; color: var(--rh-ink); outline: none; transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease; }
.dg-input::placeholder, .dg-textarea::placeholder { color: var(--rh-ink-muted); font-weight: 400; } /* 4.5:1 on the off-white field */
@media (hover: hover) { .dg-input:hover, .dg-select:hover, .dg-textarea:hover { border-color: var(--rh-arena); } }
.dg-input:focus, .dg-select:focus, .dg-textarea:focus { background: var(--rh-surface); border-color: var(--rh-navy); box-shadow: 0 0 0 3px rgba(24,52,89,0.10); }
.dg-input[aria-invalid="true"], .dg-select[aria-invalid="true"] { border-color: var(--rh-danger); background: var(--rh-surface); }
.dg-input[aria-invalid="true"]:focus, .dg-select[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(192,69,59,0.16); }
.dg-num { font-family: var(--dg-data); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; font-weight: 600; }
.dg-select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23183459' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.dg-select:invalid { color: var(--rh-ink-muted); font-weight: 400; }
.dg-select option { color: var(--rh-ink); }
.dg-textarea { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.dg-affix { position: relative; display: flex; align-items: center; }
.dg-affix > span { position: absolute; font-family: var(--dg-data); font-size: 16px; font-weight: 600; color: var(--rh-ink-muted); pointer-events: none; }
.dg-affix--pre > span { left: 14px; }
.dg-affix--pre .dg-input { padding-left: 30px; }
.dg-affix--post > span { right: 14px; }
.dg-affix--post .dg-input { padding-right: 36px; }
.dg-help { margin: 0; font-size: 14px; line-height: 1.5; color: var(--rh-ink-muted); }
.dg-err { margin: 0; font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--rh-danger); }

/* Option rows (radio): selection in navy, so tangerine stays reserved for progress and the main action. */
.dg-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dg-option { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--rh-border); border-radius: var(--rh-radius-card); background: var(--rh-surface); cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.dg-option input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--rh-navy); cursor: pointer; }
.dg-option strong { display: block; font-size: 15.5px; color: var(--rh-ink); }
.dg-option small { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--rh-ink-muted); }
.dg-option:has(input:checked) { border-color: var(--rh-navy); background: var(--rh-canvas); }
.dg-option:has(input:focus-visible), .dg-chip:has(input:focus-visible) { outline: 3px solid rgba(24,52,89,0.28); outline-offset: 2px; }
@media (hover: hover) { .dg-option:hover, .dg-chip:hover { border-color: var(--rh-arena); } .dg-option:has(input:checked):hover, .dg-chip:has(input:checked):hover { border-color: var(--rh-navy); } }
.dg-fieldset[aria-invalid="true"] .dg-option { border-color: var(--rh-danger); }

/* Chips (checkbox) */
.dg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--rh-border); border-radius: var(--rh-radius-pill); background: var(--rh-surface); cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--rh-ink); transition: border-color 120ms ease, background 120ms ease; }
.dg-chip input { width: 16px; height: 16px; margin: 0; accent-color: var(--rh-navy); cursor: pointer; }
.dg-chip:has(input:checked) { border-color: var(--rh-navy); background: var(--rh-canvas); }

/* Inline estimate (phones only; the snapshot panel covers it on wide screens) */
.dg-estimate { display: none; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 14px 0 0; border-top: 1px solid var(--rh-offwhite); font-size: 14.5px; font-weight: 600; color: var(--rh-gris); }
.dg-estimate-value { font-family: var(--dg-data); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; color: var(--rh-ink); }

/* Channel mix */
.dg-swatch--direct { background: var(--rh-navy); }
.dg-swatch--direct-on-dark { background: var(--rh-surface); }
.dg-swatch--ota { background: var(--rh-tangerine); }
.dg-swatch--gds { background: var(--dg-gds); }
.dg-mix { display: flex; flex-direction: column; }
.dg-mix-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px 16px; align-items: center; padding: 14px 0 10px; border-bottom: 1px solid var(--rh-offwhite); }
.dg-mix-row:first-child { padding-top: 0; }
.dg-mix-row label { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 10px; align-items: center; cursor: pointer; }
.dg-mix-row label strong { font-size: 16px; color: var(--rh-ink); }
.dg-mix-row label small { grid-column: 2; font-size: 13.5px; line-height: 1.4; color: var(--rh-ink-muted); margin-top: 2px; }
.dg-swatch { width: 10px; height: 10px; border-radius: 2px; display: block; }
.dg-mix-row .dg-input { height: 44px; text-align: right; font-size: 17px; }
.dg-mix-row input[type="range"] { grid-column: 1 / -1; }
.dg-mix-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.dg-bar { display: flex; height: 10px; border-radius: var(--rh-radius-pill); overflow: hidden; background: var(--rh-offwhite); }
.dg-bar > span { display: block; height: 100%; width: 0; transition: width 220ms cubic-bezier(.2,.8,.2,1); }
.dg-total { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; font-weight: 600; color: var(--rh-gris); }
.dg-total strong { font-family: var(--dg-data); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rh-ink); }
.dg-total.is-ok strong { color: var(--rh-success); }
.dg-total.is-off strong { color: var(--rh-danger); }

/* Navigation */
.dg-nav { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 22px; border-top: 1px solid var(--rh-offwhite); }
.dg-nav [data-back] { margin-right: auto; }
.dg-btn { height: 50px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 8px; padding: 0 24px; font-family: var(--rh-font-body); font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease; }
.dg-btn--primary { background: var(--rh-accent-fill); color: var(--rh-surface); }
@media (hover: hover) { .dg-btn--primary:hover { background: var(--rh-accent-fill-hover); color: var(--rh-surface); } }
.dg-btn--primary[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.dg-btn--text { background: transparent; color: var(--rh-gris); padding: 0 12px 0 4px; }
@media (hover: hover) { .dg-btn--text:hover { color: var(--rh-ink); } }
.dg-btn--ghost { background: var(--rh-surface); color: var(--rh-ink); border: 1.5px solid var(--rh-border); }
@media (hover: hover) { .dg-btn--ghost:hover { border-color: var(--rh-navy); color: var(--rh-ink); } }
.dg-btn:focus-visible { outline: 3px solid rgba(24,52,89,0.35); outline-offset: 2px; }
.dg-privacy { margin: -10px 0 0; font-size: 13px; line-height: 1.5; color: var(--rh-ink-muted); text-align: right; }
.dg-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.dg-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Snapshot panel ---------- */
.dg-snap { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dg-snap-panel { background: var(--rh-navy); color: var(--rh-surface); border-radius: var(--rh-radius-lg); padding: clamp(22px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 20px; }
.dg-snap-label, .dg-snap-sub, .dg-label-caps { margin: 0; font-family: var(--dg-ui); font-size: 11px; font-weight: 500; letter-spacing: 1.6px; text-transform: uppercase; }
.dg-snap-label { color: var(--rh-on-navy-muted); }
.dg-snap-id { display: flex; flex-direction: column; gap: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--dg-navy-line); }
.dg-snap-name { margin: 0; font-size: clamp(21px, 2vw, 24px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; color: var(--rh-surface); overflow-wrap: anywhere; transition: color 200ms ease; }
.dg-snap-name.is-empty { color: var(--rh-on-navy-muted); } /* 5.7:1 on navy; filled values are white */
.dg-snap-meta { margin: 0; font-size: 14px; line-height: 1.5; color: var(--rh-on-navy-muted); }
.dg-snap-facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dg-snap-facts dt, .dg-snap-money dt { font-size: 13px; line-height: 1.4; color: var(--rh-on-navy-muted); }
.dg-snap-facts dd { margin: 4px 0 0; font-family: var(--dg-data); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; color: var(--rh-surface); }
.dg-snap-mix { display: flex; flex-direction: column; gap: 10px; }
.dg-snap-sub { color: var(--rh-on-navy-muted); }
.dg-bar--dark { background: var(--dg-navy-line); }
.dg-snap-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--rh-on-navy-muted); }
.dg-snap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dg-snap-legend i { width: 8px; height: 8px; border-radius: 2px; display: block; }
.dg-snap-legend b { color: var(--rh-surface); font-family: var(--dg-data); font-weight: 600; }
.dg-snap-money { margin: 0; display: flex; flex-direction: column; }
.dg-snap-money > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--dg-navy-line); }
.dg-snap-money dd { margin: 0; flex: none; font-family: var(--dg-data); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; color: var(--rh-surface); }
.dg-snap-money > .dg-snap-key { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 16px; }
.dg-snap-key dd { font-size: clamp(34px, 3.6vw, 42px); line-height: 1; letter-spacing: -0.03em; }
.dg-snap-key .dg-snap-share { font-family: var(--rh-font-body); font-size: 13.5px; font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--rh-on-navy-muted); }
.dg-snap-share span { font-family: var(--dg-data); font-weight: 600; color: var(--rh-surface); }
.dg-snap-shift dd { color: var(--dg-accent-on-navy); }
.dg-snap-panel dd.is-empty, .dg-snap-panel b.is-empty { color: var(--rh-on-navy-muted); }
.dg-snap-key dd.is-empty { font-size: 24px; }
.dg-snap-note { margin: -4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--rh-on-navy-muted); }
.dg-snap-foot { margin: 0; padding: 0 4px; font-size: 13px; line-height: 1.5; color: var(--rh-ink-muted); }

/* ---------- Result ---------- */
.dg-done-head { display: flex; flex-direction: column; gap: 14px; animation: dg-in 320ms ease-out; }
.dg-eyebrow--ok { color: var(--rh-success); }
.dg-eyebrow--ok > span { width: 20px; height: 20px; border-radius: 50%; background: var(--rh-success); color: var(--rh-surface); display: grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.dg-done-next { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; padding-top: clamp(20px, 3vw, 28px); border-top: 1px solid var(--rh-border); animation: dg-in 320ms ease-out; }
.dg-label-caps { color: var(--rh-ink-muted); }
.dg-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; width: 100%; counter-reset: dv; }
.dg-timeline li { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 0 0 22px 42px; counter-increment: dv; }
.dg-timeline li::before { content: counter(dv); position: absolute; left: 0; top: 0; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--rh-navy); display: grid; place-items: center; font-family: var(--dg-ui); font-size: 12px; font-weight: 600; color: var(--rh-ink); background: var(--rh-canvas); }
.dg-timeline li::after { content: ""; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px; background: var(--rh-arena); }
.dg-timeline li:last-child { padding-bottom: 0; }
.dg-timeline li:last-child::after { display: none; }
.dg-when { font-family: var(--dg-ui); font-size: 12px; font-weight: 500; color: var(--rh-ink-muted); }
.dg-timeline strong { font-size: 17px; color: var(--rh-ink); }
.dg-timeline p { margin: 2px 0 0; font-size: 15px; line-height: 1.55; color: var(--rh-gris); max-width: 52ch; }
.dg-layout[data-state="result"] .dg-snap { animation: dg-in 320ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .dg-step, .dg-done-head, .dg-done-next, .dg-layout[data-state="result"] .dg-snap { animation: none; }
  .dg-bar > span, .dg-seg, .dg-seg-name, .dg-snap-name { transition: none; }
  .dg-eyebrow > span[data-rh-anim] { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 959px) {
  .dg-layout, .dg-layout[data-state="result"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .dg-layout { grid-template-areas: "intro" "form"; }
  .dg-layout[data-state="result"] { grid-template-areas: "head" "snap" "next"; }
  .dg-layout[data-state="form"] .dg-snap { display: none; }
  .dg-layout[data-at]:not([data-at="0"]) .dg-intro { display: none; } /* intro only on the first step */
  .dg-snap { position: static; }
  .dg-estimate { display: flex; }
  .dg-seg-name { display: none; }
  .dg-stepper { gap: 4px; }
  .dg-progress-row { display: flex; }
}
@media (max-width: 599px) {
  .dg-grid, .dg-options { grid-template-columns: minmax(0, 1fr); }
  .dg-mix-row { grid-template-columns: minmax(0, 1fr) 92px; }
  .dg-nav [data-next] { flex: 1; padding: 0 18px; }
  .dg-privacy { text-align: left; }
  .dg-snap-facts dd { font-size: 17px; }
}
