/* ==========================================================
   Avara — Custom scheduling modal (replaces Cal.com).
   Triggered by any element with [data-schedule].
   2 steps: pick date+time → fill name/email/business/note.
   Submits to a Netlify form (name="schedule-call"); falls back to mailto.
   ========================================================== */

.sched-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(.22,1,.36,1);
}
.sched-modal.is-open { opacity: 1; pointer-events: auto; }

.sched-card {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: #141414;
  border: 1px solid #1F1E1B;
  border-radius: 18px;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.92), 0 0 0 1px rgba(217,96,59,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.99);
  transition: transform 320ms cubic-bezier(.22,1,.36,1);
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: 'ss01';
}
.sched-modal.is-open .sched-card { transform: translateY(0) scale(1); }

.sched-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #1F1E1B;
  flex-shrink: 0;
  gap: 12px;
}
.sched-head-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sched-head-title .sched-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #EDE9DF;
  font-size: 17px;
}
.sched-head-title .sched-brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D9603B;
  display: inline-block;
  margin-left: 2px;
  vertical-align: 0.05em;
}
.sched-head-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9A968D;
}
.sched-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #1F1E1B;
  color: #EDE9DF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 200ms ease, color 200ms ease, transform 200ms cubic-bezier(.22,1,.36,1);
  flex-shrink: 0;
}
.sched-close:hover { border-color: #D9603B; color: #D9603B; transform: rotate(90deg); }

.sched-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.sched-step { display: none; animation: schedFade 320ms cubic-bezier(.22,1,.36,1); }
.sched-step.is-active { display: block; }
@keyframes schedFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sched-context {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(217, 96, 59, 0.06);
  border: 1px solid rgba(217, 96, 59, 0.2);
  border-radius: 10px;
  margin-bottom: 24px;
}
.sched-context-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(217,96,59,0.12);
  border: 1px solid #D9603B;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D9603B;
  flex-shrink: 0;
}
.sched-context-text {
  font-size: 13px;
  line-height: 1.45;
  color: #EDE9DF;
}
.sched-context-text strong { color: #EDE9DF; font-weight: 600; }
.sched-context-text span { color: #9A968D; }

.sched-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9A968D;
  margin-bottom: 12px;
}

.sched-dates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.sched-dates::-webkit-scrollbar { display: none; }
.sched-date {
  flex: 0 0 88px;
  background: transparent;
  border: 1px solid #1F1E1B;
  border-radius: 10px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 180ms ease;
  font-family: 'Inter', sans-serif;
}
.sched-date:hover:not(.is-busy) { border-color: rgba(217,96,59,0.5); }
.sched-date.is-active { background: #D9603B; border-color: #D9603B; }
.sched-date.is-active .sched-date-dow,
.sched-date.is-active .sched-date-num,
.sched-date.is-active .sched-date-month { color: #0B0B0B; }
.sched-date.is-busy { opacity: 0.4; cursor: not-allowed; }
.sched-date-dow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #9A968D;
  text-transform: uppercase;
}
.sched-date-num {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #EDE9DF;
  letter-spacing: -0.02em;
}
.sched-date-month {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6B6862;
  text-transform: uppercase;
}

.sched-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 600px) { .sched-times { grid-template-columns: repeat(2, 1fr); } }
.sched-time {
  background: transparent;
  border: 1px solid #1F1E1B;
  border-radius: 8px;
  padding: 12px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #EDE9DF;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 180ms ease;
}
.sched-time:hover:not(.is-busy) { border-color: #D9603B; color: #D9603B; }
.sched-time.is-active { background: #D9603B; border-color: #D9603B; color: #0B0B0B; }
.sched-time.is-busy { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.sched-tz {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid #1F1E1B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #9A968D;
  letter-spacing: 0.04em;
}

.sched-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.sched-btn {
  background: #D9603B;
  color: #0B0B0B;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.sched-btn:hover { background: #E8714A; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(217,96,59,0.4); }
.sched-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.sched-btn-ghost {
  background: transparent;
  color: #9A968D;
  border: 1px solid #1F1E1B;
}
.sched-btn-ghost:hover { color: #EDE9DF; border-color: #1F1E1B; background: transparent; box-shadow: none; }

.sched-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 540px) { .sched-form-grid { grid-template-columns: 1fr; } }
.sched-field { display: flex; flex-direction: column; gap: 6px; }
.sched-field-full { grid-column: 1 / -1; }
.sched-field input,
.sched-field textarea {
  background: #0B0B0B;
  border: 1px solid #1F1E1B;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #EDE9DF;
  outline: none;
  transition: border-color 200ms ease;
  font-feature-settings: 'ss01';
}
.sched-field input:focus,
.sched-field textarea:focus { border-color: #D9603B; }
.sched-field input::placeholder,
.sched-field textarea::placeholder { color: #6B6862; }
.sched-field textarea { resize: vertical; min-height: 84px; }
.sched-field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9A968D;
  font-weight: 600;
}

.sched-summary {
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid #1F1E1B;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #EDE9DF;
}
.sched-summary-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #7DB46C;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(125,180,108,0.6);
  animation: schedPulse 2s ease-out infinite;
}
@keyframes schedPulse {
  0% { box-shadow: 0 0 0 0 rgba(125,180,108,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(125,180,108,0); }
  100% { box-shadow: 0 0 0 0 rgba(125,180,108,0); }
}

.sched-success {
  text-align: center;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.sched-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(217,96,59,0.12);
  border: 1px solid #D9603B;
  color: #D9603B;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(217,96,59,0.3);
}
.sched-success-headline {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #EDE9DF;
  line-height: 1.1;
}
.sched-success-sub {
  color: #9A968D;
  font-size: 14px;
  line-height: 1.5;
  max-width: 36ch;
}

/* The live NeoReach sequence — visible proof of the product running */
.sched-sequence {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  position: relative;
}
.sched-sequence::before {
  /* Vertical thread connecting the dots */
  content: '';
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, rgba(217,96,59,0.45) 0%, rgba(31,30,27,0.6) 100%);
  z-index: 0;
}
.sched-seq-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.sched-seq-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #141414;
  border: 1px solid #1F1E1B;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}
.sched-seq-step.is-done .sched-seq-dot {
  background: #D9603B;
  border-color: #D9603B;
  box-shadow: 0 0 0 0 rgba(217,96,59,0.6);
  animation: schedSeqPulse 2s ease-out infinite;
}
.sched-seq-step.is-done .sched-seq-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #0B0B0B;
  border-radius: 50%;
}
@keyframes schedSeqPulse {
  0%   { box-shadow: 0 0 0 0 rgba(217,96,59,0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(217,96,59,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,96,59,0); }
}
@media (prefers-reduced-motion: reduce) {
  .sched-seq-step.is-done .sched-seq-dot { animation: none; }
}
.sched-seq-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  line-height: 1.3;
}
.sched-seq-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #EDE9DF;
  letter-spacing: -0.005em;
}
.sched-seq-step:not(.is-done) .sched-seq-title { color: #9A968D; }
.sched-seq-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6B6862;
}
.sched-seq-step.is-done .sched-seq-meta { color: #7DB46C; }

.sched-attribution {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6B6862;
  max-width: 38ch;
  line-height: 1.55;
  margin-top: 4px;
  margin-bottom: 8px;
}
.sched-attribution-link {
  color: #9A968D;
  border-bottom: 1px solid #1F1E1B;
  transition: color 180ms ease, border-color 180ms ease;
}
.sched-attribution-link:hover { color: #D9603B; border-bottom-color: #D9603B; }

@media (prefers-reduced-motion: reduce) {
  .sched-modal, .sched-card, .sched-step { transition: none; animation: none; }
  .sched-summary-dot { animation: none; }
}
