/* Toss-style Design System */
:root {
  /* Primary Colors - Toss Blue */
  --toss-blue: #3182f6;
  --toss-blue-light: #4990f7;
  --toss-blue-dark: #1b64da;
  --toss-blue-bg: #e8f3ff;
  --toss-blue-50: #f2f7ff;

  /* Semantic Colors */
  --success: #00c853;
  --success-bg: #e5f9ed;
  --warning: #ff9100;
  --warning-bg: #fff3e0;
  --error: #f44336;
  --error-bg: #ffebee;

  /* Gray Scale - Toss Style */
  --gray-50: #f9fafb;
  --gray-100: #f2f4f6;
  --gray-200: #e5e8eb;
  --gray-300: #d1d6db;
  --gray-400: #b0b8c1;
  --gray-500: #8b95a1;
  --gray-600: #6b7684;
  --gray-700: #4e5968;
  --gray-800: #333d4b;
  --gray-900: #191f28;

  /* Background */
  --bg-primary: #ffffff;
  --bg-secondary: #f2f4f6;
  --bg-tertiary: #e5e8eb;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard Variable', Pretendard, Roboto, 'Noto Sans KR', 'Segoe UI', 'Malgun Gothic', sans-serif;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.16);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-secondary);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-secondary);
  position: relative;
  padding-bottom: 100px;
}

/* Header - Toss Style */
.header {
  background: var(--bg-primary);
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--gray-100);
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--toss-blue);
  letter-spacing: -0.5px;
}

.header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 400;
}

/* Step Indicator - Toss Style */
.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: var(--spacing-md) 0;
  background: var(--bg-secondary);
}

.step {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  transition: all var(--transition-normal);
}

.step.active {
  width: 28px;
  background: var(--toss-blue);
  border-radius: 4px;
}

.step.completed {
  background: var(--toss-blue);
}

/* Section Cards */
.section {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  margin: 0 var(--spacing-md) var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--spacing-lg);
  letter-spacing: -0.5px;
}

/* Notice */
.notice {
  background: var(--toss-blue-bg);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-700);
  margin: 0 var(--spacing-md) var(--spacing-md);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.notice::before {
  content: "i";
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--toss-blue);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Calendar - Toss Style (Modern) */
.calendar {
  width: 100%;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding: 0 var(--spacing-xs);
}

.calendar-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

/* Modern Navigation Buttons - White bg, Black icon */
.calendar-header button {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--gray-200);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--gray-800);
  box-shadow: var(--shadow-sm);
}

.calendar-header button:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
}

.calendar-header button:active {
  transform: scale(0.95);
  box-shadow: none;
}

.calendar-header button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.calendar-header button svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--gray-100);
}

.calendar-weekdays span {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  padding: var(--spacing-sm) 0;
}

.calendar-weekdays span:first-child {
  color: var(--error);
}

.calendar-weekdays span:last-child {
  color: var(--toss-blue);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  color: var(--gray-900);
  position: relative;
  min-height: 48px;
}

.calendar-day:hover:not(:disabled):not(.selected):not(.empty) {
  background: var(--gray-100);
}

.calendar-day:active:not(:disabled):not(.empty) {
  transform: scale(0.92);
}

.calendar-day.today {
  color: var(--toss-blue);
  font-weight: 700;
  background: var(--toss-blue-50);
}

.calendar-day.today::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--toss-blue);
  border-radius: var(--radius-full);
}

.calendar-day.selected {
  background: var(--toss-blue);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.35);
}

.calendar-day.selected.today::after {
  background: white;
}

.calendar-day.disabled {
  color: var(--gray-300);
  cursor: not-allowed;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.sunday:not(.selected):not(.disabled) {
  color: var(--error);
}

.calendar-day.saturday:not(.selected):not(.disabled) {
  color: var(--toss-blue);
}

/* Time Slots - Toss Style */
.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.time-slot {
  padding: 14px 8px;
  text-align: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
  color: var(--gray-800);
}

.time-slot:hover:not(:disabled):not(.selected) {
  border-color: var(--toss-blue);
  background: var(--toss-blue-50);
}

.time-slot:active:not(:disabled) {
  transform: scale(0.96);
}

.time-slot.selected {
  background: var(--toss-blue);
  border-color: var(--toss-blue);
  color: white;
  font-weight: 600;
}

.time-slot:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  border-color: var(--gray-100);
}

/* Selected Info Badge */
.selected-info {
  background: var(--toss-blue-50);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--toss-blue-bg);
}

.selected-info p {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.selected-info strong {
  color: var(--toss-blue);
  font-size: 17px;
  font-weight: 700;
}

/* Form - Toss Style */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--spacing-sm);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  outline: none;
  background: var(--bg-primary);
  color: var(--gray-900);
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--gray-300);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--toss-blue);
  box-shadow: 0 0 0 3px var(--toss-blue-bg);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--gray-400);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-group .error {
  font-size: 13px;
  color: var(--error);
  margin-top: var(--spacing-xs);
}

/* Buttons - Toss Style */
.btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--toss-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--toss-blue-dark);
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

/* Complete Section */
.complete-icon {
  width: 88px;
  height: 88px;
  background: linear-gradient(135deg, var(--success) 0%, #00e676 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-lg);
  box-shadow: 0 8px 24px rgba(0, 200, 83, 0.3);
  animation: success-pop 0.5s ease;
}

@keyframes success-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.complete-icon svg {
  width: 44px;
  height: 44px;
  color: white;
}

.complete-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-sm);
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.complete-message {
  font-size: 15px;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: var(--spacing-xl);
  line-height: 1.7;
}

/* Reservation Summary */
.reservation-summary {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.reservation-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}

.reservation-summary-item:last-child {
  border-bottom: none;
}

.reservation-summary-item .label {
  font-size: 14px;
  color: var(--gray-500);
}

.reservation-summary-item .value {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  gap: var(--spacing-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--toss-blue);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--gray-500);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error Message */
.error-message {
  background: var(--error-bg);
  border: 1px solid #ffcdd2;
  color: var(--error);
  padding: 14px var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.error-message::before {
  content: "!";
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--error);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

.status-badge.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge.confirmed {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge.cancelled {
  background: var(--error-bg);
  color: var(--error);
}

.status-badge.completed {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-gray {
  color: var(--gray-500);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-md);
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: 15px;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 400px) {
  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }

  .calendar-day {
    font-size: 14px;
  }

  .section {
    padding: var(--spacing-md);
    margin: 0 var(--spacing-sm) var(--spacing-sm);
  }
}

/* Safe Area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .container {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Focus Visible for Accessibility */
.btn:focus-visible,
.time-slot:focus-visible,
.calendar-day:focus-visible,
.calendar-nav button:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid var(--toss-blue);
  outline-offset: 2px;
}

/* Selection Color */
::selection {
  background: var(--toss-blue-bg);
  color: var(--toss-blue-dark);
}
