/* ============================================
   Appointment MyCred - Booking Form
   Modern, clean, mobile-first design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
  --ccrm-primary: #ff6f61;
  --ccrm-primary-light: #ff8a7a;
  --ccrm-primary-dark: #e5554a;
  --ccrm-accent: #f59e0b;
  --ccrm-accent-dark: #d97706;
  --ccrm-success: #10b981;
  --ccrm-danger: #ef4444;
  --ccrm-bg: #ffffff;
  --ccrm-bg-subtle: #fffaf9;
  --ccrm-bg-muted: #fff1ef;
  --ccrm-border: #e2e8f0;
  --ccrm-text: #1e293b;
  --ccrm-text-muted: #64748b;
  --ccrm-text-light: #94a3b8;
  --ccrm-radius: 12px;
  --ccrm-radius-sm: 8px;
  --ccrm-radius-full: 9999px;
  --ccrm-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --ccrm-shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --ccrm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --ccrm-transition: .2s cubic-bezier(.4,0,.2,1);
  --ccrm-font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ccrm-booking {
  font-family: var(--ccrm-font);
  max-width: 640px;
  margin: 0 auto;
  color: var(--ccrm-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.ccrm-booking *, .ccrm-booking *::before, .ccrm-booking *::after { box-sizing: border-box; }

/* ── Steps Progress ── */
.ccrm-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 16px;
}
.ccrm-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: .4;
  transition: var(--ccrm-transition);
}
.ccrm-step.active { opacity: 1; }
.ccrm-step.done { opacity: .7; }
.ccrm-step-num {
  width: 32px; height: 32px;
  border-radius: var(--ccrm-radius-full);
  background: var(--ccrm-bg-muted);
  color: var(--ccrm-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  transition: var(--ccrm-transition);
}
.ccrm-step.active .ccrm-step-num {
  background: var(--ccrm-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.ccrm-step.done .ccrm-step-num { background: var(--ccrm-success); color: #fff; }
.ccrm-step-label { font-size: 13px; font-weight: 500; white-space: nowrap; }
.ccrm-step-line {
  flex: 1; height: 2px; min-width: 20px; max-width: 60px;
  background: var(--ccrm-border); margin: 0 4px;
}

/* ── Panels ── */
.ccrm-panel {
  background: var(--ccrm-bg);
  border: 1px solid var(--ccrm-border);
  border-radius: var(--ccrm-radius);
  padding: 28px 24px;
  box-shadow: var(--ccrm-shadow);
  animation: ccrmSlideIn .35s ease;
}
@keyframes ccrmSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.ccrm-panel-title {
  font-size: 18px; font-weight: 600; margin: 0 0 20px;
  color: var(--ccrm-text);
}

/* ── Category Tabs ── */
.ccrm-categories {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.ccrm-cat-btn {
  padding: 6px 16px; border-radius: var(--ccrm-radius-full);
  border: 1px solid var(--ccrm-border); background: var(--ccrm-bg);
  font-size: 13px; font-weight: 500; color: var(--ccrm-text-muted);
  cursor: pointer; transition: var(--ccrm-transition);
  font-family: var(--ccrm-font);
}
.ccrm-cat-btn:hover { border-color: var(--ccrm-primary); color: var(--ccrm-primary); }
.ccrm-cat-btn.active {
  background: var(--ccrm-primary); color: #fff; border-color: var(--ccrm-primary);
}

/* ── Service Cards ── */
.ccrm-service-list { display: flex; flex-direction: column; gap: 10px; }
.ccrm-service-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--ccrm-radius-sm);
  border: 2px solid var(--ccrm-border); cursor: pointer;
  transition: var(--ccrm-transition); background: var(--ccrm-bg);
}
.ccrm-service-card:hover {
  border-color: var(--ccrm-primary-light);
  box-shadow: var(--ccrm-shadow-md);
  transform: translateY(-1px);
}
.ccrm-service-card.selected {
  border-color: var(--ccrm-primary);
  background: rgba(99,102,241,.04);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.ccrm-service-dot {
  width: 10px; height: 10px; border-radius: var(--ccrm-radius-full);
  flex-shrink: 0;
}
.ccrm-service-info { flex: 1; min-width: 0; }
.ccrm-service-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.ccrm-service-desc { font-size: 12px; color: var(--ccrm-text-muted); }
.ccrm-service-meta {
  display: flex; gap: 12px; align-items: center;
  font-size: 13px; color: var(--ccrm-text-muted); flex-shrink: 0;
}
.ccrm-service-duration { display: flex; align-items: center; gap: 4px; }
.ccrm-service-price { font-weight: 600; color: var(--ccrm-text); font-size: 15px; }

/* ── Staff Picker ── */
.ccrm-staff-list {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.ccrm-staff-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--ccrm-radius-full);
  border: 2px solid var(--ccrm-border); cursor: pointer;
  transition: var(--ccrm-transition); font-size: 14px; font-weight: 500;
  background: var(--ccrm-bg); font-family: var(--ccrm-font);
}
.ccrm-staff-chip:hover { border-color: var(--ccrm-primary-light); }
.ccrm-staff-chip.selected {
  border-color: var(--ccrm-primary); background: rgba(99,102,241,.04);
  color: var(--ccrm-primary);
}
.ccrm-staff-color {
  width: 8px; height: 8px; border-radius: var(--ccrm-radius-full);
}

/* ── Calendar ── */
.ccrm-calendar-wrap { margin-bottom: 20px; }
.ccrm-calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 0 4px;
}
.ccrm-cal-month { font-size: 16px; font-weight: 600; }
.ccrm-cal-nav {
  width: 36px; height: 36px; border-radius: var(--ccrm-radius-full);
  border: 1px solid var(--ccrm-border); background: var(--ccrm-bg);
  font-size: 20px; cursor: pointer; transition: var(--ccrm-transition);
  display: flex; align-items: center; justify-content: center;
  color: var(--ccrm-text-muted); font-family: var(--ccrm-font);
}
.ccrm-cal-nav:hover { background: var(--ccrm-bg-muted); color: var(--ccrm-text); }
.ccrm-cal-dow {
  display: grid; grid-template-columns: repeat(7,1fr);
  text-align: center; font-size: 12px; font-weight: 600;
  color: var(--ccrm-text-muted); margin-bottom: 8px;
}
.ccrm-cal-dow span:nth-child(6) { color: #3b82f6; }
.ccrm-cal-dow span:nth-child(7) { color: var(--ccrm-danger); }
.ccrm-cal-days {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 4px;
}
.ccrm-cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--ccrm-radius-sm); font-size: 14px; font-weight: 500;
  cursor: default; transition: var(--ccrm-transition); border: none;
  background: none; font-family: var(--ccrm-font); color: var(--ccrm-text-light);
}
.ccrm-cal-day.available {
  cursor: pointer; color: var(--ccrm-text); background: var(--ccrm-bg-subtle);
}
.ccrm-cal-day.available:hover {
  background: rgba(99,102,241,.1); color: var(--ccrm-primary);
}
.ccrm-cal-day.selected {
  background: var(--ccrm-primary) !important; color: #fff !important;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.ccrm-cal-day.today { font-weight: 700; }
.ccrm-cal-day.today::after {
  content: ''; position: absolute; bottom: 2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ccrm-primary);
}
.ccrm-cal-day { position: relative; }

/* ── Time Slots ── */
.ccrm-time-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.ccrm-time-slot {
  padding: 10px 4px; border-radius: var(--ccrm-radius-sm);
  border: 1.5px solid var(--ccrm-border); text-align: center;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--ccrm-transition); background: var(--ccrm-bg);
  font-family: var(--ccrm-font);
}
.ccrm-time-slot:hover {
  border-color: var(--ccrm-primary); color: var(--ccrm-primary);
  background: rgba(99,102,241,.04);
}
.ccrm-time-slot.selected {
  background: var(--ccrm-primary); color: #fff; border-color: var(--ccrm-primary);
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

/* ── Form ── */
.ccrm-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--ccrm-text);
}
.ccrm-required { color: var(--ccrm-danger); }
.ccrm-form-group { margin-bottom: 16px; }
.ccrm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccrm-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--ccrm-border);
  border-radius: var(--ccrm-radius-sm); font-size: 15px;
  transition: var(--ccrm-transition); background: var(--ccrm-bg);
  font-family: var(--ccrm-font); color: var(--ccrm-text);
}
.ccrm-input:focus {
  outline: none; border-color: var(--ccrm-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.ccrm-input::placeholder { color: var(--ccrm-text-light); }
.ccrm-textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ── */
.ccrm-nav-buttons {
  display: flex; gap: 12px; justify-content: space-between; margin-top: 24px;
}
.ccrm-btn {
  padding: 11px 28px; border-radius: var(--ccrm-radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--ccrm-transition); border: none;
  font-family: var(--ccrm-font); display: inline-flex;
  align-items: center; gap: 6px;
}
.ccrm-btn:disabled { opacity: .5; cursor: not-allowed; }
.ccrm-btn-primary {
  background: var(--ccrm-primary); color: #fff;
}
.ccrm-btn-primary:hover:not(:disabled) { background: var(--ccrm-primary-dark); }
.ccrm-btn-accent {
  background: var(--ccrm-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.ccrm-btn-accent:hover:not(:disabled) { background: var(--ccrm-accent-dark); }
.ccrm-btn-outline {
  background: transparent; color: var(--ccrm-text-muted);
  border: 1.5px solid var(--ccrm-border);
}
.ccrm-btn-outline:hover { background: var(--ccrm-bg-muted); color: var(--ccrm-text); }

/* ── Confirm Card ── */
.ccrm-confirm-card {
  background: var(--ccrm-bg-subtle); border-radius: var(--ccrm-radius-sm);
  padding: 20px;
}
.ccrm-confirm-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--ccrm-border); font-size: 14px;
}
.ccrm-confirm-row:last-child { border: none; }
.ccrm-confirm-label { color: var(--ccrm-text-muted); font-weight: 500; }
.ccrm-confirm-value { font-weight: 600; text-align: right; }

/* ── Done ── */
.ccrm-done { text-align: center; padding: 20px 0; }
.ccrm-done-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  color: var(--ccrm-success);
  animation: ccrmCheckPop .5s ease;
}
@keyframes ccrmCheckPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.ccrm-done-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.ccrm-done-text { color: var(--ccrm-text-muted); font-size: 14px; margin-bottom: 20px; }
.ccrm-done-summary {
  text-align: left; background: var(--ccrm-bg-subtle);
  border-radius: var(--ccrm-radius-sm); padding: 16px;
  font-size: 14px;
}

/* ── Loading ── */
.ccrm-loading { text-align: center; padding: 32px; }
.ccrm-spinner {
  width: 32px; height: 32px; border: 3px solid var(--ccrm-border);
  border-top-color: var(--ccrm-primary); border-radius: 50%;
  animation: ccrmSpin .7s linear infinite; margin: 0 auto;
}
@keyframes ccrmSpin { to { transform: rotate(360deg); } }
.ccrm-no-slots { text-align: center; padding: 24px; color: var(--ccrm-text-muted); font-size: 14px; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .ccrm-panel { padding: 20px 16px; }
  .ccrm-form-row { grid-template-columns: 1fr; }
  .ccrm-step-label { display: none; }
  .ccrm-step-line { min-width: 16px; }
  .ccrm-time-grid { grid-template-columns: repeat(3, 1fr); }
  .ccrm-service-card { flex-wrap: wrap; }
  .ccrm-service-meta { width: 100%; padding-left: 24px; }
}

/* ============================================
   Deposit-specific styles
   ============================================ */

/* Deposit Notice */
.ccrm-deposit-notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a; border-radius: var(--ccrm-radius-sm);
  padding: 18px; margin: 16px 0;
}
.ccrm-deposit-notice-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.ccrm-deposit-notice-body { flex: 1; }
.ccrm-deposit-notice-title { font-weight: 700; font-size: 14px; color: #92400e; margin: 0 0 6px; }
.ccrm-deposit-notice-text { font-size: 13px; color: #78350f; margin: 0; line-height: 1.7; }
.ccrm-deposit-notice-text strong { color: #b45309; font-size: 15px; }

/* Stripe Card Element */
.ccrm-stripe-section { margin: 20px 0; }
.ccrm-stripe-element {
  padding: 14px 16px;
  border: 2px solid var(--ccrm-border);
  border-radius: var(--ccrm-radius-sm);
  background: var(--ccrm-bg);
  transition: var(--ccrm-transition);
}
.ccrm-stripe-element:focus-within,
.ccrm-stripe-element.StripeElement--focus {
  border-color: var(--ccrm-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.ccrm-stripe-element.StripeElement--invalid {
  border-color: var(--ccrm-danger);
}
.ccrm-stripe-error {
  color: var(--ccrm-danger); font-size: 13px; margin-top: 8px; min-height: 18px;
}

/* Pay button accent style for deposit */
.ccrm-deposit-mode .ccrm-btn-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  padding: 14px 32px; font-size: 15px;
  box-shadow: 0 4px 14px rgba(245,158,11,.35);
  width: 100%;
  justify-content: center;
}
.ccrm-deposit-mode .ccrm-btn-accent:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(245,158,11,.45);
  transform: translateY(-1px);
}
.ccrm-deposit-mode .ccrm-btn-accent:disabled {
  background: #d1d5db; box-shadow: none; transform: none;
}
