/**
 * 维修预约界面 - 温暖木质工坊风格
 * 设计理念：如同走进一间手工吉他工坊，温暖、自然、值得信赖
 */

/* ========================================
   Booking Page — Override to Light Theme
   ======================================== */

/* Override body background for the booking page only via specificity */
body:has(.booking) {
  background: #f6f1eb;
}

body:has(.booking) .main {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212,175,55,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139,90,43,0.05) 0%, transparent 50%),
    #f6f1eb;
}

/* Override header for booking page — warm dark instead of pure black */
body:has(.booking) .header {
  background: linear-gradient(180deg, #2c2418 0%, #1f1a13 100%);
  border-bottom-color: #c9a836;
}

/* Override footer for booking page */
body:has(.booking) .footer {
  background: linear-gradient(180deg, #2c2418 0%, #1f1a13 100%);
  border-top-color: #c9a836;
}

/* ========================================
   预约页面容器
   ======================================== */
.booking {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* 页面标题区域 */
.booking__title {
  font-family: 'LXGW WenKai TC', cursive;
  font-size: 2.25rem;
  font-weight: 700;
  color: #3d2b1f;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  text-transform: none;
  position: relative;
}

.booking__title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #c9a836, #8b5a2b);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

.booking__description {
  font-size: 1rem;
  color: #7a6b5d;
  text-align: center;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

/* ========================================
   表单容器
   ======================================== */
.booking__form {
  background: #ffffff;
  border: 1px solid #e2d9ce;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow:
    0 1px 3px rgba(60,40,20,0.04),
    0 8px 32px rgba(60,40,20,0.06);
  position: relative;
  overflow: hidden;
}

/* 顶部装饰线 — 木纹金色渐变 */
.booking__form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5a2b 0%, #c9a836 40%, #d4af37 60%, #8b5a2b 100%);
}

/* ========================================
   表单分组
   ======================================== */
.form-group {
  margin-bottom: 1.75rem;
  position: relative;
  animation: formItemReveal 0.5s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.03s; }
.form-group:nth-child(2) { animation-delay: 0.06s; }
.form-group:nth-child(3) { animation-delay: 0.09s; }
.form-group:nth-child(4) { animation-delay: 0.12s; }
.form-group:nth-child(5) { animation-delay: 0.15s; }
.form-group:nth-child(6) { animation-delay: 0.18s; }
.form-group:nth-child(7) { animation-delay: 0.21s; }
.form-group:nth-child(8) { animation-delay: 0.24s; }
.form-group:nth-child(9) { animation-delay: 0.27s; }
.form-group:nth-child(10) { animation-delay: 0.30s; }
.form-group:nth-child(11) { animation-delay: 0.33s; }

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

/* 标签 */
.form-group__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #3d2b1f;
  margin-bottom: 0.625rem;
  letter-spacing: 0.01em;
}

/* 必填星号 */
.form-group__required {
  color: #c9a836;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* 选填标签 — 与标签同行 */
.form-group__optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: #a89a8c;
  background: #f6f1eb;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
  letter-spacing: 0.02em;
}

/* ========================================
   输入控件
   ======================================== */
.form-group__input,
.form-group__textarea,
.form-group__select {
  width: 100%;
  padding: 0.8125rem 1rem;
  background: #faf8f5;
  border: 1.5px solid #ddd3c6;
  border-radius: 10px;
  color: #2c2418;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* 聚焦 */
.form-group__input:focus,
.form-group__textarea:focus,
.form-group__select:focus {
  outline: none;
  border-color: #c9a836;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201,168,54,0.12);
}

/* 悬停 */
.form-group__input:hover:not(:focus),
.form-group__textarea:hover:not(:focus),
.form-group__select:hover:not(:focus) {
  border-color: #c4b8a6;
  background: #fdfcfa;
}

/* Placeholder */
.form-group__input::placeholder,
.form-group__textarea::placeholder {
  color: #b8aa9a;
  font-style: normal;
}

/* Textarea */
.form-group__textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.75;
}

/* Select */
.form-group__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b5a2b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 18px;
  padding-right: 2.75rem;
}

.form-group__select option {
  background: #ffffff;
  color: #2c2418;
  padding: 0.5rem;
}

/* ========================================
   文件上传
   ======================================== */
.form-group__input[type="file"] {
  padding: 1rem;
  cursor: pointer;
  border-style: dashed;
  border-color: #d4c9ba;
  background: #fdfbf8;
}

.form-group__input[type="file"]:hover {
  border-color: #c9a836;
  background: #faf6ef;
}

.form-group__input[type="file"]::file-selector-button {
  padding: 0.4375rem 1.125rem;
  background: linear-gradient(135deg, #c9a836, #b4942e);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 0.75rem;
}

.form-group__input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, #b4942e, #9a7e24);
  box-shadow: 0 2px 6px rgba(180,148,46,0.3);
}

/* 图片预览容器 */
.form-group__preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.875rem;
}

/* ========================================
   日期输入
   ======================================== */
.form-group__input[type="date"] {
  position: relative;
  cursor: pointer;
}

/* ========================================
   时间段选择器
   ======================================== */
.time-slots {
  margin-top: 0.625rem;
}

.time-slots__hint {
  text-align: center;
  color: #a89a8c;
  font-size: 0.9375rem;
  padding: 1.25rem;
  background: #faf8f5;
  border-radius: 10px;
  border: 1.5px dashed #ddd3c6;
}

/* 时间段列表 */
.time-slots__grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 时间段卡片 */
.time-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2d9ce;
  border-radius: 10px;
  background: #faf8f5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-slot:hover {
  border-color: #c9a836;
  background: #fdf9f0;
  box-shadow: 0 2px 8px rgba(201,168,54,0.1);
  transform: translateY(-1px);
}

.time-slot--selected {
  border-color: #c9a836;
  background: linear-gradient(135deg, #c9a836, #b4942e);
  box-shadow: 0 3px 12px rgba(201,168,54,0.25);
}

.time-slot--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f0ece6;
  border-color: #e2d9ce;
}

.time-slot--disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #e2d9ce;
  background: #f0ece6;
}

.time-slot__time {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #3d2b1f;
}

.time-slot--selected .time-slot__time {
  color: #ffffff;
}

.time-slot__status {
  display: inline-block;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.time-slot__status--idle {
  background: rgba(16,185,129,0.12);
  color: #059669;
}

.time-slot__status--normal {
  background: rgba(245,158,11,0.12);
  color: #d97706;
}

.time-slot__status--busy {
  background: rgba(239,68,68,0.12);
  color: #dc2626;
}

.time-slot--selected .time-slot__status {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* ========================================
   提示文本
   ======================================== */
.form-group__hint {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: #a89a8c;
  line-height: 1.5;
}

.form-group__hint::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a89a8c'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
  flex-shrink: 0;
}

/* 错误提示 */
.form-group__error {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: #dc2626;
  font-weight: 500;
}

.form-group__error:not(:empty) {
  animation: errorShake 0.35s ease-in-out;
}

.form-group__error:empty::before {
  display: none;
}

.form-group__error::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23dc2626'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
  flex-shrink: 0;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* ========================================
   复选框
   ======================================== */
.form-group__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 1rem 1.125rem;
  background: #faf8f5;
  border: 1.5px solid #e2d9ce;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.form-group__checkbox:hover {
  background: #fdf9f0;
  border-color: #c9a836;
}

.form-group__checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  accent-color: #c9a836;
  margin-top: 1px;
}

.form-group__checkbox span {
  font-size: 0.9375rem;
  color: #5c4d3e;
  line-height: 1.6;
}

.form-group__link {
  color: #8b5a2b;
  text-decoration: underline;
  text-decoration-color: rgba(139,90,43,0.3);
  text-underline-offset: 2px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.form-group__link:hover {
  color: #c9a836;
  text-decoration-color: #c9a836;
}

/* ========================================
   按钮区域
   ======================================== */
.booking__actions {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e8e0d4;
}

.booking__actions .button {
  min-width: 180px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 10px;
  text-transform: none;
}

.booking__actions .button--primary {
  background: linear-gradient(135deg, #c9a836 0%, #a88a28 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(201,168,54,0.25);
  position: relative;
  overflow: hidden;
}

.booking__actions .button--primary::before {
  display: none;
}

.booking__actions .button--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.booking__actions .button--primary:hover::after {
  left: 100%;
}

.booking__actions .button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(201,168,54,0.35);
  background: linear-gradient(135deg, #b4942e 0%, #9a7e24 100%);
}

.booking__actions .button--secondary {
  background: transparent;
  border: 1.5px solid #c4b8a6;
  color: #7a6b5d;
}

.booking__actions .button--secondary::before {
  display: none;
}

.booking__actions .button--secondary:hover {
  background: #f6f1eb;
  border-color: #8b5a2b;
  color: #3d2b1f;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(60,40,20,0.08);
}

/* ========================================
   状态消息
   ======================================== */
.booking__status {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  animation: statusSlideIn 0.35s ease-out;
}

.booking__status--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.booking__status--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.booking__status--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

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

/* ========================================
   面包屑导航
   ======================================== */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.8125rem;
  color: #a89a8c;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb__item:not(:last-child)::after {
  content: '/';
  color: #c4b8a6;
  font-weight: 400;
}

.breadcrumb__item a {
  color: #7a6b5d;
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb__item a:hover {
  color: #8b5a2b;
}

.breadcrumb__item[aria-current="page"] {
  color: #3d2b1f;
  font-weight: 600;
}

/* ========================================
   响应式 — PC 大屏
   ======================================== */
@media (min-width: 1024px) {
  .booking {
    max-width: 820px;
    padding: 3.5rem 2rem 5rem;
  }

  .booking__form {
    padding: 3rem 2.5rem;
  }
}

@media (min-width: 1200px) {
  .booking {
    max-width: 880px;
  }

  .booking__title {
    font-size: 2.75rem;
  }

  .booking__description {
    font-size: 1.0625rem;
  }

  .form-group__input,
  .form-group__textarea,
  .form-group__select {
    font-size: 1.0625rem;
    padding: 0.9375rem 1.125rem;
  }

  .booking__actions .button {
    min-width: 200px;
    padding: 1rem 2.5rem;
  }
}

/* ========================================
   加载状态
   ======================================== */
.booking__form--loading {
  pointer-events: none;
  opacity: 0.5;
  position: relative;
}

.booking__form--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e2d9ce;
  border-top-color: #c9a836;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ========================================
   响应式 — 移动端
   ======================================== */
@media (max-width: 768px) {
  .booking {
    max-width: 100%;
    padding: 1.5rem 1rem 3rem;
  }

  .booking__title {
    font-size: 1.625rem;
    margin-bottom: 0.375rem;
  }

  .booking__title::after {
    width: 40px;
    height: 2px;
    margin-top: 0.5rem;
  }

  .booking__description {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .booking__form {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }

  .form-group {
    margin-bottom: 1.375rem;
  }

  .form-group__label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  .form-group__input,
  .form-group__textarea,
  .form-group__select {
    font-size: 16px;
    padding: 0.6875rem 0.875rem;
  }

  .form-group__textarea {
    min-height: 100px;
  }

  .form-group__hint,
  .form-group__error {
    font-size: 0.75rem;
  }

  .form-group__checkbox {
    padding: 0.75rem 0.875rem;
  }

  .form-group__checkbox span {
    font-size: 0.875rem;
  }

  .booking__actions {
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
  }

  .booking__actions .button {
    width: 100%;
    min-width: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }

  .time-slot {
    padding: 0.6875rem 0.875rem;
  }

  .time-slot__time {
    font-size: 0.875rem;
  }

  .time-slot__status {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
  }

  .form-group__preview-container {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .booking {
    padding: 1.25rem 0.75rem 2.5rem;
  }

  .booking__title {
    font-size: 1.375rem;
  }

  .booking__form {
    padding: 1.25rem 1rem;
  }

  .form-group {
    margin-bottom: 1.125rem;
  }

  .form-group__input,
  .form-group__textarea,
  .form-group__select {
    padding: 0.625rem 0.75rem;
  }

  .booking__actions .button {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  .time-slot {
    padding: 0.5625rem 0.75rem;
  }

  .time-slot__time {
    font-size: 0.8125rem;
  }

  .time-slot__status {
    font-size: 0.625rem;
    padding: 0.0625rem 0.375rem;
  }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
  .booking__form {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .booking__form::before {
    display: none;
  }

  .booking__actions,
  .form-group__hint {
    display: none;
  }

  .form-group__input,
  .form-group__textarea,
  .form-group__select {
    border: 1px solid #999;
    background: white;
    color: #000;
  }
}
