:root {
  --bg: #eef5f8;
  --surface: #ffffff;
  --ink: #123c46;
  --ink-soft: #4a6b74;
  --line: #d8e4e9;
  --accent: #1d5d6b;
  --accent-soft: #dceaee;
  --good: #7cb789;
  --mid: #7fa1c8;
  --low: #f0b269;
  --danger: #c05b4d;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(18, 60, 70, 0.08);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent); }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:hover { border-color: var(--accent); }
button:active { transform: scale(0.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #17505d; }
button.ghost { border: none; background: none; color: var(--accent); padding: 0.4rem 0.6rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

input[type="text"], input[type="number"], input[type="password"], textarea, select {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
label { font-size: 0.85rem; color: var(--ink-soft); display: block; margin-bottom: 0.25rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.brand .accent { color: var(--good); }
.brand img { width: 20px; height: 20px; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-toggle button { border: none; border-radius: 0; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.lang-toggle button.active { background: var(--accent); color: #fff; }

.container { max-width: 880px; margin: 0 auto; padding: 1.2rem; }
.container.narrow { max-width: 560px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.muted { color: var(--ink-soft); font-size: 0.85rem; }
.error { color: var(--danger); font-size: 0.9rem; }
.notice {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- survey ---------- */

.survey-screen { text-align: center; padding-top: 1.5rem; }
.survey-question { font-size: 1.25rem; font-weight: 650; margin: 1rem 0 1.5rem; }

.likert { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.likert button { padding: 0.85rem; font-weight: 600; box-shadow: var(--shadow); border: 1px solid transparent; }
.likert button.selected { border-color: var(--accent); background: var(--accent-soft); }

.survey-actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.survey-actions .pill { border-radius: 999px; border: 1.5px solid var(--accent); background: none; color: var(--accent); font-weight: 600; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 1.5rem 0 0.5rem;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s; width: 0; }
.progress-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--ink-soft); }

.welcome-bubble {
  width: 260px;
  height: 260px;
  margin: 2.5rem auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffffff 55%, #bfe0ea 78%, #a8d3b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  font-size: 1.15rem;
  font-weight: 650;
  text-align: center;
  box-shadow: var(--shadow);
  animation: bubble-float 3.5s ease-in-out infinite alternate;
}

@keyframes bubble-float {
  from { transform: translateY(0); }
  to { transform: translateY(-9px); }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-bubble { animation: none; }
}

/* ---------- results ---------- */

.result-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  text-align: left;
}
.result-row .name { flex: 1; font-weight: 600; }
.result-row .delta { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--low); }
.delta.flat { color: var(--ink-soft); }
.score-pill {
  border: 2px solid var(--mid);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-weight: 700;
  min-width: 3.2rem;
  text-align: center;
}
.score-pill.band-low { border-color: var(--low); }
.score-pill.band-good { border-color: var(--mid); }
.score-pill.band-strong { border-color: var(--good); }

.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.3rem; }

/* ---------- dashboard (admin / manager) ---------- */

.tabs { display: flex; gap: 0.2rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button { border: none; border-radius: 0; background: none; padding: 0.6rem 0.9rem; color: var(--ink-soft); border-bottom: 2.5px solid transparent; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }

.dim-header {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 1.3rem 0 0.5rem;
  font-weight: 700;
}

.comp-row { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.comp-row:last-child { border-bottom: none; }
.comp-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.comp-head .name { font-weight: 650; flex: 1; }
.comp-stats { display: flex; align-items: center; gap: 0.55rem; white-space: nowrap; font-size: 0.95rem; }
.badge {
  font-size: 0.72rem;
  background: #fdeeda;
  color: #9a6420;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-weight: 650;
}
.open-answers { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; color: var(--ink-soft); }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

.form-grid { display: grid; gap: 0.8rem; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.dim-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1.4rem; align-items: start; }

.checkbox-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row input { width: auto; }

.login-box { max-width: 380px; margin: 4rem auto; }

/* Score text colored by band, darkened for contrast on white. */
.band-text-low { color: #b97f2e; }
.band-text-good { color: #52779f; }
.band-text-strong { color: #4c8a5c; }

/* landing page */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.2rem;
}
.landing-mark { width: 64px; height: 64px; margin-bottom: 0.8rem; }
.landing h1 { font-size: 2rem; margin-bottom: 0.2rem; }
.landing h1 span { color: var(--good); }
.landing-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 860px;
  margin-top: 2rem;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
a.role-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-card h3 { color: var(--accent); }
.role-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

.comp-fold { border-bottom: 1px solid var(--line); }
.comp-fold:last-of-type { border-bottom: none; }
.comp-fold summary {
  cursor: pointer;
  font-weight: 650;
  padding: 0.65rem 0;
  list-style-position: outside;
}
.comp-fold summary:hover { color: var(--accent); }
.comp-fold[open] > summary { color: var(--accent); }
