:root {
  --bg: #f7f4ef;
  --ink: #1e1f22;
  --muted: #5f636d;
  --brand: #c8382f;
  --brand-soft: #f4d2cf;
  --line: #ded7cc;
  --card: #fffdf9;
  --ok: #1b7a45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", sans-serif;
  background: radial-gradient(circle at 15% 10%, #ffe4cc 0%, transparent 36%),
    radial-gradient(circle at 85% 20%, #dce9ff 0%, transparent 28%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.bg-shape-a {
  width: 260px;
  height: 260px;
  right: -90px;
  top: -70px;
  background: linear-gradient(145deg, #ffb992, #ff8f65);
  opacity: 0.35;
  border-radius: 40% 60% 45% 55%;
  animation: drift 14s ease-in-out infinite;
}

.bg-shape-b {
  width: 300px;
  height: 300px;
  left: -120px;
  bottom: -120px;
  background: linear-gradient(160deg, #b6d0ff, #89a5dd);
  opacity: 0.32;
  border-radius: 62% 38% 58% 42%;
  animation: drift 18s ease-in-out infinite reverse;
}

.container {
  position: relative;
  z-index: 2;
  width: min(980px, 92vw);
  margin: 36px auto 56px;
}

.hero {
  background: linear-gradient(120deg, #251f1f, #422f2f);
  color: #fff;
  padding: 28px;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(26, 18, 16, 0.24);
}

.eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Black Han Sans", sans-serif;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  font-weight: 400;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.8rem);
}

h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

.subtitle {
  margin: 0 0 14px;
  color: #f2e8e3;
}

.product-chip {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.hero-links {
  margin: 10px 0 0;
}

.hero-links a {
  color: #ffd7b6;
}

.hero-links a:hover {
  color: #fff;
}

.card {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(39, 31, 26, 0.07);
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #efebe3;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #ea4d3f, #f39a56);
  transition: width 0.25s ease;
}

.step-label {
  margin: 0 0 16px;
  color: #4f504f;
  font-size: 0.92rem;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

label {
  display: block;
  margin-bottom: 13px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #cfc8be;
  background: #fff;
  font-family: inherit;
}

input:focus,
select:focus {
  outline: 2px solid #ffd0ca;
  border-color: #e47468;
}

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

.full {
  grid-column: 1 / -1;
}

.terms-container {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.term-item {
  border: 1px solid #ddd3c5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.term-item p {
  margin: 8px 0 0;
  font-size: 0.93rem;
  color: #5a5b5e;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
}

.check-row input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.all-check {
  background: #f4f0e8;
  padding: 10px;
  border-radius: 10px;
}

.terms-image-frame {
  border: 1px solid #d6c7b7;
  border-radius: 12px;
  background: #fff;
  height: 320px;
  overflow: auto;
  margin: 12px 0;
}

.terms-image-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.terms-text {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: keep-all;
  line-height: 1.65;
  font-size: 0.92rem;
  color: #2f2d2a;
}

.rrn-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.rrn-wrap input {
  margin-top: 0;
}

.rrn-wrap input:first-child {
  width: 46%;
}

.rrn-wrap input:nth-child(3) {
  width: 22%;
}

.address-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.address-row input {
  margin-top: 0;
}

.question-box {
  border: 1px solid #ddd3c5;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  margin-bottom: 10px;
}

.question-box p {
  margin: 0 0 10px;
}

.inline-options {
  display: flex;
  gap: 20px;
}

.inline-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 400;
}

.inline-options input {
  width: 16px;
  margin: 0;
}

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

.plan-card {
  border: 1px solid #d4c8b8;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.plan-card strong {
  font-size: 1.05rem;
}

.plan-card span,
.plan-card small {
  display: block;
  margin-top: 4px;
}

.plan-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 56, 47, 0.15);
  background: #fff7f6;
}

.premium-preview {
  margin-top: 12px;
  font-weight: 700;
  color: #1f2628;
}

.signature-wrap {
  border: 1px dashed #b9ac9a;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-top: 12px;
}

#signaturePad {
  width: 100%;
  height: 220px;
  display: block;
}

.summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #f6f1ea;
  font-size: 0.93rem;
}

.identity-box {
  margin-top: 14px;
  border: 1px solid #ddcfbd;
  border-radius: 12px;
  padding: 12px;
  background: #fffcf8;
}

.identity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.identity-actions.top {
  justify-content: flex-end;
}

.identity-flow {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.identity-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.identity-line label {
  margin: 0;
}

.identity-line button {
  height: 42px;
  white-space: nowrap;
}

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

.captcha-wrap {
  background: #fff;
  border: 1px solid #d5c8b8;
  border-radius: 10px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

#captchaImage {
  max-width: 100%;
  max-height: 74px;
}

.identity-status {
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--ok);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

button.ghost {
  background: #ece6dc;
  color: #3f4247;
}

button.accent,
#nextBtn {
  background: linear-gradient(120deg, #d9493f, #ef8f4a);
  color: #fff;
}

.hidden {
  display: none !important;
}

.fade-up {
  animation: fadeUp 0.55s ease both;
}

.delay-1 {
  animation-delay: 0.12s;
}

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

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(18px) rotate(8deg);
  }
}

@media (max-width: 860px) {
  .grid.two,
  .plan-cards,
  .identity-grid,
  .identity-line {
    grid-template-columns: 1fr;
  }

  .container {
    margin-top: 20px;
  }

  .card,
  .hero {
    padding: 18px;
    border-radius: 14px;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }

  .address-row {
    flex-direction: column;
  }
}
