/* ==========================================================================
   ImplementAI — brand design system
   Colours, type, and components per the 2025 Brand Identity Guidelines.
   Gotham is the official typeface; Montserrat is the closest free substitute.
   ========================================================================== */

:root {
  /* Main colours */
  --violet: #6B30FF;      /* Royal Violet — primary CTA */
  --indigo: #2A2092;      /* Midnight Indigo — pressed/dark */
  --lavender: #D0BFFA;    /* Lavender Mist — hover/accent */
  --charcoal: #1E1E1E;    /* Deep Charcoal — text */
  --ivory: #F8F2ED;       /* Soft Ivory — background */

  /* Secondary colours */
  --orange: #FF6629;
  --yellow: #FFCD18;
  --aqua-green: #0DEABA;
  --aqua-teal: #19D3C5;

  /* Derived / neutrals */
  --white: #ffffff;
  --surface: #ffffff;
  --ink-2: #4a4658;             /* secondary text */
  --ink-3: #837e94;             /* muted text */
  --line: #e7e0ef;              /* hairline borders */
  --line-strong: #cfc6e0;
  --violet-tint: #f1ebff;       /* very light violet wash */
  --lavender-12: rgba(107, 48, 255, 0.12);
  --lavender-20: rgba(107, 48, 255, 0.20);
  --danger: #d33a2c;
  --success: var(--aqua-green);

  /* Type */
  --font: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;

  /* Radii & spacing */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(30, 30, 30, 0.06);
  --shadow-md: 0 12px 32px -12px rgba(42, 32, 146, 0.22);
  --shadow-lg: 0 28px 70px -28px rgba(42, 32, 146, 0.35);

  --ring: 0 0 0 4px var(--lavender-20);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;          /* Gotham Book */
  font-size: 18px;           /* Body 18 / line 28 per brand */
  line-height: 1.56;
  color: var(--charcoal);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

/* Decorative concentric contour lines (brand "visual elements") — fine, faded,
   masked so they dissolve into the ivory rather than reading as hard rings. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at center, #000, transparent 70%);
          mask-image: radial-gradient(circle at center, #000, transparent 70%);
}
body::before {
  width: 600px; height: 600px; top: -240px; left: -220px;
  background: repeating-radial-gradient(circle at center,
              transparent 0 14px, var(--violet) 14px 15px);
  opacity: 0.08;
}
body::after {
  width: 760px; height: 760px; bottom: -300px; right: -280px;
  background: repeating-radial-gradient(circle at center,
              transparent 0 17px, var(--violet) 17px 18px);
  opacity: 0.07;
}

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }      /* ~H3/H4 scale for app */
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; line-height: 1.45; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem;
  font-weight: 700; color: var(--violet);
}

/* -------------------------------------------------------------- structure */
.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
/* One centred content column so the header logo, copy and cards all share a left edge. */
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding: clamp(20px, 4vw, 48px) 0 64px; }

/* ----------------------------------------------------------------- header */
.site-header { padding: 22px 0; }
/* Official brand logo (lighter-bg lockup), loaded from implementai.io. */
.brand-logo { display: inline-flex; align-items: center; }
.brand-img { height: 40px; width: auto; display: block; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 3.5vw, 40px);
}
.card + .card { margin-top: 24px; }
.card-pad-sm { padding: clamp(18px, 2.5vw, 26px); }

/* --------------------------------------------------------------- stepper */
.stepper { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; font-weight: 500; color: var(--ink-3);
}
.step .dot {
  width: 28px; height: 28px; border-radius: var(--pill);
  display: grid; place-items: center;
  background: var(--white); border: 1.5px solid var(--line-strong);
  color: var(--ink-3); font-weight: 700; font-size: 0.85rem;
}
.step.active { color: var(--charcoal); }
.step.active .dot { background: var(--violet); border-color: var(--violet); color: #fff; }
.step.done .dot { background: var(--lavender); border-color: var(--lavender); color: var(--indigo); }
.step .bar { width: 26px; height: 2px; background: var(--line-strong); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --bg: var(--violet); --fg: #fff; --bd: var(--violet);
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 15px 28px; border-radius: var(--pill);
  background: var(--bg); color: var(--fg); border: 1.5px solid var(--bd);
  transition: background .15s ease, color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .05s ease;
}
.btn:hover { background: var(--lavender); color: var(--indigo); border-color: var(--lavender); }
.btn:active { background: var(--indigo); color: #fff; border-color: var(--indigo); transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled {
  cursor: not-allowed; background: #e9e6ef; color: #a39fb2; border-color: #e9e6ef;
}
.btn[disabled]:hover { background: #e9e6ef; color: #a39fb2; }

.btn-outline { --bg: #fff; --fg: var(--violet); --bd: var(--lavender); }
.btn-ghost { --bg: transparent; --fg: var(--violet); --bd: transparent; }
.btn-ghost:hover { background: var(--lavender-12); color: var(--indigo); border-color: transparent; }
.btn-danger { --bg: #fff; --fg: var(--danger); --bd: #f0c9c4; }
.btn-danger:hover { background: #fbe9e7; color: var(--danger); border-color: #f0c9c4; }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 34px; font-size: 1.05rem; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; position: absolute; }
.btn { position: relative; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- forms */
.field { margin-bottom: 20px; }
.field > label, .label {
  display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 8px; color: var(--charcoal);
}
.req { color: var(--violet); }
.hint { font-size: 0.82rem; color: var(--ink-3); margin-top: 6px; }

.input, .select, .combo-input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--charcoal);
  background: var(--white);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 13px 15px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #aaa4ba; }
.input:focus, .select:focus, .combo-input:focus {
  outline: none; border-color: var(--violet); box-shadow: var(--ring);
}
.input.invalid, .combo-input.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.82rem; margin-top: 6px; display: none; }
.field.has-error .field-error { display: block; }

/* phone group */
.phone-group { display: grid; grid-template-columns: minmax(120px, 150px) 1fr; gap: 10px; }
@media (max-width: 460px) { .phone-group { grid-template-columns: 1fr; } }

/* honeypot — display:none so browser autofill ignores it (off-screen fields
   get autofilled by password managers, causing false spam rejections). */
.hp-field { display: none !important; }

/* --------------------------------------------------- searchable combobox */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 280px; overflow-y: auto;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.combo.open .combo-list { display: block; }
.combo-option {
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 0.95rem; display: flex; justify-content: space-between; gap: 12px;
}
.combo-option:hover, .combo-option.active { background: var(--lavender-12); }
.combo-option .off { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.combo-empty { padding: 12px; color: var(--ink-3); }

/* timezone banner */
.tz-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--lavender-12); border: 1px solid var(--lavender);
  border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 8px;
}
.tz-banner .clock { font-size: 1.2rem; }
.tz-banner strong { font-weight: 700; }

/* ------------------------------------------------------------ date strip */
.date-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.date-chip {
  flex: 0 0 auto; min-width: 76px; text-align: center;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 12px 10px; cursor: pointer; transition: all .12s;
}
.date-chip:hover { border-color: var(--lavender); }
.date-chip.selected { background: var(--violet); border-color: var(--violet); color: #fff; }
.date-chip .dow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.date-chip.selected .dow { color: #e3d8ff; }
.date-chip .day { font-size: 1.25rem; font-weight: 700; }
.date-chip .mon { font-size: 0.72rem; color: var(--ink-3); }
.date-chip.selected .mon { color: #e3d8ff; }

/* -------------------------------------------------------------- slot grid */
.slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px; margin-top: 18px;
}
.slot {
  appearance: none; cursor: pointer; font: inherit; font-weight: 500;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--pill);
  padding: 12px 8px; text-align: center; color: var(--charcoal);
  transition: all .12s;
}
.slot:hover { border-color: var(--violet); color: var(--violet); }
.slot:focus-visible { outline: none; box-shadow: var(--ring); }
.slot.selected { background: var(--violet); border-color: var(--violet); color: #fff; }
.slot[disabled] {
  cursor: not-allowed; color: #b6b1c4; background: #f4f1f7; border-color: #ece8f2;
  text-decoration: line-through;
}

/* custom "specific time" option */
.custom-time { margin-top: 20px; }
.or-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-3); font-size: 0.82rem; margin: 16px 0 14px;
}
.or-divider::before, .or-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.custom-time-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.custom-time-row .input { max-width: 170px; }
.custom-time-row .btn { padding: 13px 22px; }
input[type="time"].input { font: inherit; line-height: 1.2; }
.input.is-active { border-color: var(--violet); box-shadow: var(--ring); }
.custom-time-error { color: var(--danger); font-size: 0.82rem; margin-top: 10px; display: none; }
.custom-time-error.show { display: block; }

/* states */
.state { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.state .spinner { margin: 0 auto 14px; color: var(--violet); }
.empty-illus { font-size: 2rem; margin-bottom: 8px; }

/* alerts */
.alert {
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; font-size: 0.95rem;
  border: 1px solid transparent;
}
.alert-error { background: #fbe9e7; border-color: #f0c9c4; color: #a82c20; }
.alert-info { background: var(--lavender-12); border-color: var(--lavender); color: var(--indigo); }

/* ---------------------------------------------------------- confirmation */
.confirm-icon {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--aqua-green); color: #06372c; margin: 0 auto 18px;
}
.summary { list-style: none; padding: 0; margin: 22px 0; }
.summary li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.summary li:last-child { border-bottom: 0; }
.summary .k { color: var(--ink-3); }
.summary .v { font-weight: 500; text-align: right; }

/* status badge */
.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 700;
  padding: 6px 13px; border-radius: var(--pill); text-transform: capitalize;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--lavender-12); color: var(--indigo); }
.badge-called  { background: rgba(13,234,186,.18); color: #06694f; }
.badge-cancelled { background: #f0eef4; color: var(--ink-3); }
.badge-failed, .badge-missed { background: #fbe9e7; color: #a82c20; }
.badge-processing { background: rgba(255,205,24,.22); color: #7a5b00; }

/* manage link box */
.link-box {
  display: flex; gap: 10px; align-items: center; background: var(--ivory);
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 12px 14px;
  word-break: break-all; font-size: 0.85rem;
}

/* footer */
.site-footer { padding: 28px 0; color: var(--ink-3); font-size: 0.85rem; text-align: center; }

/* utilities */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
