/* =============================================
   호텔 예약 시스템 - 스타일시트
   모바일 우선, 직관적이고 깔끔한 UI
   ============================================= */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
  background-color: #F9FAFB;
  color: #1F2937;
  line-height: 1.6;
  min-height: 100vh;
}

/* === Layout === */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.screen {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Header === */
.header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E5E7EB;
}

.hotel-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1E40AF;
  margin-bottom: 4px;
}

.agency-name {
  font-size: 1.1rem;
  color: #6B7280;
  margin-bottom: 12px;
}

.room-status {
  display: inline-block;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 1.1rem;
  color: #1E40AF;
}

.room-status strong {
  font-size: 1.3rem;
  color: #2563EB;
}

/* === Toggle Switch === */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.toggle-label {
  font-size: 0.85rem;
  color: #9CA3AF;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #D1D5DB;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #EF4444;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* === Nav Links === */
.nav-links {
  display: flex;
  background: #F3F4F6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.nav-link {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #6B7280;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-link.active {
  background: white;
  color: #2563EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: default;
}

/* === Fullroom Notice === */
.fullroom-notice {
  text-align: center;
  padding: 40px 20px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 12px;
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

.fullroom-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.fullroom-notice p {
  font-size: 1.2rem;
  font-weight: 600;
  color: #DC2626;
}

.fullroom-sub {
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: #9CA3AF !important;
  margin-top: 8px;
}

/* === Step Indicator === */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 20px;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E5E7EB;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.3s;
  flex-shrink: 0;
}

.step-dot.active {
  background: #2563EB;
  color: white;
}

.step-dot.done {
  background: #10B981;
  color: white;
}

.step-line {
  flex: 1;
  height: 3px;
  background: #E5E7EB;
  min-width: 20px;
}

/* === Step Sections === */
.step-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-section.active {
  display: block;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 20px;
  text-align: center;
}

/* === Card Buttons (Step 1: 선불/후불) === */
.card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.card-btn:active {
  transform: scale(0.97);
}

.card-btn-icon {
  font-size: 2rem;
}

.card-btn-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #374151;
}

.card-btn-desc {
  font-size: 0.9rem;
  color: #9CA3AF;
}

.card-btn-check {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.2rem;
  color: white;
  background: #2563EB;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  line-height: 26px;
  text-align: center;
}

.card-btn.selected {
  border-color: #2563EB;
  background: #EFF6FF;
  box-shadow: 0 0 0 1px #2563EB;
}

.card-btn.selected .card-btn-check {
  display: block;
}

/* === Room Grid (Step 2) === */
.room-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.room-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  font-size: 1.25rem;
  font-weight: 700;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
  -webkit-tap-highlight-color: transparent;
}

.room-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.room-btn.selected {
  background: #2563EB;
  border-color: #2563EB;
  color: white;
}

.room-btn:disabled {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #D1D5DB;
  cursor: not-allowed;
}

/* === Time Buttons (Step 3) === */
.time-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  color: #374151;
  -webkit-tap-highlight-color: transparent;
}

.time-btn:active {
  transform: scale(0.98);
}

.time-btn.selected {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1E40AF;
  box-shadow: 0 0 0 1px #2563EB;
}

/* === Time Warning === */
.time-warning {
  margin-top: 14px;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
}

.time-warning p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #DC2626;
  line-height: 1.5;
}

/* === Summary Card === */
.summary-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.summary-row:not(:last-child) {
  border-bottom: 1px solid #F3F4F6;
}

.summary-label {
  font-size: 1rem;
  color: #6B7280;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1F2937;
}

/* === Buttons === */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  background: #2563EB;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  background: #1D4ED8;
}

.btn-reserve {
  margin-top: 8px;
  padding: 18px;
  font-size: 1.3rem;
}

.btn-danger {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  background: #EF4444;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-danger:active {
  background: #DC2626;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #374151;
  background: #F3F4F6;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:active {
  background: #E5E7EB;
}

.btn-copy {
  padding: 10px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #2563EB;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-copy:active {
  background: #DBEAFE;
}

.btn-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 1rem;
  color: #6B7280;
  text-decoration: underline;
  cursor: pointer;
}

/* === Complete Screen === */
.complete-card {
  text-align: center;
  padding: 20px 0;
}

.complete-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.complete-card h1,
.complete-card h2 {
  font-size: 1.4rem;
  color: #1F2937;
  margin-bottom: 24px;
}

.reservation-number-wrap {
  background: #F0FDF4;
  border: 2px solid #86EFAC;
  border-radius: 12px;
  padding: 24px 16px;
  margin-bottom: 20px;
}

.reservation-label {
  font-size: 0.95rem;
  color: #6B7280;
  margin-bottom: 8px;
}

.reservation-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: 3px;
  margin-bottom: 12px;
  font-family: 'Courier New', monospace;
}

.capture-notice {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
}

.capture-notice p {
  font-size: 1.05rem;
  font-weight: 600;
  color: #92400E;
}

/* === Cancel Screen === */
.cancel-section {
  margin-top: 8px;
}

.input-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.input-field {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  border: 2px solid #D1D5DB;
  border-radius: 10px;
  outline: none;
  text-transform: uppercase;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  text-align: center;
}

.input-field:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field::placeholder {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #9CA3AF;
}

.error-msg {
  color: #DC2626;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
}

.cancel-done-number {
  font-size: 1.2rem;
  color: #6B7280;
  margin-top: 8px;
}

/* === Reservation List (Cancel Page) === */
.list-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #E5E7EB;
}

.reservation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.res-list-item:active {
  transform: scale(0.98);
}

.res-list-item:hover {
  border-color: #2563EB;
  background: #EFF6FF;
}

.res-list-id {
  font-size: 1.15rem;
  font-weight: 800;
  color: #059669;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.res-list-detail {
  font-size: 0.9rem;
  color: #6B7280;
  text-align: right;
}

.res-list-detail span {
  display: block;
}

.reservation-list-empty {
  text-align: center;
  padding: 20px;
  color: #9CA3AF;
  font-size: 1rem;
}

/* === Invalid Screen === */
.invalid-card {
  text-align: center;
  padding: 60px 20px;
}

.invalid-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.invalid-card h1 {
  font-size: 1.4rem;
  color: #374151;
  margin-bottom: 12px;
}

.invalid-card p {
  font-size: 1.05rem;
  color: #9CA3AF;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.modal h2 {
  font-size: 1.2rem;
  color: #1F2937;
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.95rem;
  color: #6B7280;
  margin-bottom: 24px;
}

.modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-buttons .btn-secondary,
.modal-buttons .btn-danger {
  padding: 14px 10px;
  font-size: 1rem;
}

/* === Responsive === */
@media (min-width: 480px) {
  .container {
    padding: 32px 24px 48px;
  }

  .room-btn {
    height: 60px;
  }
}

@media (max-width: 360px) {
  .room-grid {
    gap: 6px;
  }

  .room-btn {
    height: 48px;
    font-size: 1.1rem;
  }

  .card-buttons {
    gap: 8px;
  }

  .card-btn {
    padding: 18px 12px;
  }
}
