:root {
  --black: #000000;
  --white: #ffffff;
  --gray-900: #0a0a0c;
  --gray-800: #131316;
  --gray-700: #1c1c20;
  --gray-500: #6b6b72;
  --gray-400: #8a8a92;
  --gray-300: #b5b5bc;
  --gray-200: #d8d8dd;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --t: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.wrap { max-width: 640px; margin: 0 auto; padding: 64px 24px 100px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; margin-bottom: 48px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--white); color: var(--black); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; }

.page-title { font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.page-desc { font-size: 14px; color: var(--gray-400); line-height: 1.7; margin-bottom: 40px; }

.slot-date-group { margin-bottom: 28px; }
.slot-date-label { font-size: 13px; font-weight: 700; color: var(--gray-300); margin-bottom: 10px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-btn {
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.slot-btn:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); }
.slot-btn.is-selected { background: var(--white); color: var(--black); border-color: var(--white); }

.empty-state { font-size: 13.5px; color: var(--gray-500); padding: 32px 0; text-align: center; border: 1px dashed var(--glass-border); border-radius: var(--radius-md); }

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 24px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--gray-300); }
.field input, .field select {
  background: var(--gray-800);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--glass-border-hover); }
.field-hint { font-weight: 400; color: var(--gray-500); font-size: 11.5px; }
.field input[type="file"] {
  padding: 9px 13px;
  color: var(--gray-300);
  font-size: 13px;
}
.field input[type="file"]::file-selector-button {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--white);
  font-size: 12.5px;
  font-family: var(--font);
  padding: 6px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover { background: var(--glass-bg-hover); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity var(--t);
}
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--gray-400); border: 1px solid var(--glass-border); }
.btn-ghost:hover { color: var(--white); border-color: var(--glass-border-hover); }

.status-msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.status-msg.is-error { color: #ff6b6b; }
.status-msg.is-success { color: #57d18d; }

.success-box { text-align: center; padding: 40px 20px; }
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--white); color: var(--black); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 24px; }
.success-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.success-desc { font-size: 13.5px; color: var(--gray-400); line-height: 1.7; }

/* --- admin --- */
.login-avatar {
  width: 56px;
  height: 56px;
  margin: 90px auto 14px;
  opacity: 0;
  transform: translateY(10px) scale(0.6);
  animation: heroAvatarIn 0.6s cubic-bezier(.34, 1.56, .64, 1) 0.1s forwards;
}
.login-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-800);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.login-greet { text-align: center; font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.login-box { max-width: 360px; margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; gap: 12px; flex-wrap: wrap; }
.admin-header > div { display: flex; gap: 8px; }
.admin-header .btn-ghost { width: auto; padding: 8px 16px; font-size: 12.5px; }
.slot-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
.slot-table th, .slot-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--glass-border); }
.slot-table th { color: var(--gray-500); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-open { background: rgba(255,255,255,0.1); color: var(--gray-200); }
.badge-booked { background: rgba(87, 209, 141, 0.15); color: #57d18d; }
.row-actions { display: flex; gap: 6px; }
.icon-btn { background: none; border: none; color: var(--gray-500); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.icon-btn:hover { color: #ff6b6b; }
.add-slot-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; }
.add-slot-form .field { margin-bottom: 0; }
.add-slot-form .btn { grid-column: span 3; }
@media (max-width: 560px) { .add-slot-form { grid-template-columns: 1fr; } .add-slot-form .btn { grid-column: span 1; } }

.selected-date-chip { background: var(--gray-800); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-date-chip.is-active { color: var(--white); font-weight: 700; border-color: var(--glass-border-hover); }

/* --- calendar --- */
.calendar { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 24px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-size: 15px; font-weight: 800; }
.cal-nav-btn { width: 30px; height: 30px; border-radius: 8px; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; font-family: var(--font); transition: background var(--t), border-color var(--t); }
.cal-nav-btn:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--gray-500); padding: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--white); background: transparent; border: 1px solid transparent; cursor: pointer; transition: background var(--t), border-color var(--t); }
.cal-day:hover:not(.is-disabled):not(.is-outside) { background: var(--glass-bg-hover); }
.cal-day.is-outside { color: transparent; cursor: default; pointer-events: none; }
.cal-day.is-disabled { color: var(--gray-500); opacity: 0.35; cursor: not-allowed; }
.cal-day.is-today { border-color: var(--glass-border-hover); }
.cal-day.is-selected { background: var(--white); color: var(--black); }
.cal-day.has-slots::after { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #57d18d; }
.cal-day.is-selected.has-slots::after { background: var(--black); }
.cal-empty-hint { font-size: 12.5px; color: var(--gray-500); text-align: center; padding: 10px 2px 0; }

/* --- hero team strip --- */
.hero-team {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 34px;
}
.hero-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  opacity: 0;
  cursor: pointer;
  transform: translateY(10px) scale(0.6);
  animation: heroAvatarIn 0.55s cubic-bezier(.34, 1.56, .64, 1) forwards, heroAvatarBob 3.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.09s), calc(0.8s + var(--i) * 0.2s);
  transition: transform var(--t);
}
.hero-avatar:hover, .hero-avatar:focus-visible { transform: translateY(-3px); outline: none; }
.hero-avatar--mid { width: 44px; height: 44px; }
.hero-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-800);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.hero-avatar-name {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--gray-500);
  white-space: nowrap;
}
.hero-avatar.is-guide .hero-avatar-name { color: #57d18d; font-weight: 700; }
@keyframes heroAvatarIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroAvatarBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.hero-avatar.is-guide { z-index: 2; }
.hero-avatar.is-guide img { animation: guidePulse 2.4s ease-in-out infinite; }
@keyframes guidePulse {
  0%, 100% { box-shadow: 0 0 0 2px #57d18d, 0 0 0 0 rgba(87, 209, 141, 0.45), 0 6px 14px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 0 2px #57d18d, 0 0 0 7px rgba(87, 209, 141, 0.12), 0 6px 14px rgba(0, 0, 0, 0.5); }
}
.hero-caption {
  text-align: center;
  font-size: 13px;
  color: var(--gray-300);
  margin: 0 auto 34px;
  min-height: 2.6em;
  max-width: 300px;
  line-height: 1.5;
}
.hero-caption .typing-cursor { display: inline-block; width: 2px; height: 12px; background: #57d18d; margin-left: 2px; vertical-align: -1px; animation: cursorBlink 0.8s steps(1) infinite; }
@keyframes cursorBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* --- step indicator --- */
.steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 28px; }
.step { display: flex; align-items: center; gap: 6px; }
.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.step-label { font-size: 11.5px; color: var(--gray-500); font-weight: 600; transition: color var(--t); }
.step-line { width: 20px; height: 1px; background: var(--glass-border); }
.step.is-active .step-dot { background: var(--white); color: var(--black); border-color: var(--white); }
.step.is-active .step-label { color: var(--white); }
.step.is-done .step-dot { background: rgba(87, 209, 141, 0.15); color: #57d18d; border-color: rgba(87, 209, 141, 0.3); }
.step.is-done .step-label { color: var(--gray-300); }
@media (max-width: 420px) { .step-label { display: none; } }

/* --- reveal transitions --- */
#slotsContainer, #formCard { animation: revealUp 0.35s ease both; }
@keyframes revealUp { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
.cal-day:active:not(.is-disabled):not(.is-outside) { transform: scale(0.88); }

/* --- celebration success view --- */
.firework-field { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.firework-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.65);
  opacity: 0;
  animation: sparkBurst 1.4s cubic-bezier(.1, .6, .3, 1) forwards;
}
@keyframes sparkBurst {
  0% { transform: translate(0, 0) scale(1.3); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.welcome-team {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin: 4px auto 34px;
}
.welcome-avatar {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  opacity: 0;
  transform: rotateY(100deg) translateY(18px) scale(0.4);
  animation:
    avatarComeAlive 0.7s cubic-bezier(.34, 1.56, .64, 1) forwards,
    avatarBob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s), calc(1s + var(--i) * 0.22s);
}
.welcome-avatar--center { width: 64px; height: 64px; }
.welcome-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-800);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 10px 22px rgba(0, 0, 0, 0.55);
}
.welcome-avatar-name {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--gray-500);
  white-space: nowrap;
}
@keyframes avatarComeAlive {
  0% { opacity: 0; transform: rotateY(100deg) translateY(18px) scale(0.4); }
  55% { opacity: 1; transform: rotateY(-14deg) translateY(-6px) scale(1.08); }
  100% { opacity: 1; transform: rotateY(0deg) translateY(0) scale(1); }
}
@keyframes avatarBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.success-box { position: relative; z-index: 2; }
.success-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .firework-field { display: none; }
  .welcome-avatar, .hero-avatar { animation: none; opacity: 1; transform: none; }
}
