
:root {
  --c-primary: #375965;
  --c-bg: #f9f5f2;
  --c-support: #bcc9b8;
  --c-muted: #626d63;
  --c-white: #ffffff;
  --c-border: rgba(98, 109, 99, 0.2);
  --c-soft: rgba(55, 89, 101, 0.08);
  --c-success: #5f8c70;
  --c-warning: #b48e58;
  --c-danger: #a05959;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-soft: 0 8px 30px rgba(34, 55, 62, 0.08);
  --shadow-card: 0 10px 24px rgba(45, 61, 70, 0.08);
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top right, rgba(188, 201, 184, 0.28), transparent 38%), var(--c-bg);
  color: #27322d;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.page-main {
  padding: 2.3rem 0 2.8rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--c-border);
  background: rgba(249, 245, 242, 0.92);
  backdrop-filter: blur(8px);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.brand-logo {
  width: auto;
  height: 44px;
  max-width: min(300px, 56vw);
  display: block;
  object-fit: contain;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #4f6f7a, var(--c-primary));
  color: #fff;
  font-weight: 650;
  font-size: 0.82rem;
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--c-muted);
  font-size: 0.93rem;
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--c-soft);
  color: var(--c-primary);
}

.nav-link-soft {
  background: rgba(255, 255, 255, 0.7);
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  color: #1f2c31;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(1.7rem, 4.6vw, 2.8rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.32rem, 3.6vw, 1.9rem);
  line-height: 1.15;
}

p {
  margin: 0;
  color: #3f5048;
}

.muted {
  color: var(--c-muted);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card {
  background: var(--c-white);
  border: 1px solid rgba(98, 109, 99, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.card-soft {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(188, 201, 184, 0.2));
}

.hero {
  display: grid;
  gap: 1.2rem;
  padding: 1rem 0 0.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.76rem 1rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(55, 89, 101, 0.28);
}

.btn-secondary {
  background: rgba(55, 89, 101, 0.1);
  color: var(--c-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
}

.btn-danger {
  background: rgba(160, 89, 89, 0.12);
  color: var(--c-danger);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-shell {
  width: min(520px, 100%);
  margin: 2.2rem auto;
}

.form-group {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

label {
  font-size: 0.9rem;
  font-weight: 560;
  color: #2f3f46;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.82rem;
  border-radius: 11px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: #223036;
  font-family: inherit;
  font-size: 0.98rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(55, 89, 101, 0.18);
  border-color: rgba(55, 89, 101, 0.45);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox {
  width: 18px;
  height: 18px;
}

.password-wrap {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font-weight: 600;
}

.flash-stack {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  display: grid;
  gap: 0.55rem;
}

.flash {
  border-radius: 11px;
  padding: 0.74rem 0.95rem;
  border: 1px solid;
  font-size: 0.92rem;
}

.flash-success { background: rgba(95, 140, 112, 0.12); border-color: rgba(95, 140, 112, 0.35); color: #274a33; }
.flash-error { background: rgba(160, 89, 89, 0.12); border-color: rgba(160, 89, 89, 0.35); color: #5b2b2b; }
.flash-warning { background: rgba(180, 142, 88, 0.13); border-color: rgba(180, 142, 88, 0.35); color: #694f27; }
.flash-info { background: rgba(55, 89, 101, 0.1); border-color: rgba(55, 89, 101, 0.3); color: #26414a; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 620;
  border: 1px solid transparent;
}

.badge-success { background: rgba(95, 140, 112, 0.12); color: #29513a; border-color: rgba(95, 140, 112, 0.25); }
.badge-warning { background: rgba(180, 142, 88, 0.12); color: #6f552c; border-color: rgba(180, 142, 88, 0.26); }
.badge-danger { background: rgba(160, 89, 89, 0.12); color: #6b3535; border-color: rgba(160, 89, 89, 0.28); }
.badge-neutral { background: rgba(98, 109, 99, 0.1); color: #49544b; border-color: rgba(98, 109, 99, 0.2); }

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

.table th,
.table td {
  text-align: left;
  padding: 0.74rem;
  border-bottom: 1px solid rgba(98, 109, 99, 0.16);
  font-size: 0.92rem;
}

.table th {
  color: #3f534a;
  font-weight: 650;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
}

.kpi {
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: #fff;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #22353c;
}

.evolution-card .kpi-value {
  font-size: 1.35rem;
}

.evolution-chart-wrap {
  margin-top: 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.45rem;
}

.evolution-chart {
  display: block;
  width: 100%;
  height: 260px;
}

.evolution-grid {
  stroke: rgba(98, 109, 99, 0.26);
  stroke-width: 1;
}

.evolution-axis-label {
  fill: #5f6d65;
  font-size: 11px;
  font-family: var(--font-main);
}

.evolution-line {
  fill: none;
  stroke: var(--c-primary);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.evolution-point {
  fill: #fff;
  stroke: var(--c-primary);
  stroke-width: 2;
}

.evolution-delta-up {
  color: #2f6b44;
  font-weight: 650;
}

.evolution-delta-down {
  color: #8a3f3f;
  font-weight: 650;
}

.evolution-delta-flat {
  color: #3f5048;
  font-weight: 650;
}

.evolution-delta-neutral {
  color: var(--c-muted);
  font-weight: 650;
}

.timeline {
  position: relative;
  margin-left: 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(98, 109, 99, 0.26);
}

.timeline-item {
  position: relative;
  margin-left: 1.3rem;
  margin-bottom: 0.9rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.08rem;
  top: 0.42rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--c-primary);
}

.questionnaire-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.questionnaire-main {
  display: grid;
  gap: 0.8rem;
}

.questionnaire-side {
  display: none;
}

.progress-wrap {
  display: grid;
  gap: 0.5rem;
}

.questionnaire-intro-copy {
  margin-top: 0.4rem;
  padding: 0.62rem 0.74rem;
  border-radius: 10px;
  border: 1px solid rgba(55, 89, 101, 0.24);
  background: rgba(55, 89, 101, 0.08);
  color: #22353c;
  font-size: 0.94rem;
  line-height: 1.45;
}

.questionnaire-intro-copy strong {
  font-weight: 700;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(98, 109, 99, 0.18);
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #476a76, var(--c-primary));
  transition: width 240ms ease;
}

.question-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: #fff;
}

.response-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.response-btn {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 0.68rem 0.7rem;
  text-align: left;
  background: #fff;
  cursor: pointer;
  color: #24363d;
  transition: 130ms ease;
}

.response-btn:hover {
  border-color: rgba(55, 89, 101, 0.45);
  background: rgba(55, 89, 101, 0.05);
}

.response-btn.is-selected {
  background: rgba(55, 89, 101, 0.12);
  border-color: var(--c-primary);
  color: #1d2f35;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 14px 14px 0 0;
  background: rgba(249, 245, 242, 0.98);
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(98, 109, 99, 0.15);
  gap: 0.2rem;
}

.segmented a {
  padding: 0.35rem 0.68rem;
  border-radius: 999px;
  color: #4a5b52;
  font-size: 0.84rem;
}

.segmented a.active {
  background: #fff;
  color: var(--c-primary);
}

.alert-box {
  border-left: 3px solid var(--c-warning);
  background: rgba(180, 142, 88, 0.12);
  border-radius: 12px;
  padding: 0.72rem 0.88rem;
}

.metric {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--c-primary);
}

.footer-note {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: #58675f;
}

.empty-state {
  padding: 1.2rem;
  border: 1px dashed rgba(98, 109, 99, 0.38);
  border-radius: var(--radius-md);
  color: #5c6b63;
  background: rgba(255, 255, 255, 0.65);
}

.report-body {
  background: #f3f1ee;
}

.report-body .page-main {
  padding: 1.4rem 0 2rem;
}

.report-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.report-section {
  background: #fff;
  border: 1px solid rgba(98, 109, 99, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.1rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-header {
  display: grid;
  gap: 0.9rem;
}

.report-header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.report-logo {
  height: 54px;
  width: auto;
  max-width: min(320px, 62vw);
  object-fit: contain;
  display: block;
}

.report-meta-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.report-meta-item {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  background: #fff;
}

.report-meta-item span {
  display: block;
  font-size: 0.78rem;
  color: #516059;
}

.report-meta-item strong {
  display: block;
  margin-top: 0.2rem;
  color: #1e2c31;
}

.report-section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
}

.report-cards-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-cards-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.report-card {
  border: 1px solid rgba(98, 109, 99, 0.2);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.report-card h3,
.report-card-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.report-card p + p {
  margin-top: 0.3rem;
}

.report-card-block h3 {
  margin-bottom: 0.55rem;
}

.report-table-wrap {
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-table {
  min-width: 0;
  font-size: 0.88rem;
}

.report-table th {
  background: rgba(55, 89, 101, 0.08);
  font-weight: 650;
}

.report-table th,
.report-table td {
  padding: 0.55rem 0.58rem;
  vertical-align: top;
}

.report-domain-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}

.report-domain-chart-card {
  padding: 0.8rem;
}

.report-domain-chart-wrap {
  margin-top: 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.4rem;
}

.report-domain-chart {
  height: 240px;
}

.report-page-chunk {
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-note {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: #53625a;
}

.report-note-soft {
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.78rem 0.9rem;
}

@page {
  size: A4 portrait;
  margin: 14mm 12mm;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  body.report-body {
    color: #1d1d1d;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .flash-stack,
  .no-print {
    display: none !important;
  }

  .page-main {
    padding: 0 !important;
  }

  .container {
    width: 100% !important;
    margin: 0 !important;
  }

  .report-shell {
    width: 100%;
    max-width: none;
    gap: 6mm;
  }

  .report-section,
  .report-card,
  .report-meta-item,
  .report-note-soft {
    box-shadow: none !important;
    background: #fff !important;
    border-color: #d8d8d8 !important;
  }

  .report-section,
  .report-card,
  .report-table-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-cover {
    break-after: page;
    page-break-after: always;
  }

  .report-page-chunk {
    break-after: page;
    page-break-after: always;
  }

  .report-page-chunk:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  .report-table {
    border-collapse: collapse;
    page-break-inside: auto;
  }

  .report-table thead {
    display: table-header-group;
  }

  .report-table tr,
  .report-table td,
  .report-table th {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@media (min-width: 900px) {
  .questionnaire-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .questionnaire-side {
    display: block;
    position: sticky;
    top: 90px;
  }

  .sticky-actions {
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
  }
}

@media (max-width: 720px) {
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .table {
    min-width: 560px;
  }
}
