/* ════════════════════════════════════════════════════════════════
   MonTanna Spring — shared layer
   Violet energy on Wisp's violet structure.
   Green stays reserved for "now booking" / online signals (~10%).
   Built entirely on Wisp tokens (link _ds/.../styles.css first).
   ════════════════════════════════════════════════════════════════ */

/* ── Coaching brand tokens (new — no conflict with Wisp) ─────────── */
:root {
  /* Magenta → coral energy scale (the coaching warmth) */
  --magenta-700: oklch(0.42 0.21 309);
  --magenta-600: oklch(0.49 0.24 309);
  --magenta-500: oklch(0.55 0.26 311);   /* ~#a12fd0 violet */
  --magenta-400: oklch(0.63 0.24 312);
  --coral-500:   oklch(0.72 0.18 25);     /* ~#ff7a59 */
  --coral-400:   oklch(0.78 0.15 30);

  /* Signature gradients */
  --grad-cta:   linear-gradient(125deg, #6D26A9 0%, #A12FD0 100%);
  --grad-hero:  linear-gradient(150deg, oklch(0.52 0.20 304) 0%, oklch(0.50 0.24 352) 55%, oklch(0.66 0.20 18) 100%);
  --grad-brand: linear-gradient(140deg, oklch(0.50 0.20 304) 0%, var(--magenta-500) 100%);
  --grad-band:  linear-gradient(118deg, var(--dusk-600) 0%, var(--magenta-600) 42%, var(--magenta-500) 70%, var(--coral-500) 100%);

  --glow-cta: 0 10px 28px -8px rgba(161,47,208,0.50), 0 2px 8px -2px rgba(161,47,208,0.38);

  --warm-eyebrow: var(--magenta-600);

  --shell-max: 82.5rem;
  --public-shell-max: 82.5rem;
  --admin-shell-max: 90rem;
  --measure: 66ch;
  --measure-wide: 78ch;
  --page-pad: clamp(1rem, 3vw, 3rem);
  --header-h: 76px;

  --bs-body-font-family: var(--font-sans);
  --bs-body-color: var(--text-primary);
  --bs-body-bg: var(--bg);
  --bs-heading-color: var(--text-primary);
  --bs-link-color: var(--brand-text);
  --bs-link-hover-color: var(--brand);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border-subtle);
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: var(--radius-lg);
  --bs-primary: #7b16c4;
  --bs-primary-rgb: 123, 22, 196;
  --bs-success: #1f8a37;
  --bs-success-rgb: 31, 138, 55;
  --bs-danger: #c2185b;
  --bs-danger-rgb: 194, 24, 91;
  --bs-focus-ring-color: oklch(0.55 0.26 311 / 0.32);
}

/* ── Coaching "day glade" — warm cream ground, white surfaces ────── */
[data-theme="day"] {
  --bg:            oklch(0.984 0.008 350);   /* warm cream */
  --surface-1:     oklch(1 0 0);
  --surface-2:     oklch(0.978 0.006 340);
  --surface-3:     oklch(0.965 0.008 345);
  --surface-inset: oklch(0.962 0.006 340);

  --border-subtle: oklch(0.66 0.04 340 / 0.16);
  --border:        oklch(0.60 0.05 340 / 0.24);
  --border-strong: oklch(0.55 0.06 340 / 0.40);

  --text-primary:   oklch(0.26 0.06 320);
  --text-secondary: oklch(0.44 0.05 322);
  --text-muted:     oklch(0.56 0.04 324);
  --text-faint:     oklch(0.66 0.03 326);

  --brand:        var(--dusk-600);
  --brand-strong: var(--dusk-700);
  --brand-text:   var(--dusk-700);
  --brand-soft:   oklch(0.446 0.195 304 / 0.10);

  /* green accent reserved for now-booking / online */
  --accent:       var(--wisp-600);
  --accent-strong:var(--wisp-700);
  --accent-text:  var(--wisp-700);
  --accent-soft:  oklch(0.711 0.198 145 / 0.16);

  --ring: oklch(0.55 0.26 311 / 0.45);
}

/* ── Reset niceties (DS base.css already wires box-sizing/body) ──── */
img, svg, video { display: block; max-width: 100%; }
button { font-family: inherit; }
:where(p) { margin: 0; }

/* ── Layout ─────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--shell-max); margin-inline: auto; padding-inline: var(--page-pad); }
.section { padding-block: clamp(3.25rem, 6vw, 5.5rem); }
.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grow { flex: 1; }
.hide { display: none !important; }

/* ── Type helpers ───────────────────────────────────────────────── */
.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-eyebrow);
}
.eyebrow-muted { color: var(--text-muted); }
.lead { color: var(--text-secondary); font-size: 1.06rem; line-height: 1.62; }
.muted { color: var(--text-muted); }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; max-width: var(--measure); }
.section-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.12; letter-spacing: -0.015em; }
.ital-brand { font-style: italic; color: var(--brand); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  --_bg: var(--surface-1);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 0.95rem; line-height: 1; white-space: nowrap;
  padding: 13px 20px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--_bg); color: var(--text-primary);
  cursor: pointer; transition: transform var(--dur-base) var(--ease-float),
    box-shadow var(--dur-base) var(--ease-glide), background var(--dur-base) var(--ease-glide),
    border-color var(--dur-base) var(--ease-glide); text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn-cta { background: var(--grad-cta); color: white; border: none; box-shadow: var(--glow-cta); padding: 14px 24px; }
.btn-cta:hover { box-shadow: 0 16px 36px -10px oklch(0.62 0.25 354 / 0.62), 0 4px 12px -2px oklch(0.62 0.25 354 / 0.5); }
.btn-accent { background: var(--accent); color: var(--text-on-accent); border: none; box-shadow: var(--glow-wisp); }
.btn-accent:hover { box-shadow: var(--glow-wisp-strong); }
.btn-brand { background: var(--brand); color: var(--text-on-brand); border: none; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-text); }
.btn-link { background: none; border: none; color: var(--accent-text); padding: 6px 4px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-link:hover { color: var(--accent); }
.btn-sm { padding: 8px 13px; font-size: 0.85rem; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }
.btn-icon svg { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* ── Cards & surfaces ───────────────────────────────────────────── */
.card {
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md), var(--ring-hairline);
  padding: 24px;
}
.card-lift { transition: transform var(--dur-base) var(--ease-float), box-shadow var(--dur-base) var(--ease-glide); }
.card-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), var(--glow-wisp); }
.glass { background: oklch(1 0 0 / 0.7); backdrop-filter: blur(var(--blur-md)); -webkit-backdrop-filter: blur(var(--blur-md)); }
.panel { border-radius: var(--radius-xl); }

/* ── Badges & pills ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand-text); border: 1px solid transparent;
}
.badge-success { background: var(--success-soft); color: var(--accent-text); }
.badge-warning { background: var(--warning-soft); color: var(--amber-500); }
.badge-danger  { background: var(--danger-soft);  color: var(--rose-500); }
.badge-info    { background: var(--info-soft);     color: var(--sky-500); }
.badge-warm    { background: oklch(0.62 0.25 354 / 0.12); color: var(--magenta-600); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: var(--radius-pill); background: var(--surface-1);
  border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-pulse { animation: dotpulse 2.4s var(--ease-glide) infinite; }
@keyframes dotpulse { 0%,100% { box-shadow: 0 0 0 3px var(--accent-soft); } 50% { box-shadow: 0 0 0 6px oklch(0.711 0.198 145 / 0.05); } }

/* ── Brand mark (MS gradient square) ───────────────────────── */
.brandmark {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 14px; background: var(--grad-brand); color: white;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
}
.brandmark-sm { width: 38px; height: 38px; border-radius: 11px; font-size: 0.9rem; }

/* ── Form fields ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.field .req { color: var(--magenta-600); }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 13px;
  transition: border-color var(--dur-base) var(--ease-glide), box-shadow var(--dur-base) var(--ease-glide);
}
.textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.form-control,
.form-select {
  font: inherit;
  color: var(--text-primary);
  background-color: var(--surface-1);
  border-color: var(--border);
  border-radius: var(--radius-md);
}
.form-control {
  padding: 11px 13px;
}
.form-select {
  padding: 11px 2.25rem 11px 13px;
}
.form-control:focus,
.form-select:focus {
  color: var(--text-primary);
  background-color: var(--surface-1);
  border-color: var(--accent);
  box-shadow: var(--glow-focus);
}
.form-control::placeholder { color: var(--text-faint); }
.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}
.field-hint { font-size: 0.78rem; color: var(--text-muted); }
.field-error { font-size: 0.8rem; color: var(--rose-500); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* ── Switch ─────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch .track { width: 100%; height: 100%; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--border); transition: background var(--dur-base) var(--ease-glide); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: var(--shadow-sm); transition: transform var(--dur-base) var(--ease-float); }
.switch input:checked + .track { background: var(--accent); border-color: transparent; }
.switch input:checked + .track + .knob { transform: translateX(18px); }

/* ── Aurora ambient background ───────────────────────────────────── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 60vw; height: 60vw; border-radius: 50%;
  filter: blur(90px); opacity: 0.20;
}
.aurora::before { background: var(--magenta-500); top: -16vw; right: -12vw; animation: drift1 22s var(--ease-glide) infinite alternate; }
.aurora::after  { background: var(--wisp-500); bottom: -20vw; left: -10vw; opacity: 0.12; animation: drift2 28s var(--ease-glide) infinite alternate; }
@keyframes drift1 { to { transform: translate(-6vw, 5vw) scale(1.1); } }
@keyframes drift2 { to { transform: translate(7vw, -4vw) scale(1.15); } }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: var(--radius-md);
  background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 0.9rem; font-weight: 500; animation: toastin var(--dur-slow) var(--ease-float);
}
.toast-success { border-color: oklch(0.711 0.198 145 / 0.4); box-shadow: var(--shadow-lg), var(--glow-wisp); }
.toast-error { border-color: oklch(0.620 0.205 24 / 0.4); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

/* ── Bootstrap modal skin ───────────────────────────────────────── */
.modal-backdrop { --bs-backdrop-bg: var(--scrim); --bs-backdrop-opacity: 1; backdrop-filter: blur(3px); }
.coaching-modal .modal-dialog { --bs-modal-width: 540px; }
.coaching-modal-content {
  position: relative;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.coaching-modal-content .modal-header,
.coaching-modal-content .modal-footer { border-color: var(--border-subtle); }
.coaching-modal-content .modal-header { position: relative; padding-right: 3.75rem; }
.coaching-modal-content .modal-close { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 2; }
.coaching-modal-content .modal-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 650;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* ── Message thread / chat bubbles (shared: admin thread view + client chat portal) ── */
.msg-log { display: flex; flex-direction: column; gap: 14px; }
.msg-row { display: flex; }
.msg-row.msg-self { justify-content: flex-end; }
.msg-col { display: flex; flex-direction: column; max-width: min(78%, 34rem); }
.msg-row.msg-self .msg-col { align-items: flex-end; }
.msg-bubble {
  padding: 10px 14px; font-size: 0.92rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px 16px 16px 4px;
}
.msg-row.msg-self .msg-bubble {
  background: var(--brand); color: var(--text-on-brand); border: none;
  border-radius: 16px 16px 4px 16px;
}
.msg-meta {
  display: flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: 0.72rem; color: var(--text-faint);
}
.msg-meta svg { width: 12px; height: 12px; }
.msg-state-sending .msg-bubble { opacity: 0.6; }
.msg-state-failed .msg-bubble { border: 1px solid var(--rose-500); }
.msg-retry { color: var(--rose-500); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; font: inherit; }
.msg-day-sep { text-align: center; font-size: 0.72rem; color: var(--text-faint); margin: 6px 0; }

.msg-composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px; background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
}
.msg-composer textarea { min-height: 2.75em; max-height: 7.5em; resize: none; }
.msg-composer .btn-icon { flex: none; }

.new-msg-pill {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--brand); color: var(--text-on-brand);
  font-size: 0.8rem; font-weight: 600; border: none; cursor: pointer;
  box-shadow: var(--shadow-md); animation: pillin var(--dur-slow) var(--ease-float);
}
@keyframes pillin { from { transform: translateY(8px); opacity: 0; } }

/* ── Misc utilities ─────────────────────────────────────────────── */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty .sparkle { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); }
.divider { height: 1px; background: var(--border-subtle); border: 0; }
