:root {
  --navy: #0f2440;
  --navy-mid: #1a3a5c;
  --blue: #2563b5;
  --blue-bright: #3b82d4;
  --teal: #0097b2;
  --mist: #eef4fa;
  --cloud: #f7fbff;
  --ink: #0f2440;
  --muted: #5a738c;
  --soft: #8a9db0;
  --line: rgba(15, 36, 64, 0.1);
  --good: #0d8a5a;
  --bad: #c0392b;
  --surface: #ffffff;
  --shadow: 0 18px 48px rgba(15, 36, 64, 0.1);
  --radius: 22px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Sora", "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cloud);
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef4fa 48%, #e8f1f8 100%);
}

.wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.wash-a {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background: rgba(37, 99, 181, 0.18);
}

.wash-b {
  width: 380px;
  height: 380px;
  right: -100px;
  bottom: 8%;
  background: rgba(0, 151, 178, 0.14);
  animation-delay: -6s;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(18px, -14px, 0);
  }
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px 10px;
}

.brand-logo {
  width: min(200px, 52vw);
  height: auto;
  display: block;
  animation: brand-in 0.7s var(--ease) both;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 28px));
  margin: 8px auto max(40px, calc(24px + env(safe-area-inset-bottom)));
  min-height: 52vh;
}

.landing-hero {
  margin-bottom: 1rem;
}

.landing-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 28rem);
  margin: 1.25rem auto 0;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.question-block {
  scroll-margin-top: 1.25rem;
}

.question-block.is-invalid {
  border-color: rgba(192, 57, 43, 0.35);
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.12), var(--shadow);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.question-num {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--teal);
}

.question-warn {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bad);
}

.landing-submit {
  text-align: center;
  margin-bottom: 1.5rem;
}

.landing-submit-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.btn-wide {
  width: min(100%, 22rem);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 34px);
  animation: panel-in 0.45s var(--ease) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel.is-out {
  animation: panel-out 0.22s ease forwards;
}

@keyframes panel-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

h1,
.h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--navy);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 40ch;
}

.panel-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-hero .kicker {
  justify-content: center;
}

.panel-hero .lead {
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

.actions-center {
  justify-content: center;
}

.panel-hero .actions {
  width: 100%;
  justify-content: center;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
}

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 36, 64, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 0.4s var(--ease);
}

.progress-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--soft);
  white-space: nowrap;
}

.q-title {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  line-height: 1.3;
  color: var(--navy);
}

.option-grid {
  display: grid;
  gap: 10px;
}

.option {
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fbfe;
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 52px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.option:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 181, 0.35);
  background: #fff;
}

.option.is-selected {
  border-color: rgba(37, 99, 181, 0.55);
  background: linear-gradient(135deg, rgba(37, 99, 181, 0.08), rgba(0, 151, 178, 0.08));
  box-shadow: 0 0 0 1px rgba(37, 99, 181, 0.12);
}

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

.scale-btn {
  min-height: 56px;
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fbfe;
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.scale-num {
  font-size: 1.25rem;
  font-family: var(--display, inherit);
}

.scale-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 151, 178, 0.45);
}

.scale-btn.is-selected {
  border-color: rgba(37, 99, 181, 0.55);
  background: linear-gradient(135deg, rgba(37, 99, 181, 0.12), rgba(0, 151, 178, 0.12));
  box-shadow: 0 0 0 1px rgba(37, 99, 181, 0.14);
  color: #0a4a66;
}

.scale-group {
  display: grid;
  gap: 14px;
}

.scale-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.scale-row-label {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

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

.star-btn,
.emoji-btn {
  min-height: 72px;
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fbfe;
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 6px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: center;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.star-btn .glyph,
.emoji-btn .glyph {
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}

.star-btn .star-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.star-btn .star-label,
.emoji-btn span:last-child {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.star-btn:hover,
.emoji-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 181, 0.35);
  background: #fff;
}

.star-btn.is-selected,
.emoji-btn.is-selected {
  border-color: rgba(37, 99, 181, 0.55);
  background: rgba(37, 99, 181, 0.08);
  box-shadow: 0 8px 22px rgba(15, 36, 64, 0.08);
}

.star-btn.is-selected .glyph,
.emoji-btn.is-selected .glyph {
  transform: scale(1.08);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.sales-hint {
  margin: -4px 0 14px;
}

.sales-list {
  display: grid;
  gap: 10px;
}

.sale-card {
  border: 1px solid var(--line);
  background: #f8fbfe;
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sale-card.is-selected {
  border-color: rgba(37, 99, 181, 0.55);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(37, 99, 181, 0.12);
}

.sale-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 52px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sale-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: #fff;
  flex: none;
}

.sale-card.is-selected .sale-check {
  background: var(--blue);
  border-color: var(--blue);
}

.sale-qty {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
}

.sale-qty label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.qty-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
}

.qty-btn {
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fbfe;
  color: var(--navy);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.qty-btn:hover {
  background: #fff;
  border-color: rgba(37, 99, 181, 0.35);
}

.qty-row input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  background: #fff;
}

.qty-row input:focus {
  outline: none;
  border-color: rgba(37, 99, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 181, 0.12);
}

.qty-cap {
  font-size: 0.78rem;
  color: var(--soft);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 13px 15px;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(37, 99, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 181, 0.12);
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
}

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

.btn-primary {
  background: linear-gradient(120deg, #1f5ea8 0%, #2563b5 45%, #0097b2 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 181, 0.22);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 181, 0.28);
}

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

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

.done {
  text-align: center;
  padding: 18px 8px 8px;
}

.done-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: var(--good);
  background: rgba(13, 138, 90, 0.1);
  border: 1px solid rgba(13, 138, 90, 0.28);
  animation: pop 0.45s var(--ease) both;
}

@keyframes pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.done .lead {
  margin: 0 auto 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(12px + env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100% - 28px));
  background: #fff;
  border: 1px solid rgba(192, 57, 43, 0.28);
  color: var(--navy);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 650;
  box-shadow: var(--shadow);
  text-align: center;
}

/* Tablet */
@media (max-width: 760px) {
  .stage {
    width: min(680px, calc(100% - 24px));
  }

  .panel {
    border-radius: 20px;
  }
}

/* Phone */
@media (max-width: 560px) {
  .topbar {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .brand-logo {
    width: min(168px, 58vw);
  }

  .stage {
    width: calc(100% - 20px);
    margin-top: 4px;
  }

  .panel {
    padding: 18px 16px 20px;
    border-radius: 18px;
  }

  h1,
  .h1 {
    font-size: 1.35rem;
  }

  .lead {
    font-size: 0.98rem;
    max-width: none;
  }

  .q-title {
    font-size: 1.12rem;
    margin-bottom: 14px;
  }

  /* Stars: compact 5-column row */
  .stars {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .star-btn {
    min-height: 70px;
    padding: 8px 2px 10px;
    border-radius: 14px;
    gap: 3px;
  }

  .star-btn .glyph {
    font-size: 1.15rem;
  }

  .star-btn .star-num {
    font-size: 0.8rem;
  }

  .star-btn .star-label {
    font-size: 0.58rem;
    padding: 0 1px;
  }

  /* Emojis / long labels: full-width list for easy tapping */
  .emojis {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .emoji-btn {
    min-height: 52px;
    grid-template-columns: 36px 1fr;
    justify-items: start;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    gap: 10px;
  }

  .emoji-btn .glyph {
    font-size: 1.35rem;
  }

  .emoji-btn span:last-child {
    font-size: 0.92rem;
    color: var(--ink);
    text-align: left;
  }

  .option {
    min-height: 52px;
    padding: 14px;
    font-size: 0.95rem;
  }

  .actions {
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 18px;
  }

  .btn {
    width: 100%;
  }

  .progress-label {
    font-size: 0.72rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .stars {
    gap: 4px;
  }

  .star-btn .star-label {
    display: none;
  }

  .star-btn {
    min-height: 58px;
  }
}

/* Desktop signature — bottom right */
.maker-mark {
  display: none;
}

@media (min-width: 900px) {
  .stage {
    margin-top: 12px;
  }

  .panel {
    padding: 36px 40px;
  }

  .maker-mark {
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 5;
    display: grid;
    justify-items: end;
    gap: 2px;
    pointer-events: none;
    user-select: none;
    color: var(--navy-mid);
    opacity: 0.28;
    transition: opacity 0.25s var(--ease);
  }

  .maker-mark:hover {
    opacity: 0.45;
  }

  .maker-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--soft);
  }

  .maker-name {
    font-family: var(--display);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--navy);
  }

  .maker-sig {
    width: 148px;
    height: auto;
    margin-top: 2px;
    color: #1a3a5c;
  }
}
