/* Diagnostic client, chestionar, clienții mei. */

/* ---------- Shared bits ---------- */
.page-head__title[tabindex='-1']:focus, .qz__title:focus { outline: none; box-shadow: none; }
.dg-between { justify-content: space-between; }
.dg-small { font-size: var(--text-sm); }
.dg-strong { color: var(--ink); font-weight: 750; }
.dg-tone--success { color: var(--success); }
.dg-tone--warn { color: var(--warn); }
.dg-tone--danger { color: var(--danger); }
.dg-tone--neutral { color: var(--muted); }

.field__error, .field__hint { display: inline-flex; align-items: flex-start; gap: 6px; }
.field__error .icon, .field__hint .icon { width: 14px; height: 14px; margin-top: 1px; }
.textarea[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--danger); }
.choice[aria-invalid='true'] .choice__opt span { border-color: var(--danger); }
.range[aria-invalid='true'] { accent-color: var(--danger); }
.dg-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.dg-fieldset > legend { padding: 0; margin-bottom: 8px; }
.dg-choice-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dg-choice-3 .choice__opt span { justify-content: center; padding: 0 10px; }
.dg-choice-3 .choice__opt span::before { display: none; }

/* Objective highlight and answer facts */
.dg-objective { padding: 16px 18px; border-radius: var(--r-lg); background: var(--paper); }
.dg-objective p:last-child { margin-top: 8px; font-size: var(--text-base); line-height: 1.6; color: var(--ink); }
.dg-facts dd { display: flex; align-items: center; gap: 6px; }
.dg-flag { color: var(--warn); }

.dg-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.dg-bullets { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dg-bullets li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--text-md); color: var(--ink-2); line-height: 1.5; }
.dg-bullets .icon { margin-top: 2px; color: var(--muted); }
.dg-none { font-size: var(--text-md); color: var(--muted); }

/* ---------- List ---------- */
.dg-toolbar, .cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.dg-toolbar__count { font-size: var(--text-sm); font-weight: 650; color: var(--muted); }

.dg-rows { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dg-row {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: 40px minmax(0, 1.4fr) 150px minmax(0, 1.5fr) 150px 18px;
  grid-template-areas: 'av main status dates score chev';
  padding: 16px 20px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--line); color: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.dg-row:hover { color: inherit; border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.dg-row:focus-visible { border-radius: var(--r-xl); }
.dg-row > .avatar { grid-area: av; }
.dg-row__main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dg-row__name { font-weight: 750; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row__sub { font-size: var(--text-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row__status { grid-area: status; }
.dg-row__dates { grid-area: dates; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dg-row__dates > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dg-row__dt { font-size: var(--text-xs); font-weight: 650; color: var(--muted); }
.dg-row__dd { font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-row__score { grid-area: score; display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.dg-row__score .score__value { font-size: 14px !important; }
.dg-row__band { font-size: var(--text-sm); font-weight: 750; }
.dg-row__next { font-size: var(--text-sm); font-weight: 650; color: var(--muted); }
.dg-row__next--go { color: var(--primary); font-weight: 750; }
.dg-row__chev { grid-area: chev; color: var(--muted); transition: transform 0.15s var(--ease); }
.dg-row:hover .dg-row__chev { transform: translateX(2px); color: var(--ink); }

@media (max-width: 1100px) {
  .dg-row {
    grid-template-columns: 40px minmax(0, 1fr) auto 18px;
    grid-template-areas: 'av main status chev' 'av dates dates dates' 'av score score score';
    row-gap: 12px;
  }
  .dg-row__dates { max-width: 420px; }
}
@media (max-width: 560px) {
  .dg-row {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    grid-template-areas: 'av main chev' 'status status status' 'dates dates dates' 'score score score';
    padding: 16px;
  }
  .dg-row__dates { padding-top: 12px; border-top: 1px solid var(--line); }
}

/* ---------- Detail header ---------- */
.dg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: -12px; }
.dg-head__who { display: flex; align-items: center; gap: 16px; min-width: 0; }
.dg-head__text { min-width: 0; }
.dg-head h1 { font-size: 32px; overflow-wrap: anywhere; }
.dg-head__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: var(--text-md); color: var(--muted); }
.dg-head__meta > * { display: inline-flex; align-items: center; gap: 6px; }
.dg-head__meta a { color: var(--ink-2); font-weight: 650; }
.dg-head__meta a:hover { color: var(--primary); }
@media (max-width: 640px) { .dg-head h1 { font-size: var(--text-2xl); } .dg-head .avatar--lg { width: 48px; height: 48px; font-size: 16px; } }

/* ---------- Waiting for the client ---------- */
.dg-wait { display: flex; gap: 16px; align-items: flex-start; }
.dg-wait h2 { margin-bottom: 6px; }
.dg-wait p { font-size: var(--text-md); }
.dg-wait__icon { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--warn-soft); color: var(--warn); }
.dg-what { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.dg-what li { display: flex; gap: 12px; align-items: flex-start; }
.dg-what__n {
  width: 28px; height: 28px; flex-shrink: 0; display: inline-grid; place-items: center;
  border-radius: 50%; background: var(--dark); color: var(--accent); font-size: var(--text-xs); font-weight: 800;
}
.dg-what__t { font-weight: 750; }
.dg-what__d { font-size: var(--text-sm); color: var(--muted); }

/* Consultant fills the questionnaire */
.dg-fill { display: flex; flex-direction: column; }
.dg-fill__group { border: 0; margin: 0; padding: 24px; min-width: 0; border-top: 1px solid var(--line); }
.dg-fill__group:first-of-type { border-top: 0; }
.dg-fill__legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 18px; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 650; }

/* ---------- Analysis ---------- */
.dg-split { align-items: start; }
.dg-scorebox { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 20px; border-radius: var(--r-lg); background: var(--paper); }
.dg-scorebox__ctl { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.dg-scorebox__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dg-scale { display: grid; grid-template-columns: 50fr 20fr 31fr; gap: 3px; margin-top: -2px; }
.dg-scale span { padding-top: 6px; border-top: 4px solid; font-size: 11px; font-weight: 750; text-align: center; }
.dg-scale__danger { border-color: var(--danger-soft) !important; color: var(--danger); }
.dg-scale__warn { border-color: var(--warn-soft) !important; color: var(--warn); }
.dg-scale__success { border-color: var(--success-soft) !important; color: var(--success); }

.dg-eds { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.dg-ed { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dg-eds .dg-ed { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); }
.dg-ed--span { grid-column: 1 / -1; }
.dg-ed__label { font-size: var(--text-sm); font-weight: 800; color: var(--ink); }
.dg-ed--success .dg-ed__label { color: var(--success); }
.dg-ed--warn .dg-ed__label { color: var(--warn); }
.dg-ed__list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dg-ed__item {
  display: flex; align-items: flex-start; gap: 8px; justify-content: space-between;
  padding: 8px 6px 8px 12px; border-radius: 10px; background: var(--paper);
  font-size: var(--text-md); color: var(--ink-2); line-height: 1.45;
}
.dg-ed__item > span { padding-top: 2px; min-width: 0; overflow-wrap: anywhere; }
.dg-ed__chip { padding-right: 4px; }
.dg-ed__empty { font-size: var(--text-sm); color: var(--muted); list-style: none; }
.dg-ed__x {
  width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
}
.dg-ed__x:hover { background: var(--surface); color: var(--danger); }
.dg-ed__chip .dg-ed__x:hover { background: var(--surface); }
.dg-ed__add { display: flex; gap: 8px; }
.dg-ed__add .input { flex: 1; min-width: 0; }

/* Sticky action bar buttons */
/* Phone layout of the bar lives in layout.css (.actionbar). */

/* Confirm dialog */
.dg-confirm { display: flex; align-items: center; gap: 20px; padding: 18px; border-radius: var(--r-lg); background: var(--paper); }
.dg-confirm__verdict { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }
@media (max-width: 420px) { .dg-confirm { flex-direction: column; align-items: flex-start; } }

/* ---------- Result ---------- */
.dg-result { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr); overflow: hidden; }
.dg-result__score { display: flex; align-items: center; gap: 24px; padding: 28px; background: var(--surface-2); }
.dg-result__score--success { background: var(--success-soft); }
.dg-result__score--warn { background: var(--warn-soft); }
.dg-result__score--danger { background: var(--danger-soft); }
.dg-verdict { margin-top: 6px; font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.03em; }
.dg-validated { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); }
.dg-result__body { display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.dg-rec { font-size: var(--text-lg); line-height: 1.55; color: var(--ink); }
@media (max-width: 860px) {
  .dg-result { grid-template-columns: minmax(0, 1fr); }
  .dg-result__score, .dg-result__body { padding: 22px; }
}
@media (max-width: 420px) { .dg-result__score { flex-direction: column; align-items: flex-start; } }

.dg-findings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.dg-finding__title { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); }
.dg-finding--success .dg-finding__title { color: var(--success); }
.dg-finding--warn .dg-finding__title { color: var(--warn); }
.dg-finding--success .dg-bullets .icon { color: var(--success); }
.dg-finding--warn .dg-bullets .icon { color: var(--warn); }

.dg-project { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.dg-project--cta { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.dg-project__body { flex: 1; min-width: 220px; }
.dg-project__name { margin-top: 2px; font-size: var(--text-lg); }
@media (max-width: 640px) { .dg-project .btn { width: 100%; } }

.dg-details summary {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 24px;
  cursor: pointer; list-style: none; border-radius: var(--r-xl);
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 650;
}
.dg-details summary::-webkit-details-marker { display: none; }
.dg-details summary > span:first-child { flex: 1; }
.dg-details summary .card__meta { font-family: var(--font-ui); font-weight: 600; }
.dg-details__chev { color: var(--muted); transition: transform 0.2s var(--ease); }
.dg-details[open] .dg-details__chev { transform: rotate(180deg); }
.dg-details[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.dg-details__body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 12px; }
@media (max-width: 480px) { .dg-details summary .card__meta { display: none; } }

.dg-callout .btn { margin-top: 2px; }

/* ---------- Client questionnaire ---------- */
.qz-saved { display: inline-flex; align-items: center; gap: 6px; margin-top: -12px; font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
.qz-saved .icon { color: var(--primary); }
.qz-layout { display: grid; gap: 24px; align-items: start; grid-template-columns: minmax(0, 720px) minmax(260px, 320px); }
@media (max-width: 1080px) { .qz-layout { grid-template-columns: minmax(0, 1fr); } }

.qz { overflow: hidden; }
.qz__top { display: flex; flex-direction: column; gap: 10px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.qz__meta { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-sm); font-weight: 750; }
.qz__pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.qz__bars { display: flex; gap: 6px; }
.qz__bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--line); transition: background 0.3s var(--ease); }
.qz__bar.is-on { background: var(--primary); }
.qz__form { display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.qz__title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.03em; }
.qz__lead { margin-top: 8px; font-size: var(--text-base); line-height: 1.55; color: var(--ink-2); }
.qz__grid { row-gap: 20px; }
.qz .input, .qz .select { min-height: 48px; font-size: 16px; }
.qz .textarea { font-size: 16px; }
.qz .choice__opt span { min-height: 52px; font-size: var(--text-base); }
.qz__req { font-size: var(--text-xs); color: var(--muted); }
.qz__req .req { color: var(--danger); }
.qz__foot { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.qz__foot .btn { min-height: 52px; border-radius: 14px; font-size: var(--text-base); }
.qz__next { flex: 1; }
.qz-aside__name { font-size: var(--text-base); }
@media (max-width: 1080px) { .qz-aside { display: none; } }
@media (max-width: 640px) {
  .qz { border-radius: var(--r-lg); }
  .qz__top { padding: 16px 18px; }
  .qz__form { padding: 22px 18px; }
  .qz__title { font-size: 24px; }
  .qz .form-grid { grid-template-columns: minmax(0, 1fr); }
  .qz__foot { flex-direction: column-reverse; }
  .qz__foot .btn { width: 100%; }
}

/* ---------- Clients ---------- */
.cl-search { flex: 1; max-width: 440px; min-width: min(100%, 260px); }
.cl-grid { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.cl-grid[hidden] { display: none; }
.cl-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.cl-card[hidden] { display: none; }
.cl-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.cl-card__head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cl-card__title { min-width: 0; }
.cl-card__name { font-size: var(--text-lg); overflow-wrap: anywhere; }
.cl-card__meta { margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }
.cl-contact { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper); font-size: var(--text-sm); }
.cl-contact li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); font-weight: 650; }
.cl-contact li > span, .cl-contact a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-contact .icon { color: var(--muted); }
.cl-contact a { color: var(--ink-2); }
.cl-contact a:hover { color: var(--primary); }
.cl-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 0; }
.cl-facts dt { font-size: var(--text-xs); font-weight: 650; color: var(--muted); }
.cl-facts dd { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 700; min-width: 0; }
.cl-score { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 750; }
.cl-score .score__value { font-size: 11px !important; }
.cl-proj { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 750; overflow-wrap: anywhere; }
.cl-proj .icon { margin-top: 2px; }
.cl-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.cl-card__cta { margin-left: auto; }
@media (max-width: 400px) { .cl-card__cta { margin-left: 0; width: 100%; } }
