:root {
  --brand-primary: #2a568c;
  --brand-primary-dark: #1f426b;
  --brand-primary-light: #eaf1f8;
  --accent-teal: #2e7d7b;
  --text-primary: #1f2937;
  --text-muted: #6b7280;
  --bg-page: #f7fafc;
  --white: #ffffff;
  --success: #2e7d32;
  --warning: #b7791f;
  --danger: #c53030;
  --border: #d6e0ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
}

.topbar {
  background: var(--brand-primary);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar img {
  height: 56px;
  width: auto;
  max-width: min(220px, 40vw);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.topbar h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
}

.topbar h4 {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
  opacity: 0.95;
}

.container {
  max-width: 980px;
  margin: 20px auto;
  padding: 0 16px 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.step.active {
  background: var(--brand-primary);
  color: var(--white);
  border-color: var(--brand-primary);
}

.step.done {
  background: var(--accent-teal);
  color: var(--white);
  border-color: var(--accent-teal);
}

h1, h2, h3 {
  margin-top: 0;
}

.muted {
  color: var(--text-muted);
}

.question {
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.options {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  cursor: pointer;
}

.actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: bold;
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
}

.btn-secondary {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  margin-top: 6px;
}

textarea {
  min-height: 90px;
}

.field {
  margin-bottom: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.score {
  font-size: 26px;
  font-weight: bold;
  color: var(--brand-primary);
}

.error {
  color: var(--danger);
  margin-top: 8px;
}

.hidden {
  display: none;
}

body.submit-loading-active {
  overflow: hidden;
}

.submit-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgb(15 23 42 / 0.45);
  backdrop-filter: blur(2px);
}

.submit-loading-overlay.hidden {
  display: none;
}

.submit-loading-card {
  min-width: 240px;
  max-width: 360px;
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
  background: var(--white, #fff);
  box-shadow: 0 20px 50px -12px rgb(15 23 42 / 0.35);
  text-align: center;
}

.submit-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border, #e2e8f0);
  border-top-color: var(--brand-primary, #2a568c);
  border-radius: 50%;
  animation: submit-loading-spin 0.8s linear infinite;
}

.submit-loading-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text, #0f172a);
}

@keyframes submit-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

input[type="email"] {
  text-transform: lowercase;
}

body.feedback-modal-open {
  overflow: hidden;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.feedback-modal.hidden {
  display: none;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
}

.feedback-modal-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 20px 50px -12px rgb(15 23 42 / 0.35);
}

.feedback-modal-dialog h3 {
  margin-bottom: 0.35rem;
}

.feedback-modal-intro {
  margin-top: 0;
  margin-bottom: 1rem;
}

.feedback-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0;
}

.feedback-fieldset legend {
  font-weight: bold;
  padding: 0 0.25rem;
}

.feedback-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.feedback-radio-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.35;
}

.feedback-radio-group input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.feedback-contact.hidden {
  display: none;
}

.feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
