:root {
  --brand: #1a3a5c;
  --brand-strong: #10283f;
  --accent: #e8a020;
  --accent-soft: #f5e2b8;
  --accent-success: #2e7d6b;
  --bg: #f7f4ef;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #69707d;
  --border: #dfd8ce;
  --error: #b42318;
  --shadow: 0 20px 50px rgba(26, 58, 92, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(26, 58, 92, 0.07), transparent 28%),
    radial-gradient(circle at right 20%, rgba(232, 160, 32, 0.1), transparent 24%),
    var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
  padding: 16px;
}

.shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.hero {
  background: var(--brand);
  color: #fff;
  border-radius: 24px 24px 0 0;
  padding: 32px 24px 28px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -36px;
  right: -36px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(232, 160, 32, 0.14);
}

.brand,
.hero h1,
.hero p {
  position: relative;
  z-index: 1;
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  margin-bottom: 16px;
}

.brand span {
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 30px;
  line-height: 1.25;
}

.hero p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.progress-bar {
  height: 4px;
  background: #dcd7d1;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-success), var(--accent));
  transition: width 0.25s ease;
}

.panel {
  background: var(--card);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 24px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.footer-panel {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  padding: 20px 24px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.state-panel {
  padding: 56px 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
}

.state-panel h1 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  color: var(--brand);
  font-size: 28px;
}

.state-panel p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.6;
}

.state-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.question-block + .question-block {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 28px;
}

.question-num {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.question-label {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.4;
}

.nps-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.nps-button,
.likert-button {
  min-height: 48px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.18s ease;
}

.nps-button:hover,
.likert-button:hover,
.option-button:hover {
  border-color: var(--brand);
  background: rgba(26, 58, 92, 0.04);
}

.nps-button.selected,
.likert-button.selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.stars-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stars-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.star-button {
  border: 0;
  background: transparent;
  font-size: 40px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  color: #d0ccc4;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-button.active,
.star-button:hover {
  color: var(--accent);
  transform: scale(1.08);
}

.stars-text {
  color: var(--muted);
  font-size: 14px;
}

.options-stack {
  display: grid;
  gap: 10px;
}

.option-button {
  width: 100%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-button::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: 0.18s ease;
}

.option-button.selected {
  border-color: var(--brand);
  background: rgba(26, 58, 92, 0.05);
  color: var(--brand);
  font-weight: 500;
}

.option-button.selected::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

.likert-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.likert-button {
  padding: 12px 8px;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.08);
}

.textarea-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.field-error,
.submit-error {
  margin: 10px 0 0;
  color: var(--error);
  font-size: 13px;
}

.privacy-note {
  margin: 0;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.submit-wrap {
  min-width: min(100%, 280px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.submit-button {
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 0 24px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--brand-strong);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.is-invalid {
  border-color: var(--error) !important;
}

@media (max-width: 640px) {
  .page {
    padding: 0;
  }

  .hero,
  .state-panel {
    border-radius: 0;
  }

  .form-panel,
  .footer-panel {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .panel {
    box-shadow: none;
  }

  .hero {
    padding: 28px 18px 24px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .form-panel,
  .footer-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .footer-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-wrap {
    min-width: 100%;
    align-items: stretch;
  }

  .submit-button {
    width: 100%;
  }

  .nps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .likert-grid {
    grid-template-columns: 1fr;
  }

  .likert-button {
    text-align: left;
    padding: 14px 16px;
  }
}
