:root {
  --background: #f7f8fa;
  --surface: #ffffff;
  --text-primary: #191f28;
  --text-secondary: #6b7684;
  --border: #e5e8eb;
  --primary: #3182f6;
  --primary-hover: #1b64da;
  --primary-light: #e8f3ff;
  --danger: #e42939;
  --danger-light: #fff0f1;
  --success: #20a46b;
  --radius-card: 20px;
  --radius-button: 15px;
  --shadow-card: 0 8px 28px rgba(25, 31, 40, 0.055);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text-primary);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -120px, rgba(49, 130, 246, 0.11), transparent 340px),
    var(--background);
  word-break: keep-all;
  overflow-wrap: break-word;
}

button,
textarea,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 0 20px calc(48px + env(safe-area-inset-bottom));
}

.hero {
  padding: 54px 4px 30px;
}

.brand-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(49, 130, 246, 0.12);
}

.brand-symbol img {
  display: block;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(31px, 8vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.045em;
  word-break: keep-all;
}

.hero-description {
  margin: 17px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.015em;
}

#survey-form {
  display: grid;
  gap: 20px;
}

.question-card {
  padding: 24px 20px;
  border: 1px solid rgba(229, 232, 235, 0.75);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.question-heading {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  align-items: start;
  margin-bottom: 19px;
}

.question-heading--without-number {
  grid-template-columns: 1fr;
}

.question-number {
  display: grid;
  width: 30px;
  height: 30px;
  margin-top: -2px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.question-heading h2,
.text-field-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.question-heading p,
.text-field-heading p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

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

.choice-card {
  position: relative;
  display: grid;
  min-height: 58px;
  padding: 14px 15px;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.choice-card:active {
  transform: scale(0.992);
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-indicator {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1.5px solid #c9ced6;
  border-radius: 50%;
  background: #fff;
  transition: all 150ms ease;
}

.choice-card--checkbox .choice-indicator {
  border-radius: 7px;
}

.choice-indicator::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: translate(-50%, -60%) rotate(-45deg) scale(0.6);
  transition: opacity 120ms ease, transform 120ms ease;
}

.choice-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.08);
}

.choice-card:has(input:checked) .choice-indicator {
  border-color: var(--primary);
  background: var(--primary);
}

.choice-card:has(input:checked) .choice-indicator::after {
  opacity: 1;
  transform: translate(-50%, -60%) rotate(-45deg) scale(1);
}

.choice-card:has(input:checked) .choice-text {
  color: #1765c9;
  font-weight: 700;
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(49, 130, 246, 0.28);
  outline-offset: 2px;
}

.choice-text {
  color: #333d4b;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.field-error {
  margin: 12px 2px 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 650;
}

.text-field-heading {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 17px;
}

.character-count {
  flex: 0 0 auto;
  color: #8b95a1;
  font-size: 13px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 15px 16px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #fbfcfd;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

textarea::placeholder {
  color: #a5adb8;
}

textarea:focus-visible {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}

.privacy-help {
  display: grid;
  margin: 12px 1px 0;
  grid-template-columns: 18px 1fr;
  gap: 7px;
  align-items: start;
  color: #8b95a1;
  font-size: 12px;
  line-height: 1.5;
}

.privacy-help svg {
  width: 18px;
  height: 18px;
  fill: #a5adb8;
}

.form-error {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--danger-light);
  color: var(--danger);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.submit-area {
  padding: 7px 0 8px;
}

.submit-note {
  margin: 0 0 12px;
  color: #8b95a1;
  font-size: 13px;
  text-align: center;
}

.giveaway-note {
  display: grid;
  margin-top: 16px;
  padding: 17px 18px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #f0e5d5;
  border-radius: 16px;
  background: #fffaf3;
  color: #4a3728;
}

.giveaway-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #f6e5ca;
  color: #9a6537;
}

.giveaway-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.giveaway-content {
  display: grid;
  gap: 4px;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.018em;
}

.giveaway-content strong {
  font-size: 15px;
}

.giveaway-content small {
  color: #876e59;
  font-size: 12px;
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-button);
  cursor: pointer;
  font-size: 17px;
  font-weight: 750;
  transition: background-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.primary-button {
  width: 100%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.23);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-hover);
}

.primary-button:active:not(:disabled),
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.3);
  outline-offset: 3px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 9px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-spinner {
  display: block;
}

.status-view {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 6px calc(90px + env(safe-area-inset-bottom));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.status-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 25px;
}

.status-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-icon--loading,
.status-icon--success,
.status-icon--external {
  background: var(--primary-light);
  color: var(--primary);
}

.status-icon--error {
  background: var(--danger-light);
  color: var(--danger);
}

.status-view h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.status-view > p {
  margin: 13px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.status-view .complete-note {
  margin-top: 23px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--surface);
  color: #4e5968;
  box-shadow: var(--shadow-card);
}

.status-view .external-browser-help {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  color: #4e5968;
  font-size: 14px;
  box-shadow: var(--shadow-card);
}

.external-browser-help strong {
  color: var(--text-primary);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(49, 130, 246, 0.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.secondary-button {
  min-width: 150px;
  margin-top: 24px;
  padding: 0 24px;
  background: var(--primary-light);
  color: #1765c9;
}

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

@media (min-width: 640px) {
  .app-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    padding-top: 74px;
  }

  .mobile-break {
    display: none;
  }

  .question-card {
    padding: 30px 28px;
  }

  .choice-card {
    padding-right: 17px;
    padding-left: 17px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero {
    padding-top: 42px;
  }

  .question-card {
    padding: 22px 17px;
  }

  .question-heading h2,
  .text-field-heading h2 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
