/**
 * AiDrumScore - AI驱动的鼓谱转录工具
 * Copyright (c) 2026 苏州市常熟市制谱修修信息技术服务有限责任公司. All rights reserved.
 *
 * 定制鼓谱下单页面样式 (Notion warm minimalism)
 */

/* ── Page Layout ── */
.custom-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

.custom-header {
  text-align: center;
  margin-bottom: 48px;
}

.custom-header h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.custom-header p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Tier Cards ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
  align-items: start;
}

.tier-card {
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-default, rgba(0,0,0,0.1));
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.tier-card:hover {
  border-color: var(--accent-primary, #0075de);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 117, 222, 0.15);
}

.tier-card.selected {
  border-color: var(--accent-primary, #0075de);
  border-width: 2.5px;
  box-shadow: 0 8px 30px rgba(0, 117, 222, 0.18), 0 0 0 3px rgba(0, 117, 222, 0.08);
}

/* 推荐档位（标准版）高亮 */
.tier-card:nth-child(2) {
  border-color: rgba(0, 117, 222, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, rgba(0, 117, 222, 0.02) 100%);
}

.tier-card.selected::after {
  content: '✓';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  background: var(--accent-primary, #0075de);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 117, 222, 0.35);
}

.tier-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.tier-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary, #111);
  margin-bottom: 6px;
  line-height: 1.1;
}

.tier-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.tier-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
  min-height: 40px;
}

.tier-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tier-features li {
  font-size: 13px;
  color: var(--text-primary, #333);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.tier-features li::before {
  content: '✓';
  color: var(--success, #22c55e);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Order Form ── */
.custom-form {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.custom-form h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary, #f6f5f4);
  border: 1px solid #dddddd;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary, #0075de);
  box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.12);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
  appearance: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Options Toggles ── */
.options-section {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

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

.option-toggle + .option-toggle {
  border-top: 1px solid var(--border-default, rgba(0,0,0,0.06));
}

.option-info {
  flex: 1;
}

.option-info .option-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.option-info .option-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-primary, #0075de);
}

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

/* ── Price Summary ── */
.price-summary {
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--accent-primary, #0075de);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  margin-bottom: 24px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.price-row.total {
  border-top: 1px solid var(--border-default, rgba(0,0,0,0.06));
  margin-top: 8px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-row .price-value {
  font-weight: 600;
}

.price-row.total .price-value {
  font-size: 24px;
  color: var(--accent-primary, #0075de);
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent-primary, #0075de);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 117, 222, 0.3);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Payment Modal ── */
.payment-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.payment-modal-overlay.active {
  display: flex;
}

.payment-modal {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: modalFadeIn 0.3s ease;
}

.payment-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.payment-modal .pm-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.qr-container {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.qr-container img {
  max-width: 100%;
  max-height: 100%;
}

.pm-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-primary, #0075de);
  margin-bottom: 4px;
}

.pm-expiry {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions button {
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  color: var(--text-secondary);
}

.btn-cancel:hover {
  border-color: var(--text-secondary);
}

/* ── Success / Status ── */
.status-section {
  text-align: center;
  padding: 40px 20px;
}

.status-section .status-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.status-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.status-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.status-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.status-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary-solid {
  background: var(--accent-primary, #0075de);
  color: #fff;
}

.btn-primary-solid:hover {
  opacity: 0.9;
}

.btn-secondary-outline {
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  color: var(--text-primary);
}

.btn-secondary-outline:hover {
  border-color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .custom-page {
    padding: 80px 16px 40px;
  }

  .tier-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }

  .custom-form,
  .options-section,
  .price-summary {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .tier-grid {
    gap: 14px;
  }
  
  .tier-card {
    padding: 22px 18px;
  }
  
  .tier-price {
    font-size: 26px;
  }
  
  .tier-name {
    font-size: 15px;
  }
}

/* ── Error / Message ── */
.msg-box {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
}

.msg-box.error {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.msg-box.success {
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.msg-box.info {
  background: rgba(100, 210, 255, 0.1);
  border: 1px solid var(--info);
  color: var(--info);
}

/* ── File Upload Area ── */
.file-upload-area {
  border: 2px dashed #dddddd;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-secondary, #f6f5f4);
}

.file-upload-area:hover {
  border-color: var(--accent-primary, #0075de);
  background: rgba(0, 117, 222, 0.03);
}

.file-upload-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.upload-icon {
  color: var(--accent-primary, #0075de);
  opacity: 0.7;
}

.upload-text {
  font-weight: 500;
  color: var(--text-primary);
}

.upload-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 360px;
}

.file-list {
  margin-top: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f6f5f4);
  border: 1px solid var(--border-default, rgba(0,0,0,0.1));
  border-radius: 4px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.file-item-icon {
  flex-shrink: 0;
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}

.remove-file {
  cursor: pointer;
  color: var(--danger);
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.remove-file:hover {
  background: rgba(255, 69, 58, 0.1);
}

/* ── Loading Spinner ── */
.custom-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 117, 222, 0.2);
  border-top-color: var(--accent-primary, #0075de);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* ── Tier badge for professional ── */
.tier-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--accent-primary, #0075de);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}
