:root {
  --tym-purple: #5846c7;
  --tym-purple-soft: #7976d3;
  --tym-blue: #2f9bd7;
  --tym-mint: #29c7a2;
  --tym-ink: #18233f;
  --tym-muted: #8790af;
  --tym-line: #e5e8f4;
  --tym-panel: #ffffff;
  --tym-soft: #f3f8fd;
  --tym-warm: #fff7e8;
  --shadow: 0 24px 70px rgba(48, 47, 119, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--tym-muted);
  font-family: "Open Sans", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(121, 118, 211, 0.22), transparent 30%),
    radial-gradient(circle at 88% 78%, rgba(47, 155, 215, 0.16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f3f8fd 100%);
}

button,
input,
textarea {
  font: inherit;
}

.survey-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  width: min(1160px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  align-items: stretch;
}

.brand-panel,
.form-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(121, 118, 211, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(155deg, rgba(88, 70, 199, 0.94), rgba(47, 155, 215, 0.84)),
    url("https://trackyourmed.com/images/follow-up-3.png") center bottom / 105% auto no-repeat;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 35, 63, 0.12), rgba(24, 35, 63, 0.62));
}

.brand-panel > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.brand-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--tym-purple);
  background: #ffffff;
  font-size: 27px;
  font-weight: 700;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-visual {
  position: relative;
  display: grid;
  min-height: 360px;
  place-items: center;
}

.phone {
  position: relative;
  width: min(270px, 75%);
  aspect-ratio: 9 / 16;
  padding: 28px 18px;
  border: 10px solid rgba(255, 255, 255, 0.76);
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 48px rgba(24, 35, 63, 0.24);
}

.phone-bar {
  width: 72px;
  height: 7px;
  margin: 0 auto 34px;
  border-radius: 20px;
  background: rgba(88, 70, 199, 0.24);
}

.pill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  color: var(--tym-ink);
  background: #f3f8fd;
}

.pill-row.active {
  color: #ffffff;
  background: var(--tym-purple);
}

.pill-row span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.32;
}

.chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 110px;
  margin-top: 28px;
  padding: 16px;
  border-radius: 22px;
  background: #ffffff;
}

.chart i {
  display: block;
  flex: 1;
  border-radius: 12px 12px 4px 4px;
  background: var(--tym-mint);
}

.chart i:nth-child(1) { height: 42%; }
.chart i:nth-child(2) { height: 66%; background: var(--tym-blue); }
.chart i:nth-child(3) { height: 88%; background: var(--tym-purple-soft); }
.chart i:nth-child(4) { height: 58%; background: #f7b84b; }

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.orbit-one {
  width: 310px;
  height: 310px;
}

.orbit-two {
  width: 420px;
  height: 420px;
  opacity: 0.55;
}

.brand-panel p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 22px;
  font-weight: 300;
  line-height: 1.45;
}

.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 58px);
}

.language-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 22px;
}

.language-control label {
  color: var(--tym-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.language-control select {
  min-height: 42px;
  border: 2px solid var(--tym-line);
  border-radius: 999px;
  padding: 0 38px 0 16px;
  color: var(--tym-purple);
  background: #ffffff;
  font-weight: 700;
  outline: 0;
}

.language-control select:focus {
  border-color: var(--tym-purple-soft);
  box-shadow: 0 0 0 5px rgba(121, 118, 211, 0.13);
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  color: var(--tym-purple);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.progress-track {
  height: 8px;
  margin-bottom: 44px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f8;
}

#progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tym-purple), var(--tym-blue));
  transition: width 220ms ease;
}

.question {
  animation: lift 220ms ease;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--tym-blue);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 26px;
  color: var(--tym-purple);
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: 0;
}

.helper {
  margin: -10px 0 24px;
  color: var(--tym-muted);
  font-size: 16px;
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 12px;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 64px;
  border: 2px solid var(--tym-line);
  border-radius: 18px;
  outline: 0;
  padding: 18px 20px;
  color: var(--tym-ink);
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 164px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--tym-purple-soft);
  box-shadow: 0 0 0 5px rgba(121, 118, 211, 0.13);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px;
  border: 2px solid var(--tym-line);
  border-radius: 20px;
  color: var(--tym-ink);
  background: #ffffff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(121, 118, 211, 0.48);
  box-shadow: 0 16px 30px rgba(88, 70, 199, 0.11);
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  color: var(--tym-purple);
  background: var(--tym-soft);
  font-size: 22px;
}

.option-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.option-card:has(input:checked) {
  border-color: var(--tym-purple);
  background: linear-gradient(135deg, rgba(88, 70, 199, 0.1), rgba(47, 155, 215, 0.08));
  box-shadow: 0 18px 38px rgba(88, 70, 199, 0.15);
}

.option-card:has(input:checked) .option-icon {
  color: #ffffff;
  background: var(--tym-purple);
}

.range-wrap {
  display: grid;
  gap: 22px;
  padding: 24px;
  border-radius: 24px;
  background: var(--tym-soft);
}

.range-value {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--tym-purple);
  font-size: 40px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--tym-purple);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: var(--tym-muted);
  font-size: 13px;
  font-weight: 700;
}

.error-message {
  min-height: 24px;
  margin: 22px 0 0;
  color: #d94d5c;
  font-size: 14px;
  font-weight: 700;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  min-width: 142px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.btn-primary {
  color: #ffffff;
  background: var(--tym-purple);
  box-shadow: 0 16px 30px rgba(88, 70, 199, 0.24);
}

.btn-secondary {
  color: var(--tym-purple);
  background: #ffffff;
  border: 2px solid rgba(121, 118, 211, 0.34);
}

.thank-you {
  display: grid;
  min-height: 520px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.thank-icon {
  display: grid;
  width: 104px;
  height: 104px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--tym-mint);
  font-size: 52px;
  font-weight: 700;
}

.thank-you h1 {
  max-width: 560px;
  margin-bottom: 16px;
}

.thank-you p:not(.eyebrow) {
  max-width: 500px;
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
}

.summary-box {
  display: grid;
  gap: 6px;
  margin-top: 28px;
  padding: 16px 22px;
  border-radius: 18px;
  color: var(--tym-ink);
  background: var(--tym-soft);
}

.summary-box span {
  color: var(--tym-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-shell {
  width: min(1280px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
}

.admin-card {
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid rgba(121, 118, 211, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.admin-brand {
  margin-bottom: 40px;
  color: var(--tym-purple);
}

.admin-brand .brand-icon {
  color: #ffffff;
  background: var(--tym-purple);
}

.admin-login {
  display: grid;
  max-width: 460px;
  gap: 12px;
}

.admin-login .btn {
  justify-self: start;
}

.admin-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.empty-state {
  display: grid;
  min-height: 360px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--tym-purple);
  font-size: 30px;
  font-weight: 300;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--tym-line);
  border-radius: 18px;
  background: #ffffff;
}

.responses-table {
  width: 100%;
  min-width: 1800px;
  border-collapse: collapse;
  color: var(--tym-ink);
  font-size: 14px;
}

.responses-table th,
.responses-table td {
  max-width: 260px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tym-line);
  text-align: left;
  vertical-align: top;
}

.responses-table th {
  position: sticky;
  top: 0;
  color: var(--tym-purple);
  background: var(--tym-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.responses-table td {
  line-height: 1.45;
}

@media (max-width: 880px) {
  .survey-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 680px);
  }

  .brand-panel {
    min-height: 260px;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 620px) {
  .survey-shell {
    min-height: auto;
    margin: 12px auto;
  }

  .brand-panel,
  .form-panel {
    border-radius: 22px;
  }

  .brand-panel {
    padding: 24px;
  }

  .brand-panel p {
    font-size: 18px;
  }

  .form-panel {
    padding: 24px 18px;
  }

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

  .option-card {
    min-height: 74px;
  }

  .actions {
    position: sticky;
    bottom: 0;
    margin: 24px -18px -24px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
  }

  .language-control {
    justify-content: space-between;
  }

  .btn {
    min-width: 0;
    flex: 1;
    padding: 0 16px;
  }

  .admin-shell {
    width: min(100% - 24px, 680px);
    margin: 12px auto;
  }

  .admin-card {
    border-radius: 22px;
    padding: 24px 18px;
  }

  .admin-header {
    display: grid;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions .btn {
    flex: 1 1 150px;
  }
}
