:root {
  --blue-900: #063b70;
  --blue-800: #07508f;
  --blue-700: #0b68b8;
  --blue-100: #e8f3ff;
  --blue-050: #f4f9ff;
  --green-600: #18a957;
  --text: #1d2b3a;
  --muted: #617286;
  --line: #d9e5f2;
  --surface: #ffffff;
  --shadow: 0 24px 70px rgba(6, 59, 112, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(11, 104, 184, 0.16), transparent 32rem),
    linear-gradient(135deg, #f7fbff 0%, #eef6ff 48%, #ffffff 100%);
}

button,
textarea,
input {
  font: inherit;
}

.survey-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
  display: grid;
  place-items: center;
}

.survey-card,
.success-card {
  width: min(100%, 760px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 229, 242, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.survey-card {
  padding: clamp(22px, 4vw, 42px);
}

.survey-header {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.hospital-logo {
  width: 128px;
  max-width: 100%;
  height: auto;
}

.header-copy h1 {
  margin: 0 0 10px;
  color: var(--blue-900);
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.header-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.progress-wrap {
  margin: 26px 0 30px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--blue-800);
  font-size: 0.92rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-100);
}

.progress-bar {
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-900));
  transition: width 260ms ease;
}

.question-step {
  display: none;
  animation: fadeSlide 260ms ease;
}

.question-step.is-active {
  display: block;
}

.question-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue-700);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.question-step h2 {
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(1.22rem, 3vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: 0;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rating-option {
  min-height: 112px;
  padding: 15px 10px;
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(6, 59, 112, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.rating-option:hover,
.rating-option:focus-visible {
  border-color: var(--blue-700);
  transform: translateY(-2px);
  outline: none;
}

.rating-option.is-selected {
  color: var(--blue-900);
  border-color: var(--blue-700);
  background: var(--blue-050);
  box-shadow: 0 14px 30px rgba(11, 104, 184, 0.17);
}

.stars {
  min-height: 24px;
  display: block;
  font-size: 1.12rem;
  line-height: 1.25;
}

.slider-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-050);
}

.slider-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
}

.slider-value strong {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue-800);
  font-size: 1.75rem;
  box-shadow: 0 12px 24px rgba(7, 80, 143, 0.22);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue-700);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px rgba(11, 104, 184, 0.12);
}

.form-alert {
  min-height: 24px;
  margin: 18px 0 0;
  color: #b42318;
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  color: #fff;
  background: var(--blue-800);
  box-shadow: 0 12px 24px rgba(7, 80, 143, 0.22);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--blue-900);
  transform: translateY(-1px);
  outline: none;
}

.secondary-button {
  color: var(--blue-800);
  background: var(--blue-100);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #d9ecff;
  outline: none;
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.is-hidden {
  display: none;
}

.success-card {
  display: none;
  padding: clamp(34px, 6vw, 58px);
  text-align: center;
  animation: fadeSlide 320ms ease;
}

.success-card.is-active {
  display: block;
}

.success-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-600);
  font-size: 3rem;
  font-weight: 800;
  animation: popIn 420ms cubic-bezier(0.2, 1.4, 0.5, 1);
}

.success-card h2 {
  margin: 0 0 12px;
  color: var(--blue-900);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.success-card p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .survey-shell {
    padding: 14px;
  }

  .survey-header {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }

  .hospital-logo {
    margin: 0 auto;
  }

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

  .rating-option {
    min-height: 72px;
    grid-template-columns: 108px 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .rating-option {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
