:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  --text: #101828;
  --text-muted: #475467;
  --text-soft: #98a2b3;

  --brand: #f59e0b;
  --brand-dark: #b45309;
  --brand-soft: #fef3c7;

  --accent: #1d4ed8;
  --success: #027a48;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fef3f2;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 36px rgba(16,24,40,.10);

  --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

@media (max-width: 600px) {
  .page { padding: 16px 12px 40px; }
  body { font-size: 14px; }
  .hero h1 { font-size: 22px; }
  .hero .sub { font-size: 13px; }
  h2 { font-size: 17px; }
  .hint { font-size: 12px; margin-bottom: 14px; }
  main { padding: 18px 14px; border-radius: 10px; }
  .card { padding: 14px 14px; }
  .card .name { font-size: 14px; }
  .stepper { gap: 2px; }
  .step { padding: 4px 2px; font-size: 12px; }
  .step-num { width: 22px; height: 22px; font-size: 11px; }
  .step-line { flex-basis: 8px; }
  .calendar-col, .slot-col { padding: 14px; }
  .cal-day { font-size: 12px; }
  .slot { padding: 12px 4px; font-size: 13px; }
  button { min-height: 44px; }
  input[type="text"], input[type="email"], input[type="date"], textarea {
    font-size: 16px;
    padding: 10px 12px;
  }
  .btn-primary { padding: 14px 24px; font-size: 15px; }
  .cal-nav { width: 36px; height: 36px; }
}

@media (max-width: 720px) {
  .schedule-grid { grid-template-columns: 1fr; gap: 12px; }
  .slot-list { max-height: none; }
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.brand-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero .sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── Stepper ─── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 12px;
  transition: background-color .12s ease-out, border-color .12s ease-out, color .12s ease-out, box-shadow .12s ease-out;
}

.step.active .step-num {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.step.active { color: var(--text); }
.step.active .step-label { font-weight: 600; }

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step.done .step-num::before { content: "✓"; }
.step.done .step-num span { display: none; }

.step.done { color: var(--text-muted); }

.step-line {
  flex: 0 0 24px;
  height: 1.5px;
  background: var(--border-strong);
}

@media (max-width: 640px) {
  .step-label { display: none; }
  .step-line { flex-basis: 12px; }
}

/* ─── Main ─── */
main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  main { padding: 22px 18px; }
}

h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.tz-banner {
  background: var(--brand-soft);
  border: 1px solid #fde68a;
  color: var(--brand-dark);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
}

.micro {
  color: var(--text-soft);
  font-size: 12px;
  margin: 12px 0 0;
}

.req { color: var(--danger); }

/* ─── Card grid ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 18px;
  cursor: pointer;
  background: var(--surface);
  transition: transform .1s ease-out, box-shadow .1s ease-out, background .1s ease-out;
  overflow: hidden;
  will-change: transform;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: border-color .1s ease-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #fffaf2 0%, var(--surface) 100%);
}

.card:hover::after { border-color: var(--brand); }

.card:active {
  transform: translateY(0);
  transition-duration: 0.04s;
}

.card .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.consultant-card {
  padding: 16px 18px 18px;
}

.consultant-intro {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ─── Step 3: Schedule grid ─── */
.schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .schedule-grid { grid-template-columns: 1fr; gap: 16px; }
}

.calendar-col, .slot-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

/* ─── Calendar ─── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-header span {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.cal-nav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color .08s ease-out, border-color .08s ease-out;
}

.cal-nav:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.cal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-weekdays, .cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekdays {
  margin-bottom: 6px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background-color .08s ease-out, color .08s ease-out;
}

.cal-day:hover:not(:disabled):not(.selected) {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.cal-day:disabled {
  color: var(--text-soft);
  opacity: 0.45;
  cursor: not-allowed;
}

.cal-day.outside {
  color: var(--text-soft);
  opacity: 0.35;
}

.cal-day.today {
  font-weight: 700;
  color: var(--brand-dark);
}

.cal-day.selected {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, .3);
}

.cal-day {
  position: relative;
}

.cal-day.has-avail::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--success);
}

.cal-day.no-avail {
  color: var(--text-soft);
  opacity: 0.55;
}

.cal-day.no-avail::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.cal-day.selected.has-avail::after,
.cal-day.selected.no-avail::after {
  background: rgba(255,255,255,.7);
}

/* ─── Slots ─── */
.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.slot-header span:first-child {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
  display: inline-block;
}

.sync-indicator::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.3;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.4; }
  100% { transform: scale(2); opacity: 0; }
}

.sync-indicator.syncing { background: var(--brand); }
.sync-indicator.syncing::after { background: var(--brand); }

.slot-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.slot-group + .slot-group { margin-top: 14px; }

.slot-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-group-title::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}

.slot-group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.slot-list::-webkit-scrollbar { width: 6px; }
.slot-list::-webkit-scrollbar-track { background: transparent; }
.slot-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.slot {
  text-align: center;
  padding: 10px 6px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Inter', monospace;
  letter-spacing: 0.02em;
  transition: transform .08s ease-out, border-color .08s ease-out, background-color .08s ease-out, color .08s ease-out;
  will-change: transform;
}

.slot:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.slot:active {
  transform: translateY(0);
  transition-duration: 0.04s;
}

.slot.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.slot-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
  font-size: 13px;
}

.slot-skeleton {
  height: 40px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1s linear infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Step 4: summary panel + form 2-column ─── */
.step4-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 720px) {
  .step4-grid { grid-template-columns: 1fr; gap: 16px; }
}

.booking-summary {
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--surface) 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: sticky;
  top: 16px;
}

.summary-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand-dark);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(180, 83, 9, 0.08);
  font-size: 13px;
}

.summary-row:last-of-type { border-bottom: none; }

.summary-row span {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.summary-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  font-size: 13px;
}

.summary-tz strong {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.summary-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(180, 83, 9, 0.15);
  font-size: 11px;
  color: var(--brand-dark);
  text-align: center;
}

/* ─── Form ─── */
.form-card {
  background: var(--surface);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .1s ease-out, box-shadow .1s ease-out;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ─── */
button {
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .1s ease-out, transform .1s ease-out, box-shadow .1s ease-out, color .1s ease-out;
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(245, 158, 11, .25);
}

.btn-primary {
  will-change: transform;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(245, 158, 11, .4);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
}

button.back {
  margin-top: 24px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 0;
}

button.back::before { content: "← "; }
button.back:hover { color: var(--brand-dark); }

/* ─── Success page ─── */
.success-wrap {
  text-align: center;
  padding: 8px 0 16px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  border: 2px solid var(--success);
  animation: pop-in .22s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-wrap h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.success-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.success-meeting {
  text-align: left;
  margin: 0 auto 24px;
  max-width: 480px;
}

.meeting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(16,24,40,.04);
}

.meeting-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.meeting-row:last-child { border-bottom: none; }

.meeting-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.meeting-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.meeting-tz strong {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

.success-next {
  text-align: left;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 auto 24px;
  max-width: 480px;
}

.success-next h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.success-next ol {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.success-next ol li {
  padding-left: 4px;
  margin-bottom: 8px;
}

.success-next strong {
  color: var(--text);
  font-weight: 600;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto 16px;
}

.action-btn {
  display: block;
  text-align: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}

.action-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(245, 158, 11, .25);
}

.action-primary:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.action-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1.5px solid var(--border-strong);
}

.action-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
  text-decoration: none;
}

.success-foot {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 10px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.success-foot a { color: var(--text-muted); }

/* ─── Error ─── */
.error-pane {
  background: var(--danger-bg);
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
  color: var(--danger);
  font-size: 13px;
}

.error-pane button { margin-top: 10px; }

.hidden { display: none !important; }

/* ─── Step transitions: subtle fade-in (snappy) ─── */
.step-pane:not(.hidden) {
  animation: pane-in .14s ease-out;
}

@keyframes pane-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Accessibility: focus rings ─── */
button:focus-visible,
.cal-day:focus-visible,
.slot:focus-visible,
.action-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Footer ─── */
footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}
