/* =============================================================================
   Capability Hub V2 — product surface
   =============================================================================
   Camada visual única da experiência de participante/gestor. Complementa os
   tokens e componentes-base de app.css sem criar semântica metodológica nova.
   ========================================================================== */

:root {
  --surface: #FFFFFF;
  --surface-soft: #F8F9FB;
  --border: #E3E7ED;
  --border-strong: #D2D8E2;
  --text-muted: #687280;
  --navy-soft: #393169;
}

.sidebar { width: 300px; }
.main { max-width: none; width: 100%; padding: 46px 52px 72px; }
.screen { width: min(1180px, 100%); margin: 0 auto; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(34px, 3vw, 46px); line-height: 1.02; margin-bottom: 12px; }
.page-head .lede { font-size: 17px; line-height: 1.55; max-width: 760px; }

.section-head { margin: 38px 0 16px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-head h2 { margin: 3px 0 0; font-size: 28px; }
.section-head > p { margin: 0; color: var(--gray); font-size: 14px; }
.section-kicker { margin: 0; color: var(--magenta); text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 900; }

.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 11px; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }
.status-pill--light { background: rgba(255,255,255,.10); color: #FFFFFF; }
.action-feedback { margin: 10px 0 0; font-size: 13px; color: var(--light-gray); min-height: 1em; }
.save-state { color: var(--st-demonstrado); font-size: 13px; font-weight: 700; }

.progress-track { width: 100%; height: 8px; background: #E7EAF0; border-radius: 999px; overflow: hidden; }
.card--dark .progress-track { background: rgba(255,255,255,.14); }
.progress-track--compact { height: 5px; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--magenta); transition: width .25s ease; }

/* Conta */
.account-row { cursor: default !important; display: flex; align-items: center; gap: 10px; padding-top: 10px !important; padding-bottom: 10px !important; }
.account-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; background: rgba(255,255,255,.10); font-weight: 800; font-size: 12px; }
.account-copy { display: block; min-width: 0; }
.account-copy strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-copy small { display: block; margin-top: 2px; opacity: .68; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Jornada */
.journey-intro,
.journey-hero { padding: 30px 32px; }
.journey-intro { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px; }
.journey-intro h2,
.journey-hero h2 { color: #FFFFFF; font-size: 28px; margin: 12px 0 8px; }
.journey-intro p,
.journey-hero p { color: #C8CBD6; line-height: 1.55; max-width: 680px; }

.journey-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 30px; align-items: center; }
.journey-hero__progress { text-align: right; min-width: 126px; }
.progress-number { font-size: 42px; line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.progress-number span { font-size: 18px; margin-left: 2px; color: var(--light-gray); }
.progress-copy { color: var(--light-gray); font-size: 12px; margin-top: 6px; }
.journey-hero__bar { grid-column: 1 / -1; }
.journey-metrics { grid-column: 1 / 2; display: flex; flex-wrap: wrap; gap: 12px 30px; }
.journey-metrics div { display: flex; align-items: baseline; gap: 8px; }
.journey-metrics strong { font-size: 24px; }
.journey-metrics span { color: var(--light-gray); font-size: 12px; }
.journey-hero__action { grid-column: 2 / 3; grid-row: 4 / 5; text-align: right; }

.domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.domain-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: 0 8px 24px -18px rgba(15,16,32,.28); display: flex; flex-direction: column; min-height: 226px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.domain-card:hover { transform: translateY(-2px); border-color: #D5D9E2; box-shadow: 0 16px 36px -24px rgba(15,16,32,.32); }
.domain-card--done { background: #FBFCFB; }
.domain-card__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.domain-order { width: 34px; height: 34px; border-radius: 50%; background: var(--extra-light); display: inline-flex; align-items: center; justify-content: center; color: var(--navy); font-size: 12px; font-weight: 900; }
.domain-code { display: inline-flex; align-items: center; width: fit-content; color: var(--gray); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.domain-card h3 { font-size: 20px; line-height: 1.2; margin: 0 0 8px; }
.domain-card > p { margin: 0; color: var(--gray); font-size: 13px; }
.domain-card__progress { margin: 22px 0 18px; }
.domain-card__progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--gray); font-size: 12px; }
.domain-card__progress strong { color: var(--midnight); }
.domain-card__cta { margin-top: auto; border: 0; background: none; color: var(--magenta); padding: 5px 0 0; text-align: left; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.domain-card__state { margin-top: auto; color: var(--gray); font-size: 13px; font-weight: 700; }

/* Responder */
.answer-domain-head { padding: 24px 26px; display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 22px 30px; align-items: end; }
.answer-domain-head__title h2 { font-size: 28px; margin: 6px 0 7px; }
.answer-domain-head__title p { margin: 0; color: var(--gray); font-size: 13px; }
.answer-domain-head__progress { grid-column: 1 / -1; }
.answer-domain-head__progress > div { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: var(--gray); }
.answer-domain-head__progress strong { color: var(--midnight); }
.domain-switcher span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--gray); font-weight: 800; margin-bottom: 7px; }
.domain-switcher select,
.field select { width: 100%; border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--midnight); border-radius: 10px; padding: 11px 38px 11px 12px; font: inherit; font-size: 13px; }

.competency-stack { display: grid; gap: 14px; margin-top: 20px; }
.competency-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; }
.competency-card__head { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 14px; }
.competency-index { display: block; color: var(--magenta); text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 900; margin-bottom: 5px; }
.competency-card h3 { font-size: 18px; line-height: 1.25; margin: 0 0 5px; }
.competency-progress { text-align: right; min-width: 76px; }
.competency-progress strong { display: block; font-size: 20px; }
.competency-progress span { color: var(--gray); font-size: 11px; }

.question-steps { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
.question-step { appearance: none; width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; border: 1px solid var(--border-strong); border-radius: 10px; background: #FFFFFF; color: var(--midnight); transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.question-step span,
.question-step small { display: inline; margin: 0; }
.question-step span { font-size: 13px; font-weight: 900; }
.question-step span::before { content: "Pergunta "; font-weight: 700; }
.question-step small { color: var(--magenta); font-size: 12px; font-weight: 800; }
.question-step small::after { content: "  →"; }
.question-step:hover { border-color: var(--magenta); background: #FFF8FA; transform: translateY(-1px); }
.question-step:focus-visible { outline: 3px solid rgba(237, 27, 89, .22); outline-offset: 2px; border-color: var(--magenta); }
.question-step--answered { background: #F7FBF7; border-color: #D4E4D6; }
.question-step--answered small { color: var(--st-demonstrado); }

#question-panel { scroll-margin-top: 24px; }
.question-card { padding: 28px; border: 1px solid #E5D6DD; box-shadow: 0 18px 42px -30px rgba(237,27,89,.42); }
.question-card__meta { display: flex; justify-content: space-between; gap: 20px; color: var(--gray); font-size: 12px; margin-bottom: 12px; }
.question-card__meta span { font-weight: 700; }
.question-card__meta strong { color: var(--magenta); }
.question-card h2 { font-size: 22px; line-height: 1.42; margin: 0 0 22px; }
.answer-field textarea { min-height: 190px; line-height: 1.55; background: #FCFCFD; }
.question-card__actions { display: flex; align-items: center; gap: 14px; min-height: 48px; }

.domain-submit { margin-top: 20px; padding: 24px 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px 28px; border: 1px solid var(--border); }
.domain-submit h3 { font-size: 18px; margin: 4px 0 6px; }
.domain-submit p:not(.section-kicker):not(.action-feedback) { margin: 0; color: var(--gray); font-size: 13px; line-height: 1.5; }
.domain-submit .action-feedback { grid-column: 1 / -1; margin: 0; color: var(--st-nao); }
.domain-submit--ready { border-color: #D4E4D6; background: #FCFEFC; }

/* Resultado */
.result-competency { margin-bottom: 14px; }
.result-competency__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.result-competency__head h3 { margin: 4px 0 0; }
.result-state-list { margin: 16px 0; display: grid; gap: 8px; }
.result-state-row { display: grid; grid-template-columns: minmax(100px, 1fr) auto; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.result-state-row small { grid-column: 1 / -1; color: var(--gray); }

.history-surface .card { border: 1px solid var(--border); }
.empty-state { display: flex; align-items: flex-start; gap: 16px; padding: 22px; border: 1px solid var(--border); }
.empty-state__mark { width: 8px; height: 42px; flex: 0 0 8px; border-radius: 999px; background: var(--magenta); }
.empty-state h3 { margin: 0 0 5px; }
.empty-state p { margin: 0; color: var(--gray); line-height: 1.5; }
.empty-state .btn { margin-top: 14px; }

/* Refinamento */
.sidebar__brand { font-size: 19px; }
.sidebar nav li { line-height: 1.25; }
.card { border: 1px solid rgba(227,231,237,.72); }
.card--dark { border: 0; }
.btn { transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px -12px rgba(237,27,89,.7); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }

@media (max-width: 1080px) {
  .sidebar { width: 270px; }
  .main { padding: 38px 30px 70px; }
  .domain-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { width: 100%; }
  .main { padding: 28px 18px 96px; }
  .screen { width: 100%; }
  .page-head h1 { font-size: 34px; }
  .section-head { align-items: start; flex-direction: column; gap: 5px; }
  .journey-intro,
  .journey-hero { display: block; padding: 24px 22px; }
  .journey-intro .btn,
  .journey-hero__action .btn { width: 100%; margin-top: 18px; }
  .journey-hero__progress { text-align: left; margin: 22px 0 14px; }
  .journey-metrics { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; }
  .answer-domain-head { grid-template-columns: 1fr; padding: 20px; }
  .answer-domain-head__progress { grid-column: auto; }
  .competency-card__head { gap: 12px; }
  .question-card { padding: 22px 18px; }
  .question-card__meta { flex-direction: column; gap: 4px; }
  .domain-submit { grid-template-columns: 1fr; }
  .domain-submit .btn { width: 100%; }
  .domain-submit .action-feedback { grid-column: auto; }
}

@media (max-width: 520px) {
  .journey-metrics { grid-template-columns: 1fr; }
  .domain-card { min-height: 0; }
  .question-step { min-width: 0; width: 100%; }
  .result-state-row { grid-template-columns: 1fr; }
}
