/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0D1B2A;
  --teal:       #028090;
  --teal-light: #00A896;
  --teal-bg:    #E1F5EE;
  --white:      #FFFFFF;
  --surface:    #F4F9FA;
  --border:     #E2ECF0;
  --text-main:  #0D1B2A;
  --text-muted: #6B8390;
  --text-hint:  #A0B4BC;
  --green:      #1D9E75;
  --amber:      #BA7517;
  --red:        #A32D2D;
  --green-bg:   #E1F5EE;
  --amber-bg:   #FAEEDA;
  --red-bg:     #FCEBEB;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 4px rgba(13,27,42,0.08);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ── */
h1 { font-size: 28px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p  { color: var(--text-muted); line-height: 1.7; }

/* ── Navbar ── */
.navbar {
  background: var(--navy);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.logo span { color: var(--teal-light); }

.nav-links { display: flex; gap: 6px; align-items: center; }

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-link.cta {
  background: var(--teal);
  color: white;
  padding: 6px 16px;
}

.nav-link.cta:hover { background: var(--teal-light); }

/* ── Page wrapper ── */
.page { display: none; }
.page.active { display: block; }

/* ── Hero ── */
.hero {
  background: var(--navy);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 { color: white; margin-bottom: 1rem; }
.hero h1 span { color: var(--teal-light); }
.hero p { color: rgba(255,255,255,0.65); font-size: 16px; max-width: 520px; margin: 0 auto 2rem; }

.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-light); }
.btn-primary:disabled { background: var(--border); color: var(--text-hint); cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.08); }

.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ── Stats strip ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: white;
  border-bottom: 1px solid var(--border);
}

.stat-item {
  padding: 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-item .val { font-size: 28px; font-weight: 700; color: var(--teal); }
.stat-item .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Main layout ── */
.main { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.main-2col { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.5rem; align-items: start; }

/* ── Cards ── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1rem;
}

/* ── Form ── */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: white;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(2,128,144,0.1);
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
  font-family: inherit;
}
.submit-btn:hover { background: var(--teal); }
.submit-btn:disabled { background: var(--border); color: var(--text-hint); cursor: not-allowed; }

/* ── Score result ── */
.result-wrap { display: none; }

.score-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.score-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-ring .num { font-size: 26px; font-weight: 700; }
.score-ring .grade { font-size: 12px; font-weight: 600; margin-top: 1px; }

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.score-meta { font-size: 13px; color: var(--text-muted); }
.score-meta strong { color: var(--text-main); }

/* ── Progress bars ── */
.bar-section { margin: 1rem 0; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bar-label { font-size: 12px; color: var(--text-muted); width: 110px; flex-shrink: 0; }
.bar-track { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.bar-num { font-size: 12px; color: var(--text-muted); width: 28px; text-align: right; flex-shrink: 0; }

/* ── Strengths / Risks ── */
.sr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 1rem 0; }

.sr-box { border-radius: var(--radius-sm); padding: 12px; }
.sr-box.strengths { background: var(--green-bg); }
.sr-box.risks     { background: var(--red-bg); }

.sr-box .sr-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.sr-box.strengths .sr-title { color: #085041; }
.sr-box.risks     .sr-title { color: #791F1F; }

.sr-box .sr-item { font-size: 12px; color: var(--text-main); margin-bottom: 4px; line-height: 1.4; }

.summary-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--teal);
  margin-top: 1rem;
}

/* ── Dashboard ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.metric-card .m-val { font-size: 28px; font-weight: 700; color: var(--text-main); }
.metric-card .m-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.metric-card .m-delta { font-size: 11px; margin-top: 6px; }
.metric-card .m-delta.up { color: var(--green); }

.dash-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; }

/* ── Reports table ── */
.reports-table { width: 100%; border-collapse: collapse; }
.reports-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-hint);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
.reports-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.reports-table tr:last-child td { border-bottom: none; }
.reports-table tr:hover td { background: var(--surface); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.score-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

/* ── Bar chart ── */
.bar-chart { display: flex; gap: 8px; align-items: flex-end; height: 100px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart-bar { width: 100%; border-radius: 4px 4px 0 0; }
.bar-chart-lbl { font-size: 9px; color: var(--text-hint); text-align: center; }

/* ── Loader ── */
.loader { display: flex; gap: 5px; justify-content: center; padding: 2rem; }
.loader span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  animation: bounce 1s infinite;
}
.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-8px); }
}

/* ── Error ── */
.error-msg { color: var(--red); font-size: 13px; padding: 10px; background: var(--red-bg); border-radius: var(--radius-sm); }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 12px;
  color: var(--text-hint);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .main-2col  { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .metric-grid{ grid-template-columns: 1fr 1fr; }
  .dash-grid  { grid-template-columns: 1fr; }
  .sr-grid    { grid-template-columns: 1fr; }
  .stats-strip{ grid-template-columns: 1fr; }
  .navbar     { padding: 0 1rem; }
  .hero       { padding: 2.5rem 1rem; }
  h1          { font-size: 22px; }
}
