*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0a2351;
  --navy-mid:   #1a3f7a;
  --navy-light: #2a5aa8;
  --gold:       #b8922a;
  --gold-light: #d4a843;
  --bg:         #eef1f6;
  --card:       #ffffff;
  --border:     #d0d7e6;
  --text:       #1a2540;
  --muted:      #5a6a8a;
  --success:    #1a7a4a;
  --danger:     #c0392b;
  --radius:     6px;
  --shadow-sm:  0 1px 4px rgba(10,35,81,.08);
  --shadow:     0 2px 12px rgba(10,35,81,.1);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* ── Header ── */
.page-header {
  background: var(--navy);
  color: #fff;
  padding: 0;
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.4rem;
  min-height: 90px;
}
.header-logo {
  width: 52px; height: 52px;
  background: var(--gold);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.header-logo-img { height: 64px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.header-text { display: flex; flex-direction: column; justify-content: center; }
.header-text h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: .2px; line-height: 1.3; }
.header-text p  { font-size: .82rem; opacity: .75; margin-top: 3px; }

/* ── Banner ── */
.page-banner {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: .75rem 1.5rem;
  text-align: center;
  font-size: .82rem;
  opacity: .9;
  letter-spacing: .3px;
}

/* ── Container ── */
.container {
  max-width: 900px;
  margin: 1.8rem auto;
  padding: 0 1rem 3rem;
}

/* ── Card ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  background: var(--navy);
  color: #fff;
  padding: .75rem 1.4rem;
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 2px solid var(--gold);
}
.card-header .badge {
  background: var(--gold);
  color: var(--navy);
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
}
.card-body { padding: 1.4rem; }

/* ── Info Grid ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 580px) { .info-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.form-group input,
.form-group textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .9rem;
  font-size: .92rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(42,90,168,.12);
}
.form-group textarea { resize: vertical; min-height: 88px; }
.required { color: var(--danger); }

/* ── Scale Legend ── */
.scale-legend {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .6rem 1.2rem;
  background: #f4f6fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.scale-legend strong { color: var(--text); margin-right: .2rem; font-size: .78rem; }
.scale-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 2px 8px; font-size: .75rem;
}
.scale-pill .n {
  background: var(--navy); color: white;
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800; flex-shrink: 0;
}
.scale-pill.top .n  { background: var(--success); }
.scale-pill.low .n  { background: var(--danger); }

/* ── Rating Table ── */
.rating-table { width: 100%; border-collapse: collapse; }
.rating-table thead th {
  padding: .5rem .35rem;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  background: #f8f9fc;
}
.rating-table thead th:first-child { text-align: left; padding-left: 1rem; width: 55%; }
.rating-table tbody tr { border-bottom: 1px solid #eef0f6; transition: background .12s; }
.rating-table tbody tr:last-child { border-bottom: none; }
.rating-table tbody tr:hover { background: #f7f9ff; }
.rating-table td {
  padding: .65rem .35rem;
  text-align: center;
  font-size: .88rem;
}
.rating-table td:first-child { text-align: left; padding-left: 1rem; }
.row-num {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--navy);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .68rem; font-weight: 800;
  margin-right: .45rem; flex-shrink: 0;
  vertical-align: middle;
}

/* ── Radio Circles ── */
.rating-table input[type="radio"] { display: none; }
.rating-table label.rc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer; font-size: .82rem; font-weight: 700;
  color: var(--muted); transition: all .14s;
}
.rating-table label.rc:hover { border-color: var(--navy-light); color: var(--navy-light); background: #edf1fb; }
.rating-table input[type="radio"]:checked + label.rc {
  background: var(--navy); border-color: var(--navy); color: white;
  box-shadow: 0 2px 6px rgba(10,35,81,.25);
}

/* ── Yes/No ── */
.yn-group { display: flex; gap: .8rem; margin-top: .3rem; }
.yn-group input[type="radio"] { display: none; }
.yn-group label {
  padding: .45rem 1.6rem; border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-weight: 700; font-size: .88rem; color: var(--muted); transition: all .14s;
}
.yn-group input:checked + label { border-color: var(--navy); background: var(--navy); color: white; }
.yn-group label:hover { border-color: var(--navy-mid); color: var(--navy); }

/* ── Captcha ── */
.captcha-box {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #f4f6fb; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.captcha-q {
  font-size: 1.3rem; font-weight: 800; color: var(--navy);
  background: white; border: 2px solid var(--navy);
  border-radius: var(--radius); padding: .45rem 1.1rem;
  letter-spacing: 1.5px; user-select: none; min-width: 110px; text-align: center;
  font-family: 'Courier New', monospace;
}
.captcha-input {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: .5rem .8rem; font-size: 1rem; width: 80px;
  text-align: center; font-weight: 700;
}
.captcha-input:focus { outline: none; border-color: var(--navy-light); }
.captcha-btn {
  background: white; border: 2px solid var(--border);
  border-radius: var(--radius); padding: .5rem .8rem;
  cursor: pointer; font-size: 1rem; color: var(--muted); transition: all .14s;
}
.captcha-btn:hover { border-color: var(--navy); color: var(--navy); }
.captcha-hint { font-size: .78rem; color: var(--muted); }

/* ── Submit ── */
.btn-submit {
  width: 100%; padding: .95rem;
  background: var(--navy);
  color: white; border: none; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; letter-spacing: .5px;
  cursor: pointer; transition: background .14s, transform .1s;
  border-bottom: 3px solid var(--gold);
  margin-top: .5rem;
}
.btn-submit:hover:not(:disabled) { background: var(--navy-mid); }
.btn-submit:active:not(:disabled) { transform: scale(.99); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: .9rem 2rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; color: white;
  z-index: 9999; transition: transform .3s ease, opacity .3s ease;
  opacity: 0; min-width: 280px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
#toast.show   { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.success { background: var(--success); }
#toast.error   { background: var(--danger); }

/* ── Success Screen ── */
#success-screen {
  display: none; text-align: center; padding: 3.5rem 1.5rem;
}
.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
#success-screen h2 { color: var(--success); font-size: 1.4rem; margin-bottom: .75rem; }
#success-screen p  { color: var(--muted); max-width: 420px; margin: 0 auto; font-size: .92rem; }

/* ── Footer ── */
.page-footer {
  text-align: center; padding: 1.5rem;
  font-size: .75rem; color: var(--muted);
  border-top: 1px solid var(--border);
  background: white; margin-top: 1rem;
}

@media (max-width: 480px) {
  .rating-table thead th:first-child { width: 38%; }
  .rating-table label.rc { width: 26px; height: 26px; font-size: .75rem; }
  .header-logo { display: none; }
}
