/* ============ 디자인 토큰 (Flutter 앱 기준) ============ */
:root {
  --blue: #3182f6;
  --blue-bg: #eff4ff;
  --ink: #191f28;
  --gray: #6b7684;
  --line: #e5e8eb;
  --fill: #f2f4f6;
  --placeholder: #b0b8c1;
  --red: #f04452;
  --white: #fff;
  --radius: 12px;
  --max-width: 480px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: #e9ecef;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.2px;
}

/* 모바일 프레임 (데스크톱에서는 가운데 정렬) */
.app {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 481px) {
  .app {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  }
}

.hidden { display: none !important; }

/* ============ 뷰 레이아웃 ============ */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.view__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
  -webkit-overflow-scrolling: touch;
}

/* ============ 랜딩 ============ */
.business-info {
  font-size: 13px;
  font-weight: 700;
  color: #000;
  line-height: 1.4;
  white-space: pre-line;
  margin-bottom: 24px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--blue-bg);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}

.headline {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.5px;
}
.subhead {
  margin-top: 12px;
  font-size: 16px;
  color: var(--gray);
  line-height: 1.5;
}

/* 단계 안내 */
.steps { margin-top: 48px; }
.step-item { display: flex; }
.step-item__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 16px;
}
.step-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-item__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step-item__line {
  flex: 1;
  width: 1.5px;
  background: var(--line);
  margin: 6px 0;
}
.step-item__body { padding-top: 8px; padding-bottom: 24px; }
.step-item--last .step-item__body { padding-bottom: 0; }
.step-item__title { font-size: 16px; font-weight: 700; }
.step-item__desc { margin-top: 4px; font-size: 14px; color: var(--gray); line-height: 1.4; }

/* 안내 박스 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 16px;
  background: var(--fill);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}
.notice--top { margin-top: 32px; }
.notice__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  fill: none;
  stroke: var(--gray);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ 랜딩 CTA ============ */
.landing-cta { margin-top: 32px; }

/* ============ 푸터 ============ */
.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--gray);
  line-height: 1.7;
}
.site-footer__row { margin: 0; }
.site-footer__warning {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--fill);
  border-radius: var(--radius);
  font-size: 11px;
  line-height: 1.6;
}
.site-footer__warning p { margin: 0; }
.site-footer__warning p + p { margin-top: 8px; }
.site-footer__warning-em { color: var(--blue); font-weight: 600; }
.site-footer__copyright { margin: 12px 0 0; font-size: 11px; }

/* ============ 하단 바 / 버튼 ============ */
.bottom-bar {
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
}
.btn {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn--sm { height: 52px; font-size: 15px; }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:active { background: #1b64da; }
.btn--primary:disabled {
  background: var(--fill);
  color: var(--placeholder);
  cursor: not-allowed;
}
.btn.is-loading { color: transparent; position: relative; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 앱바 / 진행바 ============ */
.appbar {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  background: var(--white);
  flex-shrink: 0;
}
.appbar__back {
  width: 56px;
  height: 56px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.appbar__back svg {
  width: 20px; height: 20px;
  fill: none; stroke: var(--ink);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.appbar__step {
  margin-left: auto;
  margin-right: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray);
}
.appbar__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--line);
}
.appbar__progress-fill {
  height: 100%;
  width: 33.33%;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
  transition: width 0.3s ease-in-out;
}

/* ============ 폼 ============ */
.form-heading {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin: 12px 0 32px;
}
.field-label {
  display: block;
  margin: 24px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.form-step > .field-label:first-of-type { margin-top: 0; }

.text-field,
.select-field {
  width: 100%;
  background: var(--fill);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}
.text-field::placeholder { color: var(--placeholder); }
.text-field:focus,
.select-field:focus-visible {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}
.text-field.is-error,
.select-field.is-error { border-color: var(--red); }

.select-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}
.select-field__value.placeholder { color: var(--placeholder); }
.select-field__chevron {
  width: 22px; height: 22px;
  fill: none; stroke: var(--gray);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.field-error {
  min-height: 0;
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}
.field-error:empty { display: none; }

/* 칩 (선택지) */
.chip-row { display: flex; gap: 10px; }
.chip {
  flex: 1;
  min-height: 50px;
  padding: 14px 8px;
  background: var(--fill);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chip-row--tall .chip { min-height: 78px; }
.chip.is-selected { background: var(--blue); color: var(--white); }

#sendCodeBtn { margin-top: 12px; }

/* ============ 동의 체크 ============ */
.consent {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.consent input { position: absolute; opacity: 0; pointer-events: none; }
.consent__box {
  width: 22px; height: 22px;
  border: 2px solid var(--placeholder);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.consent__box svg {
  width: 14px; height: 14px;
  fill: none; stroke: var(--white);
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
}
.consent input:checked + .consent__box {
  background: var(--blue);
  border-color: var(--blue);
}
.consent input:checked + .consent__box svg { opacity: 1; }
.consent__text a { color: var(--ink); text-decoration: underline; }

/* ============ 바텀시트 ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.sheet {
  width: 100%;
  max-width: var(--max-width);
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.25s ease-out;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__handle {
  width: 36px; height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 12px auto 0;
}
.sheet__title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  padding: 20px 0;
}
.sheet__divider { height: 1px; background: var(--line); }
.sheet__list { list-style: none; overflow-y: auto; }
.sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 16px;
  cursor: pointer;
}
.sheet__item:active { background: var(--fill); }
.sheet__item.is-selected { color: var(--blue); font-weight: 600; }
.sheet__item svg {
  width: 20px; height: 20px;
  fill: none; stroke: var(--blue);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ============ 다이얼로그 ============ */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 110;
}
.dialog {
  width: 100%;
  max-width: 320px;
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}
.dialog__message { font-size: 15px; color: var(--ink); line-height: 1.5; }
.dialog__confirm {
  margin-top: 16px;
  width: 100%;
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
}
.dialog--success { border-radius: 20px; padding: 28px; }
.dialog__check {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  background: var(--blue-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.dialog__check svg {
  width: 32px; height: 32px;
  fill: none; stroke: var(--blue);
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.dialog__title { font-size: 20px; font-weight: 800; }
.dialog--success .dialog__message { margin-top: 8px; font-size: 14px; color: var(--gray); }
.dialog--success .btn { margin-top: 24px; height: 52px; font-size: 16px; }

/* ============ 토스트 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  max-width: calc(var(--max-width) - 48px);
  width: max-content;
  background: rgba(25, 31, 40, 0.92);
  color: var(--white);
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 120;
  text-align: center;
}
