:root {
  --max-width: 480px;
  --gold: #ffc000;
  --blue: #4a4ae0;
  --border: #d9d9df;
  --text-muted: #9a9aa3;
  --danger: #e0432a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Malgun Gothic", sans-serif;
  background: #f3f3f6;
  color: #1c1c22;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
}

.hero {
  width: 100%;
  display: block;
}

.bottom-bar-spacer {
  height: 72px;
}

/* 하단 고정 신청 바 (이미지 버튼) */
.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  border: none;
  background: none;
  padding: 0;
  line-height: 0;
  cursor: pointer;
  z-index: 30;
}

.bottom-bar img {
  width: 100%;
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

/* 바텀시트 */
.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--max-width);
  max-height: 88vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease-out;
  overflow: hidden;
}

.bottom-sheet.is-open {
  transform: translate(-50%, 0);
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 0;
  flex: 0 0 auto;
}

.bottom-sheet__view {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 4px 20px 28px;
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  position: sticky;
  top: 0;
  background: #fff;
}

.bottom-sheet__header h2 {
  font-size: 19px;
  margin: 0;
}

.bottom-sheet__close {
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.apply-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 14px;
  font-weight: 700;
}

.required { color: var(--danger); }

input[type="text"],
input[type="tel"],
input[type="date"] {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  width: 100%;
  background: #fff;
}

input[readonly] {
  background: #f7f7fa;
  color: #6b6b75;
}

.field__detail {
  margin-top: 0;
}

#childBirthPicker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.address-row input { flex: 1; }

.btn-secondary {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.gender-row {
  display: flex;
  gap: 10px;
}

.gender-btn {
  flex: 1;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #1c1c22;
}

.gender-btn.is-selected {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.consent-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.consent-row--all {
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.consent-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.consent-row span { flex: 1; }

.tag {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

.tag--required { color: var(--danger); }
.tag--optional { color: var(--text-muted); }

.consent-view {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  color: #4a4a55;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.btn-submit {
  height: 50px;
  border: none;
  border-radius: 10px;
  background: var(--gold);
  font-size: 16px;
  font-weight: 700;
  color: #1c1c22;
  cursor: pointer;
  margin-top: 8px;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 완료 화면 */
.bottom-sheet__view--done {
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 360px;
  padding-top: 40px;
}

.done-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: #1c1c22;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.bottom-sheet__view--done h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.bottom-sheet__view--done p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.bottom-sheet__view--done .btn-submit {
  width: 100%;
}

/* 약관 보기 팝업 */
.consent-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 420px;
  height: 70vh;
  background: #fff;
  border-radius: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.consent-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.consent-popup__header h3 {
  font-size: 16px;
  margin: 0;
}

.consent-popup__frame {
  flex: 1;
  border: none;
  width: 100%;
}
