/* Yagud light theme. Palette sampled from the Yagud Amazon A+ content. */
:root {
  color-scheme: light;
  --yagud-blue: #3e6fb1;
  --yagud-blue-deep: #1758b4;
  --yagud-blue-soft: #e9f0fa;
  --yagud-ink: #1e1e1e;
  --yagud-white: #ffffff;
  --yagud-mist: #e8ecef;
  --paper: #f5f7f9;
  --ink: #1e1e1e;
  --muted: #6b7178;
  --line: #dde2e8;
  --line-strong: #c9d0d8;
  --panel: #ffffff;
  --danger: #c8302c;
  --shadow: 0 10px 30px rgba(30, 40, 60, 0.08);
  --shadow-sm: 0 2px 8px rgba(30, 40, 60, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 40%, var(--yagud-mist) 100%);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 0 16px max(28px, env(safe-area-inset-bottom));
}

/* Hero */
.hero {
  position: relative;
  margin: 0 -16px;
  overflow: hidden;
  padding: 18px 20px 28px;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(62, 111, 177, 0.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
  border-bottom: 1px solid var(--line);
}

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

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.brand-row > * {
  min-width: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 4px 0;
}

.brand-logo {
  display: block;
  width: min(128px, 34vw);
  height: auto;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.contact-button,
.language-button {
  min-height: 34px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.contact-button {
  padding: 0 14px;
  border: 1px solid var(--yagud-blue);
  color: var(--yagud-white);
  background: var(--yagud-blue);
}

.contact-button:active {
  background: var(--yagud-blue-deep);
}

.language-button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--yagud-white);
  text-transform: uppercase;
}

.language-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.warranty-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--yagud-blue-deep);
  background: var(--yagud-blue-soft);
  font-size: 12px;
  line-height: 1.2;
}

.warranty-mark span {
  font-weight: 500;
}

.warranty-mark strong {
  font-weight: 600;
  white-space: nowrap;
}

.hero-kicker {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero h1 {
  max-width: 386px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 8.2vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Progress */
.progress {
  display: flex;
  align-items: center;
  margin: 20px 4px;
}

.progress__step {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--yagud-white);
  font-size: 13px;
  font-weight: 600;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.progress__step.is-active,
.progress__step.is-complete {
  border-color: var(--yagud-blue);
  color: var(--yagud-white);
  background: var(--yagud-blue);
}

.progress__bar {
  height: 2px;
  flex: 1;
  margin: 0 6px;
  border-radius: 2px;
  background: var(--line);
}

/* Panels */
.panel {
  display: none;
  position: relative;
  margin: 0 0 18px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel.is-active {
  display: block;
  animation: panel-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel__header {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--yagud-blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 6.4vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.panel[data-step="activation"] .panel__header {
  margin-bottom: 18px;
}

.panel[data-step="activation"] .eyebrow {
  margin-bottom: 0;
}

.panel__header p:not(.eyebrow),
.success-panel p,
.final-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Form */
.form {
  display: grid;
  gap: 18px;
}

label,
fieldset {
  min-width: 0;
}

label > span,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

b {
  color: var(--danger);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--yagud-white);
  outline: 0;
  padding: 0 14px;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  min-width: 0;
}

textarea {
  min-height: 140px;
  padding-top: 12px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa1a9;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--yagud-blue);
  box-shadow: 0 0 0 3px rgba(62, 111, 177, 0.16);
}

small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checkbox-line {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--yagud-blue);
}

.checkbox-line span {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.form-alert {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* Buttons */
.primary-button {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--yagud-white);
  background: var(--yagud-blue);
  box-shadow: 0 8px 20px rgba(62, 111, 177, 0.28);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: normal;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:active {
  transform: translateY(1px);
  background: var(--yagud-blue-deep);
  box-shadow: 0 4px 12px rgba(62, 111, 177, 0.24);
}

/* Submitting state: spinner + dimmed, non-interactive while the request runs. */
.primary-button.is-loading {
  cursor: progress;
  opacity: 0.85;
}

.primary-button.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--yagud-white);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button.is-loading::before {
    animation: none;
  }
}

/* Success / finish */
.success-panel,
.final-panel {
  min-height: 520px;
  text-align: center;
}

.celebration-badge {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 22px auto 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--yagud-white);
  background: var(--yagud-blue);
  box-shadow: 0 0 0 10px var(--yagud-blue-soft);
  font-size: 34px;
  font-weight: 600;
}

.warranty-card {
  display: grid;
  gap: 4px;
  margin: 26px auto;
  padding: 26px 16px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--yagud-white);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, var(--yagud-blue) 0%, var(--yagud-blue-deep) 100%);
  box-shadow: 0 12px 28px rgba(23, 88, 180, 0.25);
}

.warranty-card span {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.warranty-card strong {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.92;
}

.success-panel h2,
.final-panel h2 {
  font-size: clamp(22px, 7vw, 28px);
}

.primary-button--xl {
  min-height: 60px;
  font-size: 18px;
}

.success-panel .primary-button--xl {
  margin-top: 8px;
  animation: cta-attention 1.8s ease-in-out infinite;
}

@keyframes cta-attention {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(62, 111, 177, 0.28);
  }

  50% {
    box-shadow: 0 8px 20px rgba(62, 111, 177, 0.28), 0 0 0 6px rgba(62, 111, 177, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .success-panel .primary-button--xl {
    animation: none;
  }
}

/* Finish-step app download CTA is an anchor, not a button. Two stacked lines. */
.app-cta {
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding: 12px;
  text-decoration: none;
}

.app-cta span:last-child {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
}

.support-photo {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 4px auto 26px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Survey */
.choice-group,
.nps-field,
.rating-field {
  padding: 0;
  border: 0;
  margin: 0;
}

.choice-group {
  display: grid;
  gap: 10px;
}

.choice-group label {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--yagud-white);
  transition: border-color 160ms ease, background 160ms ease;
}

.choice-group label:has(input:checked) {
  border-color: var(--yagud-blue);
  background: var(--yagud-blue-soft);
}

.choice-group input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--yagud-blue);
}

.choice-group span {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
}

.nps-option {
  display: grid;
  min-width: 0;
  gap: 6px;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.nps-option::before {
  content: "";
  width: 100%;
  height: 14px;
  border-radius: 4px;
  background: #d6e1f0;
}

.nps-option.is-selected {
  color: var(--yagud-blue-deep);
}

.nps-option.is-selected::before {
  background: var(--yagud-blue);
}

.stars {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.star-button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: #cfd5dc;
  background: var(--yagud-white);
  font-size: 30px;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.star-button.is-selected {
  border-color: var(--yagud-blue);
  color: var(--yagud-blue);
  background: var(--yagud-blue-soft);
}

/* Dialogs */
.language-dialog,
.contact-dialog {
  width: min(86vw, 380px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(30, 40, 60, 0.22);
}

.language-dialog::backdrop,
.contact-dialog::backdrop {
  background: rgba(30, 40, 60, 0.36);
}

.language-dialog form {
  display: grid;
  gap: 12px;
  padding: 26px;
  background: var(--yagud-white);
}

.language-dialog h2,
.contact-dialog h2 {
  font-size: 22px;
}

.language-dialog label {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 36px;
}

.language-dialog input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--yagud-blue);
}

.language-dialog span {
  margin: 0;
  font-weight: 400;
}

.language-dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 0 0;
  margin: 0;
}

.language-dialog button {
  min-width: 84px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--yagud-white);
  font-size: 14px;
  font-weight: 500;
}

.language-dialog button[value="ok"] {
  border-color: var(--yagud-blue);
  color: var(--yagud-white);
  background: var(--yagud-blue);
}

.contact-dialog form {
  display: grid;
  justify-items: start;
  padding: 26px;
  background: var(--yagud-white);
}

.contact-dialog p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.contact-email {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--yagud-white);
  background: var(--yagud-blue);
  box-shadow: 0 8px 20px rgba(62, 111, 177, 0.28);
  font-size: clamp(13px, 3.8vw, 15px);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.contact-email::after {
  content: "↗";
  margin-left: 8px;
}

.contact-email:active {
  background: var(--yagud-blue-deep);
}

.contact-dialog small {
  width: 100%;
  margin: 12px 0 16px;
  text-align: center;
}

.contact-dialog button {
  justify-self: center;
  min-height: 32px;
  padding: 2px 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Compact hero: only the brand row + language switch remain from step 2 on. */
.hero--compact {
  padding: 12px 20px;
}

.hero--compact .warranty-mark,
.hero--compact .hero-kicker,
.hero--compact h1 {
  display: none;
}

@media (max-width: 360px) {
  .panel {
    padding: 20px 16px;
  }

  .stars {
    gap: 5px;
  }

  .star-button {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
}

/* Very narrow phones and split-screen views: trade columns for readable lines. */
@media (max-width: 340px) {
  .app-shell {
    padding-inline: 10px;
  }

  .hero {
    margin-inline: -10px;
    padding-inline: 14px;
  }

  .brand-row {
    gap: 8px;
  }

  .header-actions {
    gap: 6px;
  }

  .contact-button {
    padding: 0 10px;
    font-size: 11px;
  }

  .nps-scale {
    gap: 2px;
  }

  .stars {
    gap: 3px;
  }

  .star-button {
    width: min(41px, 16vw);
    height: min(41px, 16vw);
  }

  .language-dialog,
  .contact-dialog {
    width: calc(100vw - 24px);
  }

  .language-dialog form,
  .contact-dialog form {
    padding: 22px 18px;
  }
}

/* Short landscape devices need less vertical space above the form. */
@media (max-height: 560px) and (orientation: landscape) {
  .success-panel,
  .final-panel {
    min-height: 0;
  }
}
