:root {
  --bg-primary: #fdfbf7;
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-card: rgba(146, 64, 14, 0.08);
  --text-primary: #451a03;
  --text-secondary: #78350f;
  
  --primary-color: #d97706;
  --primary-hover: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.15);

  --accent-color: #ca8a04;
  --accent-glow: rgba(202, 138, 4, 0.15);
  
  --danger-color: #e11d48;
  --success-color: #059669;
  --warning-color: #ca8a04;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 背景動態漸變光暈 */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  mix-blend-mode: multiply;
}

.orb-1 {
  background: var(--primary-color);
  width: 500px;
  height: 500px;
  top: -100px;
  left: -100px;
  animation: orb-float 20s infinite alternate ease-in-out;
}

.orb-2 {
  background: var(--accent-color);
  width: 600px;
  height: 600px;
  bottom: -150px;
  right: -100px;
  animation: orb-float 25s infinite alternate-reverse ease-in-out;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

/* 容器與版面佈局 */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 未授權 Banner */
.banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  animation: fadeIn 0.5s ease;
}

.banner.hidden {
  display: none !important;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #78350f;
}

.icon-warning {
  color: var(--warning-color);
  flex-shrink: 0;
}

/* 頁首 */
.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  margin-bottom: 12px;
}

.logo-img {
  height: 270px;
  width: auto;
  object-fit: contain;
  margin-bottom: -60px;
}

.logo h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #78350f 30%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* 玻璃擬物風卡片 */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.main-card {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 步驟區域 */
.step-section {
  transition: opacity 0.3s ease;
}

.step-section.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.step-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.section-title h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

/* 第一步排版 */
.datetime-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .datetime-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.timezone-text {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 輸入框包裝 */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.textarea-icon {
  top: 16px;
}

/* 統一的輸入欄位樣式 */
input[type="date"],
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 20px;
}

select option {
  background-color: #ffffff;
  color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
  background: #ffffff;
}

input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 日曆特定樣式調整 */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.2);
  cursor: pointer;
}

/* 時段狀態 */
.slots-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 20px;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.status-icon {
  width: 18px;
  height: 18px;
}

/* 時段網格 */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .slots-grid {
    grid-template-columns: 1fr;
  }
}

.slots-grid.hidden {
  display: none !important;
}

/* 時段按鈕 */
.slot-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.slot-btn:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.slot-btn.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.slot-btn:disabled {
  opacity: 0.4;
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.04);
  cursor: not-allowed;
  text-decoration: line-through;
  color: var(--text-secondary);
  box-shadow: none;
}

.slot-status-label {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

/* 第二步表單排版 */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .full-width {
    grid-column: span 1;
  }
}

/* 按鈕樣式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  position: relative;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-warning {
  background: var(--warning-color);
  color: #000;
}

.btn-warning:hover {
  background: #d97706;
}

/* Spinner 載入中動畫 */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* 頁尾 */
.app-footer {
  text-align: center;
  padding-top: 40px;
  color: #4b5563;
  font-size: 0.85rem;
}

/* 彈窗樣式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
}

.modal-header h2 {
  margin-top: 15px;
  font-size: 1.5rem;
  font-weight: 800;
}

.success-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.2));
}

.icon-success {
  color: var(--success-color);
  width: 30px;
  height: 30px;
}

.modal-body {
  margin: 20px 0;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.booking-summary-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 15px;
  text-align: left;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-val {
  font-weight: 600;
  color: var(--primary-color);
}

.modal-notice {
  font-size: 0.8rem !important;
  color: #6b7280 !important;
}

/* Animations */
.animate-pop {
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
