/* =========================================================================
   Edfly 360 — modern layer (loaded after style.css, public site only)
   Dark premium SaaS theme by default, light theme via the toggle.
   Brand: navy #01274e / cyan #5defff / yellow #f8b526.
   ========================================================================= */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #021a35;
  --bg-alt: #031f3f;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.10);
  --text: #b4c5d9;
  --heading: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f4f8fb;
  --card: #ffffff;
  --card-hover: #ffffff;
  --border: #e3eaf0;
  --text: #33506e;
  --heading: #01274e;
  --input-bg: #ffffff;
}

body { background: var(--bg); color: var(--text); transition: background .3s ease, color .3s ease; }
h1, h2, h3, h4, h5 { color: var(--heading); }
.muted, .section-head p, .card p { color: var(--text); opacity: .85; }

/* ---- Dark theme overrides for light-only components ---------------------- */
html[data-theme="dark"] .section--alt { background: var(--bg-alt); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .pricing-card:not(.featured),
html[data-theme="dark"] .stat-card {
  background: var(--card);
  border-color: var(--border);
  box-shadow: none;
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .card:hover { background: var(--card-hover); border-color: rgba(93,239,255,.35); }
html[data-theme="dark"] .testimonial-card blockquote,
html[data-theme="dark"] .accordion-trigger,
html[data-theme="dark"] .testimonial-author .name,
html[data-theme="dark"] .module-card .arrow,
html[data-theme="dark"] .pricing-card .price { color: var(--heading); }
html[data-theme="dark"] .accordion-panel-inner,
html[data-theme="dark"] .testimonial-author .role,
html[data-theme="dark"] .pricing-card .price span { color: var(--text); }
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .step { border-color: var(--border); }
html[data-theme="dark"] .accordion-trigger .plus::before,
html[data-theme="dark"] .accordion-trigger .plus::after { background: var(--accent-500); }
html[data-theme="dark"] .field label { color: var(--text); }
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  background: var(--input-bg); border-color: var(--border); color: var(--heading);
}
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .field textarea::placeholder { color: rgba(180,197,217,.5); }
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(93,239,255,.18); }
html[data-theme="dark"] .checkbox-pill { border-color: var(--border); }
html[data-theme="dark"] .checkbox-pill:has(input:checked) { background: rgba(93,239,255,.12); border-color: var(--accent-500); }
html[data-theme="dark"] .tab-btn { background: var(--card); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .tab-btn.active { background: var(--accent-500); border-color: var(--accent-500); color: #01274e; }
html[data-theme="dark"] .eyebrow { background: rgba(93,239,255,.08); color: var(--accent-500); border: 1px solid rgba(93,239,255,.25); }
html[data-theme="dark"] .icon-badge { background: rgba(93,239,255,.10); color: var(--accent-500); border: 1px solid rgba(93,239,255,.2); }
html[data-theme="dark"] .icon-badge.accent { background: rgba(93,239,255,.2); color: var(--accent-500); }
html[data-theme="dark"] .icon-badge.warm { color: var(--warm-500); }
html[data-theme="dark"] .check-icon { background: rgba(93,239,255,.16); color: var(--accent-500); }
html[data-theme="dark"] .btn-outline { color: var(--heading); border-color: var(--border); }
html[data-theme="dark"] .btn-outline:hover { background: rgba(255,255,255,.06); border-color: var(--accent-500); color: var(--accent-500); }
html[data-theme="dark"] .btn-primary { background: var(--accent-500); color: #01274e; box-shadow: 0 0 28px rgba(93,239,255,.35); }
html[data-theme="dark"] .btn-primary:hover { background: #fff; }
html[data-theme="dark"] .testimonial-controls button { background: var(--card); border-color: var(--border); color: var(--heading); }
html[data-theme="dark"] .logo-strip img { filter: grayscale(1) brightness(2.4); opacity: .45; }
html[data-theme="dark"] .rounded-media { box-shadow: 0 20px 60px rgba(0,0,0,.4); }
html[data-theme="dark"] .filter-pills a { border-color: var(--border); }

html[data-theme="dark"] .navbar { background: rgba(2,26,53,.82); }
html[data-theme="dark"] .cta-band { background: linear-gradient(135deg, #0a3866, #01274e); border: 1px solid var(--border); }

/* Light theme: nav/hero/footer stay brand navy, so nothing extra needed. */

/* ---- Scroll progress bar ------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-500), var(--warm-500));
  z-index: 300; pointer-events: none;
}

/* ---- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .3s var(--ease);
}
.theme-toggle:hover { background: rgba(93,239,255,.18); transform: rotate(18deg); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: inline; }

/* Compact nav on small screens: the three action buttons are too wide */
@media (max-width: 899px) { .nav-actions .btn { display: none; } }

/* ---- Hero (modern) -------------------------------------------------------- */
.hero.hero--modern { background: #01152b; }
.hero--modern::before {
  background:
    radial-gradient(45% 55% at 85% 5%, rgba(93,239,255,.28), transparent 65%),
    radial-gradient(40% 50% at 8% 95%, rgba(248,181,38,.14), transparent 60%),
    linear-gradient(180deg, #01152b 0%, #022247 100%);
}
.hero--modern .container { padding-block: 72px 56px; }
.hero--modern h1 {
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  letter-spacing: -0.035em;
}
.grad-text {
  background: linear-gradient(100deg, var(--accent-500) 10%, #a8f5ff 45%, var(--warm-500) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}
.orb-1 { width: 340px; height: 340px; background: rgba(93,239,255,.35); top: -80px; right: 8%; }
.orb-2 { width: 260px; height: 260px; background: rgba(248,181,38,.22); bottom: -60px; left: 4%; animation-delay: -6s; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-40px,30px,0) scale(1.15); } }

.hero-rotator { display: inline-block; position: relative; min-width: 1ch; }
.hero-rotator .caret { display: inline-block; width: 3px; height: .9em; background: var(--accent-500); margin-left: 4px; vertical-align: -0.05em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-media .device-frame { transform-style: preserve-3d; transition: transform .15s ease-out; will-change: transform; }
.hero-media .floating-card { z-index: 2; }
.floating-card.card-3 { top: 48%; left: -10%; animation-delay: 1.8s; }

/* Hero mini stats */
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; }
.hero-points span { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-on-dark-muted); }
.hero-points svg { color: var(--accent-500); width: 15px; height: 15px; }

/* ---- Marquee -------------------------------------------------------------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; align-items: center; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img { height: 44px; width: auto; filter: grayscale(1); opacity: .55; transition: all .2s ease; }
html[data-theme="dark"] .marquee-track img { filter: grayscale(1) brightness(2.4); opacity: .5; }
.marquee-track img:hover { filter: none !important; opacity: 1; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Bento module grid ----------------------------------------------------- */
.bento { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .bento { grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(190px, auto); }
  .bento .b-wide { grid-column: span 2; }
  .bento .b-tall { grid-row: span 2; }
}
.bento-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  padding: 26px; border-radius: var(--radius-lg);
  background: var(--card); border: 1px solid var(--border);
  transition: transform .35s var(--ease), border-color .3s ease, background .3s ease;
}
.bento-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(93,239,255,.16), transparent 70%);
}
.bento-card:hover { transform: translateY(-4px); border-color: rgba(93,239,255,.4); }
.bento-card:hover::before { opacity: 1; }
.bento-card h3 { font-size: 1.1rem; margin: 6px 0 0; }
.bento-card p { font-size: .88rem; margin: 0; opacity: .85; }
.bento-card .b-num { position: absolute; top: 20px; right: 22px; font-family: var(--font-display); font-size: .8rem; letter-spacing: .08em; color: var(--accent-500); opacity: .7; }
.bento-card .b-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.bento-card .b-feats li { font-size: .72rem; padding: 4px 10px; border-radius: 999px; background: rgba(93,239,255,.08); border: 1px solid rgba(93,239,255,.18); color: var(--text); }
.bento-card .arrow { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--accent-500); display: inline-flex; align-items: center; gap: 6px; }
html[data-theme="light"] .bento-card .arrow, html[data-theme="light"] .bento-card .b-num { color: #0a6a85; }
html[data-theme="light"] .bento-card { box-shadow: var(--shadow-sm); }
html[data-theme="light"] .bento-card .b-feats li { background: #eafcff; border-color: #cdf5ff; }

/* ---- Interactive product tour --------------------------------------------- */
.tour { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .tour { grid-template-columns: 1fr 360px; } }
.tour-list { display: flex; flex-direction: column; gap: 10px; }
.tour-item {
  text-align: left; cursor: pointer; width: 100%;
  padding: 18px 20px; border-radius: var(--radius-md);
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  transition: all .25s var(--ease); position: relative; overflow: hidden;
}
.tour-item h4 { margin: 0 0 4px; font-size: 1.02rem; }
.tour-item p { margin: 0; font-size: .88rem; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s var(--ease), opacity .3s ease; }
.tour-item.active { border-color: rgba(93,239,255,.5); background: var(--card-hover); }
.tour-item.active p { max-height: 80px; opacity: .9; }
.tour-item .tour-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent-500); }
.tour-item.active .tour-bar { animation: tourbar var(--tour-ms, 5000ms) linear forwards; }
@keyframes tourbar { to { width: 100%; } }
.tour-stage { position: relative; max-width: 340px; margin-inline: auto; }
.tour-stage .device-frame { max-width: 340px; }
.tour-stage img { transition: opacity .35s ease, transform .35s var(--ease); }
.tour-stage img.swap { opacity: 0; transform: scale(.98); }
.tour-stage::before {
  content: ''; position: absolute; inset: 10% -10%; z-index: -1;
  background: radial-gradient(closest-side, rgba(93,239,255,.28), transparent 70%);
}

/* ---- Role tabs ------------------------------------------------------------ */
.role-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.role-panel { display: none; animation: fadeUp .5s var(--ease); }
.role-panel.active { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .role-panel.active { grid-template-columns: 1fr 1fr; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- Workflow timeline ----------------------------------------------------- */
.flow { display: grid; gap: 18px; position: relative; }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, 1fr); }
  .flow::before { content: ''; position: absolute; top: 34px; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-500), var(--warm-500), transparent); opacity: .5; }
}
.flow-step { text-align: center; position: relative; padding: 0 8px; }
.flow-dot {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid rgba(93,239,255,.4); color: var(--accent-500);
  box-shadow: 0 0 0 6px rgba(93,239,255,.08), 0 0 30px rgba(93,239,255,.18);
  position: relative; z-index: 1;
}
html[data-theme="light"] .flow-dot { color: #0a6a85; }
.flow-dot svg { width: 28px; height: 28px; }
.flow-step h3 { font-size: 1.05rem; }
.flow-step p { font-size: .88rem; }

/* ---- Chat widget ------------------------------------------------------------ */
.chat-fab {
  position: fixed; right: 22px; bottom: 90px; z-index: 95;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-500), #2fd6ea); color: #01274e;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(93,239,255,.4);
  transition: transform .25s var(--ease);
}
.chat-fab:hover { transform: scale(1.08); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab .dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--warm-500); border: 2px solid #021a35; }
.chat-panel {
  position: fixed; right: 22px; bottom: 156px; z-index: 96;
  width: min(360px, calc(100vw - 32px)); max-height: min(560px, 70vh);
  display: flex; flex-direction: column; overflow: hidden;
  background: #03213f; color: #d6e3f2; border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  transition: all .3s var(--ease);
}
.chat-panel.open { opacity: 1; visibility: visible; transform: none; }
.chat-head { padding: 16px 18px; display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #0a3866, #01274e); border-bottom: 1px solid rgba(255,255,255,.1); }
.chat-head strong { color: #fff; font-family: var(--font-display); }
.chat-head small { display: block; color: rgba(255,255,255,.6); font-size: .75rem; }
.chat-head .online { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }
.chat-close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: .7; }
.chat-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .88rem; line-height: 1.45; animation: fadeUp .3s var(--ease); }
.msg.bot { background: rgba(255,255,255,.08); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--accent-500); color: #01274e; font-weight: 500; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-opts button {
  padding: 8px 14px; border-radius: 999px; font-size: .82rem; cursor: pointer;
  background: transparent; color: var(--accent-500); border: 1px solid rgba(93,239,255,.5);
  transition: all .2s ease; font-family: inherit;
}
.chat-opts button:hover { background: var(--accent-500); color: #01274e; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.chat-input input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: .88rem; font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--accent-500); }
.chat-input button { padding: 0 18px; border-radius: 999px; border: 0; background: var(--accent-500); color: #01274e; font-weight: 700; cursor: pointer; font-family: inherit; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-4px); opacity: 1; } }

/* ---- Motion preferences ------------------------------------------------------ */
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

/* ---- Inner-page fixes: keep text readable in both themes ---------------------- */
.step-number { box-shadow: 0 0 0 4px rgba(93,239,255,.12); }
html[data-theme="dark"] .step-number { background: var(--accent-500); color: #01274e; }
html[data-theme="dark"] .page-header + .section .lead,
html[data-theme="dark"] .lead { color: var(--text); }
html[data-theme="dark"] .hero .lead { color: var(--text-on-dark-muted); }
html[data-theme="dark"] .badge.status-new { background: var(--card); color: var(--text); }

/* Page headers and CTA bands are always navy, so their text must stay light in both themes */
.page-header .muted, .page-header p, .cta-band p { color: var(--text-on-dark-muted); opacity: 1; }
.cta-band p { color: rgba(255,255,255,.9); }

/* Stacked cards beside the Holistic Progress Report copy */
.flow--vertical { display: grid; grid-template-columns: 1fr; gap: 16px; }
.flow--vertical::before { display: none; }

/* Client logos: full colour on white tiles so they read on both themes */
.marquee-track { gap: 20px; padding-block: 6px; }
.marquee-track img,
html[data-theme="dark"] .marquee-track img {
  height: 64px; width: 150px; object-fit: contain;
  background: #fff; padding: 10px 16px; border-radius: 14px;
  filter: none; opacity: .92;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.marquee-track img:hover { opacity: 1; transform: translateY(-2px); }

/* ---- Promo videos ------------------------------------------------------------- */
.videos { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .videos { grid-template-columns: 1.8fr 1fr; } }
.video-play, .video-stage iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0;
  border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 0 0 1px var(--border);
}
.video-play img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .3s ease; }
.video-play:hover img { transform: scale(1.04); opacity: .85; }
.video-play-icon {
  position: absolute; inset: 0; margin: auto; width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-500); color: #01274e; box-shadow: 0 0 0 10px rgba(93,239,255,.25), 0 10px 40px rgba(93,239,255,.5);
  animation: pulse-ring 2.4s infinite;
}
.video-play-icon svg { width: 34px; height: 34px; margin-left: 4px; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 18px rgba(93,239,255,0), 0 10px 40px rgba(93,239,255,.5); } }
.video-title { margin: 14px 4px 0; font-family: var(--font-display); font-weight: 600; color: var(--heading); font-size: 1.05rem; }
.video-list { display: flex; flex-direction: column; gap: 10px; }
.video-item {
  display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer; width: 100%;
  padding: 8px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: .9rem; font-weight: 500;
  transition: all .25s var(--ease);
}
.video-item img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.video-item:hover, .video-item.active { border-color: rgba(93,239,255,.5); background: var(--card-hover); color: var(--heading); }
