@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  --bg-cream: #FBEEEC;
  --pink-soft: #F4D3D0;
  --rose: #E3A8A2;
  --rose-dark: #C9827D;
  --rose-deep: #8C4048;
  --ink: #3D2429;
  --ink-soft: #7D5860;
  --ink-faint: #B08A8F;
  --white: #FFFFFF;
  --line: #F0DAD8;
  --danger: #C0392B;
  --success: #4A7A5B;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-display: 'Noto Serif KR', serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-card: 0 1px 2px rgba(61,43,39,0.04), 0 8px 24px rgba(61,43,39,0.06);
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@500;600&display=swap');

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

/* ---------- Top nav ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251,243,236,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--rose-deep);
}
.status-link {
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--white);
}
.status-link:active { transform: scale(0.97); }

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 32px;
  position: relative;
  overflow: hidden;
}
.rotation-mark {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  opacity: 0.5;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--pink-soft);
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: normal;
  color: var(--rose-dark);
}
.hero-sub {
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-soft);
}
.hero-cta {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--rose);
  color: #5C2430;
  width: 100%;
}
.btn-primary:disabled {
  background: var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-text {
  background: none;
  color: var(--rose-deep);
  padding: 10px 0;
  font-size: 14px;
}

/* ---------- Cards / sections ---------- */
section { padding: 28px 0; }
.section-title {
  font-size: 19px;
  margin-bottom: 16px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

/* Round status widget */
.rounds-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.rounds-scroll::-webkit-scrollbar { display: none; }
.round-chip {
  flex: 0 0 auto;
  min-width: 108px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.round-chip.closed { opacity: 0.5; }
.round-chip .gen { font-size: 12px; color: var(--ink-soft); }
.round-chip .date { font-size: 13px; font-weight: 600; margin-top: 4px; }
.round-chip .state {
  font-size: 11px;
  margin-top: 8px;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
}
.round-chip .state.open { background: var(--pink-soft); color: var(--rose-deep); }
.round-chip .state.few { background: #F8DCDA; color: #9C4A44; }
.round-chip .state.closed { background: var(--line); color: var(--ink-faint); }

/* Criteria grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  font-size: 13px;
  color: var(--ink-soft);
}
.mini-card .num {
  font-family: var(--font-display);
  color: var(--rose-dark);
  font-size: 15px;
  margin-bottom: 4px;
  display: block;
}

/* Steps list */
.steps-list { display: flex; flex-direction: column; gap: 0; }
.step-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.step-row:last-child { border-bottom: none; }
.step-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body h4 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.step-body p { font-size: 13px; color: var(--ink-soft); }

/* checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 7px 0;
}
.checklist li::before {
  content: "";
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--pink-soft);
}

/* info table */
.info-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.info-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.info-table td:first-child { color: var(--ink-soft); width: 92px; }
.info-table tr:last-child td { border-bottom: none; }

/* Sticky bottom CTA on landing */
.sticky-cta {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(251,243,236,0) 0%, var(--bg-cream) 30%);
  padding: 20px 20px 24px;
  z-index: 30;
}
.sticky-cta .wrap { padding: 0; }

footer {
  padding: 28px 20px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ================= Application form ================= */
.form-shell { min-height: 100vh; padding-bottom: 40px; }
.progress-wrap { padding: 16px 0 4px; }
.progress-track {
  display: flex;
  gap: 4px;
}
.progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.progress-seg.done { background: var(--rose); }
.progress-label {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.form-step { display: none; padding-top: 8px; }
.form-step.active { display: block; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 6px;
  font-weight: 400;
}
.field .error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}
.field.invalid .error { display: block; }
.field.invalid input,
.field.invalid textarea,
.field.invalid .upload-box { border-color: var(--danger); }

input[type=text], input[type=tel], input[type=number], textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--rose);
}

.pill-select { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pill.selected { background: var(--rose); border-color: var(--rose); color: #5C2430; font-weight: 600; }

.round-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--white);
  cursor: pointer;
}
.round-option.selected { border-color: var(--rose); background: #FBEAEA; }
.round-option.disabled { opacity: 0.45; cursor: not-allowed; }
.round-option .gen { font-weight: 600; font-size: 14px; }
.round-option .meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.round-option .badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--rose-deep);
}
.round-option.disabled .badge { background: var(--line); color: var(--ink-faint); }

.upload-row { display: flex; gap: 10px; }
.upload-box {
  flex: 1;
  aspect-ratio: 1;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload-box .replace-tag {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 10px;
  background: rgba(61,43,39,0.7);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
}

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--white);
}
.consent-row input { width: auto; margin-top: 2px; }
.consent-row p { font-size: 13px; color: var(--ink-soft); }

.step-nav {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.step-nav .btn-ghost { flex: 0 0 88px; }
.step-nav .btn-primary { flex: 1; }

/* OTP block */
.otp-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--white);
  margin-top: 14px;
}
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.otp-row .btn-ghost { flex: 0 0 auto; padding: 12px 14px; font-size: 13px; white-space: nowrap; }
.otp-status { font-size: 12.5px; margin-top: 8px; color: var(--ink-soft); }
.otp-status.success { color: var(--success); }
.otp-status.error { color: var(--danger); }

.auth-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.auth-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
}
.auth-card.selected { border-color: var(--rose); background: #FBEAEA; }
.auth-card .title { font-weight: 600; font-size: 14.5px; }
.auth-card .desc { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.review-card { margin-bottom: 12px; }
.review-card h4 { font-size: 13.5px; margin-bottom: 8px; color: var(--rose-deep); }
.review-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: none; }
.review-row .k { color: var(--ink-soft); flex: 0 0 96px; }
.review-row .v { text-align: right; flex: 1; word-break: break-word; }

.done-screen { text-align: center; padding: 60px 0 40px; }
.done-badge {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--rose-deep);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 26px;
}

@media (max-width: 380px) {
  .hero h1 { font-size: 23px; }
}

/* ================= Admin dashboard ================= */
.wrap-admin {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.admin-login {
  max-width: 360px;
  margin: 80px auto;
  text-align: center;
}
.admin-login .card { text-align: left; margin-top: 20px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.admin-header .brand-mark { font-size: 15px; }
.admin-header .logout { font-size: 12.5px; color: var(--ink-faint); background: none; border: none; cursor: pointer; }

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.round-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: 8px;
}
.round-admin-row .info .label { font-size: 13.5px; font-weight: 600; }
.round-admin-row .info .meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.round-admin-row .count { font-size: 12px; color: var(--rose-deep); margin-top: 2px; }
.toggle-btn {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.toggle-btn.is-open { background: var(--pink-soft); color: var(--rose-deep); border-color: var(--pink-soft); }
.toggle-btn.is-closed { background: var(--line); color: var(--ink-faint); }

.new-round-form {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.new-round-form .field { margin-bottom: 10px; }
.new-round-form .field label { font-size: 12.5px; }

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-row select { width: auto; min-width: 160px; }

.app-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: 10px;
  overflow: hidden;
}
.app-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
}
.app-row-head .name { font-weight: 600; font-size: 14px; }
.app-row-head .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.app-row-head .spacer { flex: 1; }
.status-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-badge.received { background: var(--pink-soft); color: var(--rose-deep); }
.status-badge.selected { background: #DCEBDF; color: var(--success); }
.status-badge.notselected { background: var(--line); color: var(--ink-faint); }

.app-row-body {
  display: none;
  padding: 0 14px 16px;
  border-top: 1px solid var(--line);
}
.app-row.expanded .app-row-body { display: block; }
.app-row.expanded .chevron { transform: rotate(180deg); }
.chevron { transition: transform 0.15s ease; color: var(--ink-faint); }

.app-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
@media (max-width: 560px) {
  .app-detail-grid { grid-template-columns: 1fr; }
}
.detail-block h5 { font-size: 12.5px; color: var(--rose-deep); margin: 0 0 8px; font-weight: 600; }
.detail-row { font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--ink-soft); flex: 0 0 92px; }
.detail-row .v { flex: 1; word-break: break-word; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.photo-grid a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-faint); background: var(--bg-cream); }

.status-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.status-select-row select { width: auto; }
.status-select-row .save-note { font-size: 12px; color: var(--success); display: none; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat-card .num { font-family: var(--font-display); font-size: 22px; color: var(--rose-deep); }
.stat-card .label { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-faint);
  font-size: 13.5px;
}
