/* WorkLift shared styles — hand-written CSS layered on top of Tailwind utilities.
   Covers things Tailwind's CDN build can't express: gradient washes, mockup
   components (chat/call/browser chrome), and accessibility primitives. */

:root {
  --navy: #042C53;
  --teal: #1D9E75;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Accessibility primitives ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

a, button, input, textarea, select, [tabindex] {
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Gradient wash (hero backdrop, brand equivalent of the
   Stripe-style abstract sweep — restrained, not decorative-only) ---------- */

.wl-gradient-wash {
  background:
    radial-gradient(60% 80% at 85% 15%, rgba(29, 158, 117, 0.16) 0%, rgba(29, 158, 117, 0) 60%),
    radial-gradient(50% 70% at 100% 60%, rgba(4, 44, 83, 0.10) 0%, rgba(4, 44, 83, 0) 65%);
}

.wl-gradient-dark {
  background: linear-gradient(135deg, #042C53 0%, #06355F 55%, #0B4A73 100%);
}

.wl-gradient-sweep {
  background: conic-gradient(from 210deg at 30% 30%, #1D9E75, #042C53, #0B4A73, #1D9E75);
  filter: blur(60px);
  opacity: 0.35;
}

/* ---------- Mockup: browser chrome card (dashboard / scheduling views) ---------- */

.wl-browser {
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 60px -15px rgba(4, 44, 83, 0.25);
  overflow: hidden;
  border: 1px solid rgba(4, 44, 83, 0.08);
}

/* Thick navy bezel around .wl-browser, echoing the phone mockup's frame
   treatment — used where a panel needs to read as a bolder, more
   deliberate "device" rather than a plain bordered card. */
.wl-browser-frame {
  background: var(--navy);
  border-radius: 1.75rem;
  padding: 0.875rem;
  box-shadow: 0 25px 65px -15px rgba(4, 44, 83, 0.4);
}

.wl-browser-frame .wl-browser {
  border: none;
  box-shadow: none;
}

.wl-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  background: #F3F5F7;
  border-bottom: 1px solid rgba(4, 44, 83, 0.06);
}

.wl-browser-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #D7DCE1;
}

/* ---------- Mockup: email client (inbox list + reading pane) ---------- */

.wl-email-scroll {
  height: 520px;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
}

.wl-email-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.wl-email-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.5rem 0.5rem;
  transition: background-color 200ms ease-out, box-shadow 200ms ease-out;
}

.wl-email-item-active {
  background: #EAFAF4;
  box-shadow: inset 3px 0 0 var(--teal);
}

.wl-email-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--teal);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.wl-email-item-dot.wl-visible {
  opacity: 1;
}

.wl-email-sending {
  font-size: 0.8125rem;
  font-style: italic;
  color: rgba(4, 44, 83, 0.45);
  animation: wl-pulse 1.4s ease-in-out infinite;
}

/* ---------- Mockup: phone frame (SMS conversation) ---------- */

.wl-phone {
  width: 260px;
  border-radius: 2.25rem;
  background: #0B1B2B;
  padding: 0.5rem;
  box-shadow: 0 25px 65px -15px rgba(4, 44, 83, 0.35);
}

.wl-phone-screen {
  background: #F7F9FA;
  border-radius: 1.75rem;
  overflow: hidden;
  height: 480px;
  display: flex;
  flex-direction: column;
}

.wl-thread {
  scrollbar-width: none; /* Firefox */
}

.wl-thread::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.wl-bubble {
  max-width: 82%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.wl-bubble-in {
  background: #E9EDF1;
  color: var(--navy);
  border-bottom-left-radius: 0.25rem;
  align-self: flex-start;
}

.wl-bubble-out {
  background: var(--teal);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
  align-self: flex-end;
}

/* System note (missed-call follow-up, "later that day" beat divider) */
.wl-note {
  align-self: center;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(4, 44, 83, 0.4);
  padding: 0.125rem 0.5rem;
  max-width: 92%;
}

/* Inline confirmation card (appointment booked) */
.wl-inline-card {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #fff;
  border: 1px solid rgba(4, 44, 83, 0.08);
  border-radius: 0.875rem;
  padding: 0.625rem 0.875rem;
  margin: 0.125rem 0;
  box-shadow: 0 10px 26px -12px rgba(4, 44, 83, 0.3);
}

/* Escalation flag — deliberately navy (brand chrome), not an arbitrary
   alert color, so "escalated" still reads as governed rather than broken */
.wl-flag {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: var(--navy);
  border-radius: 0.875rem;
  border-bottom-left-radius: 0.25rem;
  padding: 0.75rem 0.875rem;
  align-self: flex-start;
  max-width: 90%;
  box-shadow: 0 12px 30px -12px rgba(4, 44, 83, 0.45);
}

/* ---------- Function showcase: rotating step list + swapping visual panel
   (homepage "Five jobs" section). Driven by initFunctionShowcase in main.js. ---------- */

.wl-fn-section {
  background: linear-gradient(160deg, #042C53 0%, #06355F 55%, #0B4A73 100%);
}

.wl-fn-item {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 9999px;
  padding: 1rem 1.75rem;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transition: background-color 200ms ease-out;
}

.wl-fn-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
}

.wl-fn-item.active {
  background: #fff;
}

/* Two-tone sweep: a teal-tinted "elapsed" zone animates across the white
   pill left-to-right, echoing a reading-progress wipe rather than a plain
   bar underneath the text. */
.wl-fn-item-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #D3F3E6; /* teal-100 */
  z-index: 0;
  border-radius: inherit;
}

.wl-fn-item-content {
  position: relative;
  z-index: 1;
  display: block;
}

.wl-fn-item-title {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.25rem;
  transition: color 200ms ease-out;
}

.wl-fn-item.active .wl-fn-item-title {
  color: var(--navy);
}

.wl-fn-item-desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 250ms ease-out, opacity 200ms ease-out, color 200ms ease-out;
}

.wl-fn-item.active .wl-fn-item-desc {
  max-height: 3rem;
  opacity: 1;
  margin-top: 0.125rem;
  color: rgba(4, 44, 83, 0.65);
}

/* Brand chrome bar variant — used only for this showcase's panel, where a
   bold gradient strip (rather than the neutral gray bar used by the
   email/SMS demo mockups) matches the reference's vivid app-frame look. */
.wl-browser-bar-brand {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  background: linear-gradient(90deg, #042C53 0%, #1D9E75 140%);
  border-bottom: 1px solid rgba(4, 44, 83, 0.1);
}

.wl-browser-dot-brand {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.5);
}

/* Crossfading panel stage: panels stack via absolute positioning inside a
   fixed-height stage so switching never causes a layout jump, and each
   panel fades + rises in on activation instead of popping in instantly. */
.fn-panel-stage {
  position: relative;
  min-height: 320px;
}

.fn-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 350ms ease-out, transform 350ms ease-out;
  pointer-events: none;
}

.fn-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------- Function showcase, card variant (Front Desk page "Five jobs"
   section). Same rotating/crossfade mechanic as .wl-fn-item on the
   homepage, deliberately different visual treatment: numbered white cards
   on a light background with a slim progress bar, instead of dark pills
   with a two-tone sweep. Driven by the same initFunctionShowcase in
   main.js, just pointed at these selectors. ---------- */

.wl-fd-fn-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid rgba(4, 44, 83, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

.wl-fd-fn-item:hover:not(.active) {
  border-color: rgba(4, 44, 83, 0.2);
}

.wl-fd-fn-item.active {
  border-color: var(--teal);
  box-shadow: 0 14px 30px -14px rgba(4, 44, 83, 0.2);
}

.wl-fd-fn-number {
  flex-shrink: 0;
  width: 2.25rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.2;
  color: rgba(4, 44, 83, 0.15);
  transition: color 200ms ease-out;
}

.wl-fd-fn-item.active .wl-fd-fn-number {
  color: var(--teal);
}

.wl-fd-fn-content {
  flex: 1;
  min-width: 0;
}

.wl-fd-fn-title {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

.wl-fd-fn-desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(4, 44, 83, 0.55);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 250ms ease-out, opacity 200ms ease-out;
}

.wl-fd-fn-item.active .wl-fd-fn-desc {
  max-height: 3rem;
  opacity: 1;
  margin-top: 0.25rem;
}

/* Slim progress bar along the bottom edge, in place of the pill sweep */
.wl-fd-fn-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: var(--teal);
}

/* ---------- Scripted demo: step reveal + typing indicator ----------
   Driven by assets/js/main.js. Each .wl-step starts hidden and gets
   .wl-visible added in sequence; prefers-reduced-motion users get the
   final state immediately (see main.js), so this transition never
   blocks them. */

.wl-step {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms ease-out, transform 250ms ease-out;
}

.wl-step.wl-visible {
  opacity: 1;
  transform: translateY(0);
}

.wl-card-hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.wl-card-hidden.wl-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wl-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  border-bottom-right-radius: 0.25rem;
  background: var(--teal);
  align-self: flex-end;
}

.wl-typing.wl-visible {
  display: inline-flex;
}

.wl-typing span {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  animation: wl-typing-dot 1s ease-in-out infinite;
}

.wl-typing span:nth-child(2) { animation-delay: 0.15s; }
.wl-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wl-typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-step, .wl-card-hidden {
    transition: none;
  }
  .wl-typing span {
    animation: none;
  }
}

/* ---------- Floating card composition ---------- */

.wl-float-card {
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 45px -12px rgba(4, 44, 83, 0.28);
  border: 1px solid rgba(4, 44, 83, 0.06);
}

/* ---------- Motion: micro-interactions only, 150-300ms, no continuous
   decorative animation (per ux-guidelines search) ---------- */

.wl-rise {
  animation: wl-rise 400ms ease-out both;
}

@keyframes wl-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.wl-pulse-dot {
  animation: wl-pulse 1.8s ease-in-out infinite;
}

@keyframes wl-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Disclosure (native <details>/<summary> — FAQ, plan detail
   panels). No JS: keyboard/screen-reader behavior comes free from the
   element itself; this just replaces the default marker with a chevron
   that rotates on [open]. ---------- */

.wl-disclosure summary {
  list-style: none;
  cursor: pointer;
}

.wl-disclosure summary::-webkit-details-marker {
  display: none;
}

.wl-disclosure-chevron {
  transition: transform 200ms ease-out;
}

.wl-disclosure[open] .wl-disclosure-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .wl-disclosure-chevron {
    transition: none;
  }
}

/* ---------- Honeypot (spam trap) ----------
   Off-screen and out of tab order so real visitors never see or reach it;
   aria-hidden keeps it out of the accessibility tree entirely so screen
   reader users never encounter it. A naive bot script filling every field
   it finds will fill this one too, flagging the submission as spam. */
.wl-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mobile nav — scoped to below the md breakpoint so it can never
   out-specificity Tailwind's `md:hidden` and double up with the desktop bar */
@media (max-width: 767.98px) {
  #mobile-menu {
    display: none;
  }
  #mobile-menu.open {
    display: block;
  }
}
