/* ============================================================================
   SERA reskin — overrides the NextSaaS "ai-application" demo tokens to the
   Sera v2 palette (see apps/client/src/v2/styles/theme.css).
   Loaded AFTER assets/main.css: same specificity, later declaration wins, so
   every utility that reads var(--color-*) recolours with no markup changes.
   Only CSS here — no new components.
   ============================================================================ */

:root {
  /* Brand ramp → pine green (was purple #864ffe) */
  --color-primary-50:  #f0f7f2;
  --color-primary-200: #bfe3cd;
  --color-primary-400: #4fae76;
  --color-primary-500: #166534;
  --color-primary-600: #14532d;

  /* Ink / secondary → graphite (was near-black #1a1a1c) */
  --color-secondary: #111827;

  /* Canvas → one flat site-wide background. Cards no longer separate from it
     via a shade difference — they carry their own stroke + shadow instead
     (see .sera-card below), so every "framed section" token below is set to
     the exact same value as the page background: no color-blocking. */
  --color-accent:        #fbfbfc;
  --color-background-1:  #fbfbfc;
  --color-background-2:  #fbfbfc;
  --color-background-3:  #eeeeec;
  --color-background-12: #fbfbfc;

  /* De-blue the dark surfaces toward neutral graphite */
  --color-background-5: #14181f;
  --color-background-6: #0f1319;
  --color-background-7: #171c24;
  --color-background-8: #080b0f;
  --color-background-9: #1e242d;

  /* Typeface → Tajawal everywhere (was Inter Tight for headings, system-ui
     for body). --font-inter-tight drives every h1-h6 in the kit's own CSS
     plus the couple spots the markup applies .font-inter-tight directly;
     --font-sans drives body text via --default-font-family. Overriding both
     to the same family covers the whole page from one place — no markup
     changes needed. Tajawal is loaded via the Google Fonts <link> in <head>
     (swapped in place of the old Inter Tight link). */
  --font-sans:         "Tajawal", ui-sans-serif, system-ui, sans-serif;
  --font-inter-tight:  "Tajawal", sans-serif;

  /* Sera accents (used by the rules below) */
  --sera-lime:      #39ff14;
  --sera-lime-soft: #eaffe3;
  --sera-pine:      #166534;
  --sera-graphite:  #111827;
  --sera-royal:     #080f89;
  --sera-ai-grad:   linear-gradient(150deg, #111827 0%, #0f2e1c 100%);
}

/* Tajawal's Latin glyphs are drawn with noticeably wide side-bearings — an
   intrinsic feature of the font's own glyph design, not CSS letter-spacing
   (there was none to begin with; `letter-spacing: normal` confirmed this
   did nothing). Compensating with negative tracking to visually tighten it
   back toward how Inter Tight (what this kit's heading CSS was tuned for)
   used to read. */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.03em !important;
}

/* ---------------------------------------------------------------------------
   Direction A — reskin the (already-framed) hero to the dark AI gradient.
   Hook class `.sera-hero` is added to the existing hero frame container.
   --------------------------------------------------------------------------- */
.sera-hero {
  background: var(--sera-ai-grad) !important;
  border-color: rgba(57, 255, 20, 0.16) !important;
  color: #e9efe9;
}
.sera-hero h1,
.sera-hero h1 * { color: #ffffff !important; }
.sera-hero p    { color: #b7c5bb !important; }

/* the decorative hairline + dots use light stroke-3 — dim on the dark frame */
.sera-hero [class*="bg-stroke-3"],
.sera-hero [class*="ring-stroke-3"] { opacity: 0.16 !important; }

/* soft pine + lime wash inside the frame (decorative, behind content) */
.sera-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 55% at 82% 14%, rgba(57, 255, 20, 0.14), transparent 60%),
    radial-gradient(60% 70% at 8% 92%, rgba(22, 101, 52, 0.40), transparent 60%);
}

/* a small lime accent for the hero eyebrow/tagline pill, if present */
.sera-hero [class*="text-primary"] { color: var(--sera-lime) !important; }

/* hero CTAs on the dark frame — ensure contrast + a clear primary/secondary hierarchy.
   "Browse templates" (btn-secondary-v2) → lime-outline ghost;
   "Start free" (btn-gray-v2) → solid white, graphite text (the primary action). */
.sera-hero .btn-secondary-v2 {
  background: transparent !important;
  color: #eaffe3 !important;
  box-shadow: inset 0 0 0 1.5px rgba(57, 255, 20, 0.5) !important;
}
.sera-hero .btn-gray-v2 {
  background: #ffffff !important;
  color: #111827 !important;
}

/* ---------------------------------------------------------------------------
   AI Engine tabs — the "About" section pattern (tab-bar / mobile tab-bar +
   4 tab-contents) ported in from the crypto-marketing demo, which uses these
   same shared kit components (main.js already drives the tab-switch logic
   site-wide). ai-application's own compiled CSS never generates these
   state-attribute utilities because that demo has no tabs UI, so they're
   reproduced here verbatim from crypto-marketing's compiled output.
   --------------------------------------------------------------------------- */
.data-\[mobile-active\=true\]\:scale-\[1\.05\][data-mobile-active="true"] {
  scale: 1.05;
}
.data-\[mobile-active\=true\]\:bg-primary-500[data-mobile-active="true"] {
  background-color: var(--color-primary-500);
}
.data-\[mobile-active\=true\]\:text-white[data-mobile-active="true"] {
  color: var(--color-white);
}
.data-\[state\=selected\]\:text-secondary[data-state="selected"] {
  color: var(--color-secondary);
}

/* ---------------------------------------------------------------------------
   Whole-site flat background. <body> ships hard-coded as .bg-white in the
   markup, which reads var(--color-white) — a fixed Tailwind token, not one
   of the overridable --color-background-* vars above — so it needs its own
   rule here to actually land on the same #fbfbfc as everything else.
   --------------------------------------------------------------------------- */
/* body.bg-white (not bare `body`) to out-specificity the kit's own .bg-white
   class rule (background-color: var(--color-white)) on the same element —
   an element selector alone loses that specificity fight regardless of
   source order. */
body.bg-white { background: #fbfbfc; }

/* ---------------------------------------------------------------------------
   Card stroke + shadow — cards sit on the flat #fbfbfc background above and
   need their own separation now that no section uses a darker bg-block.
   Border color reused from the kit's own --color-stroke-1 (already used by
   the testimonial cards); shadow values match the two-layer soft-shadow
   convention from the reference design (tight contact shadow + wide ambient
   falloff) rather than the kit's own heavier default card shadows.
   --------------------------------------------------------------------------- */
.sera-card {
  border: 1px solid var(--color-stroke-1);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 10px 30px rgba(17, 24, 39, 0.07);
}

/* ---------------------------------------------------------------------------
   Button hover fill: lime, not the dark pine used everywhere else. Scoped to
   only the hover/group-hover variants of these 4 kit classes — NOT the base
   --color-primary-500 token itself, which stays pine (badges, tab-bar
   indicator, icons, etc. all read it in their resting state and must not
   turn lime). Text + arrow go royal blue on the lime fill (white fails
   contrast on a bright lime background), outlined in the same royal, no
   drop shadow. The icon-only circular buttons' arrows were originally an
   external SVG file (fixed white fill, uncontrollable via CSS) — inlined
   into the markup as <svg><path fill="currentColor"> so `color` here drives
   them: white at rest (matches the dark bg-secondary circle), royal on
   hover/group-hover (matches the lime fill).
   --------------------------------------------------------------------------- */
a.hover\:bg-primary-500.group.bg-secondary,
a.group-hover\:bg-primary-500.group.bg-secondary {
  color: #ffffff;
}
.hover\:bg-primary-500:hover,
.group-hover\:bg-primary-500:is(:where(.group):hover *) {
  background-color: var(--sera-lime) !important;
  color: var(--sera-royal) !important;
  outline: 1px solid var(--sera-royal);
  outline-offset: -1px;
  box-shadow: none !important;
}
.hover\:btn-primary:hover {
  background-color: var(--sera-lime) !important;
  border-color: var(--sera-royal) !important;
  color: var(--sera-royal) !important;
  box-shadow: none !important;
}
.hover\:btn-primary:hover:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23080f89' viewBox='0 0 256 256'%3E%3Cpath d='M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z'%3E%3C/path%3E%3C/svg%3E") !important;
}
.group-hover\/btn-v2\:btn-primary-v2:is(:where(.group\/btn-v2):hover *) {
  background-color: var(--sera-lime) !important;
  color: var(--sera-royal) !important;
  outline: 1px solid var(--sera-royal) !important;
  outline-offset: -1px;
  box-shadow: none !important;
  transition: background-color 0.3s, color 0.3s !important;
}
.group-hover\/btn-v2\:btn-primary-v2:is(:where(.group\/btn-v2):hover *):focus,
.group-hover\/btn-v2\:btn-primary-v2:is(:where(.group\/btn-v2):hover *):focus-visible {
  outline: 1px solid var(--sera-royal) !important;
}
.group-hover\/btn-v2\:btn-primary-v2:is(:where(.group\/btn-v2):hover *) .btn-v2-icon {
  fill: var(--sera-royal) !important;
}

/* ---------------------------------------------------------------------------
   "How Sera works" 3-tile row. Middle tile (.bg-background-3, the card
   itself — distinguished from the two connector pills below by its own
   rounded-[20px] radius) keeps the dark hero gradient. The two outer tiles
   (.bg-ns-green) drop the green entirely: light-grey → mid-grey gradient,
   plus the same stroke + shadow every other card on the page uses
   (var(--color-stroke-1), .sera-card's shadow values) instead of a color
   block. Their text/icon color is NOT overridden — the kit's default dark
   text already reads fine against light grey — only the middle tile's text
   gets forced white, since it's the one staying dark.
   --------------------------------------------------------------------------- */
.sera-how-it-works .bg-ns-green {
  background: linear-gradient(150deg, #ffffff 0%, #f2f2f2 100%) !important;
  border: 1px solid var(--color-stroke-1);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 10px 30px rgba(17, 24, 39, 0.07);
}
.sera-how-it-works .bg-background-3.rounded-\[20px\] {
  background: var(--sera-ai-grad) !important;
}
.sera-how-it-works .bg-background-3.ring-white {
  background: #ffffff !important;
  --tw-ring-shadow: 0 0 0 1px var(--color-stroke-1) !important;
}
.sera-how-it-works .bg-background-3.rounded-\[20px\] .ns-shape-2 {
  color: #ffffff !important;
}
.sera-how-it-works .bg-background-3.rounded-\[20px\] h3 {
  color: #ffffff !important;
}
.sera-how-it-works .bg-background-3.rounded-\[20px\] .text-secondary\/60 {
  color: rgba(255, 255, 255, 0.65) !important;
}

/* ---------------------------------------------------------------------------
   Hide the NextSaaS kit's own "browse 40+ demos" launcher + overlay — kit-internal.
   --------------------------------------------------------------------------- */
#open-demo-showcase,
#demo-showcase { display: none !important; }

/* ── Sera: simplified chrome (elements kept in DOM so template JS still initializes) ── */
header nav.items-center.xl\:flex { display: none !important; }  /* hide primary menu items */
footer.footer-three { display: none !important; }               /* hide old template footer */

/* ── Sera: hide additional template chrome (DOM kept so JS still initializes) ── */
.sera-removed { display: none !important; }                                  /* hero CTAs, templates section */
div.logos-marquee-container[role="marquee"] { display: none !important; }    /* client "Logoipsum" logos strip */
a[href="./service-details.html"] { display: none !important; }               /* product-card arrow buttons */

/* ── Sera: remove top announcement/ad bar + pull header up ── */
.top-nav { display: none !important; }
header .header-one { top: 1.25rem !important; }

/* ── Sera: enlarge header pill by 20% (50px -> 60px) ── */
.sera-header-tall { height: 60px !important; }

/* ── Sera: hide extra mobile-menu items (keep Home, Pricing, Start free, Contact us) ── */
.sera-menu-hide { display: none !important; }

/* ── Sera: RTL layout support ───────────────────────────────────────────────
   Flexbox rows auto-mirror under dir="rtl" (native browser behavior), which
   covers most of the layout for free. These rules patch the remaining
   physical-direction utilities (hard text-align, transform translate-x used
   for icon slide animations, absolute left/right positioning) that don't
   auto-flip. Scoped to [dir="rtl"] so the English (LTR) page is untouched. */
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .btn-v2-icon { direction: ltr; }               /* keep slide-in icon animation math unmirrored */
[dir="rtl"] .group\/btn-v2 .relative.size-6 { direction: ltr; }
[dir="rtl"] .accordion-arrow svg { transform: scaleX(-1); }

/* ── Sera: black outline on all section eyebrow badges ── */
.badge { border: 1.5px solid #12161f; }

/* ── Sera: no sideways scroll on phones ──
   Scroll-reveal animations (data-ns-animate with data-direction/data-offset, and the
   feature-card fan) wait in their start position — shifted 70–100px sideways — until
   they scroll into view. On a phone that start position sits off-screen, which widened
   the RTL page (e.g. 450px on a 390px screen) and shifted the whole layout. Clip
   horizontal overflow at the page level; `clip` (unlike `hidden`) keeps sticky working. */
html,
body {
  overflow-x: clip;
}
@supports not (overflow-x: clip) {
  body {
    overflow-x: hidden;
  }
}

/* Language switcher (globe) hidden from the top nav for now; remove this rule to bring it back. */
#sera-lang-switcher { display: none !important; }

/* Home hero headline stays on one line; on small phones it scales with the screen instead of wrapping. */
.sera-hero-title { white-space: nowrap; }
@media (max-width: 639px) { .sera-hero-title { font-size: min(2rem, 7.6vw) !important; } }

/* Hero sign-in (below the hero subtitle): glass pill on the dark hero, lime arrow badge. */
.sera-hero-login-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 40px; margin-bottom: 28px; }
@media (min-width: 768px) { .sera-hero-login-wrap { margin-top: 48px; margin-bottom: 56px; } }
/* Pricing shortcut in the hero: only where the top nav collapses to the burger (below xl); on wide screens pricing stays in the nav. */
.sera-hero-pricing { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding-inline: 24px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); color: #fff !important; font-size: 17px; font-weight: 500; text-decoration: none; transition: border-color .25s, background .25s; }
.sera-hero-pricing:hover { border-color: var(--sera-lime); background: rgba(57,255,20,.08); }
.sera-hero-pricing:focus-visible { outline: 2px solid var(--sera-lime); outline-offset: 3px; }
.sera-hero-pricing-ic { display: grid; place-items: center; color: var(--sera-lime); }
.sera-hero-pricing-ic svg { width: 18px; height: 18px; }
@media (min-width: 1280px) { .sera-hero-pricing { display: none; } }
.sera-hero-login, .sera-hero-pricing { white-space: nowrap; }
@media (max-width: 639px) {
  .sera-hero-login-wrap { gap: 8px; }
  .sera-hero-login-q { display: none; }
  .sera-hero-login, .sera-hero-pricing { height: 46px; font-size: 16px; }
  .sera-hero-login { gap: 8px; padding-inline: 16px 5px; }
  .sera-hero-login-cta { font-size: 16px; }
  .sera-hero-login-ic { width: 36px; height: 36px; margin-inline-start: 0; }
  .sera-hero-pricing { padding-inline: 18px; }
}
.sera-hero-login { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding-inline: 22px 7px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22); color: #fff; text-decoration: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .25s, background .25s, transform .25s; }
.sera-hero-login:hover { border-color: var(--sera-lime); background: rgba(57,255,20,.08); transform: translateY(-1px); }
.sera-hero-login:focus-visible { outline: 2px solid var(--sera-lime); outline-offset: 3px; }
.sera-hero-login-q { color: rgba(255,255,255,.62); font-size: 16px; }
.sera-hero-login-cta { color: #fff !important; font-size: 17px; font-weight: 500; }
.sera-hero-login-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sera-lime); color: #0b1a05; margin-inline-start: 4px; transition: transform .25s; }
.sera-hero-login-ic svg { width: 18px; height: 18px; }
.sera-hero-login:hover .sera-hero-login-ic { transform: translateX(-3px); }
html[dir="ltr"] .sera-hero-login:hover .sera-hero-login-ic { transform: translateX(3px); }

/* Floating support button (WhatsApp), bottom-right on every page. */
.sera-support { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--sera-ai-grad); color: var(--sera-lime); box-shadow: 0 12px 30px rgba(15,46,28,.35), 0 0 0 1px rgba(57,255,20,.25); transition: transform .25s, box-shadow .25s; }
.sera-support svg { width: 26px; height: 26px; }
.sera-support::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(57,255,20,.45); animation: sera-support-ping 3.2s ease-out infinite; }
.sera-support:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(15,46,28,.42), 0 0 0 2px var(--sera-lime); }
.sera-support:focus-visible { outline: 2px solid var(--sera-lime); outline-offset: 3px; }
.sera-support-tip { position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(6px); white-space: nowrap; background: #111827; color: #fff;
  font-size: 15px; padding: 8px 14px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.sera-support:hover .sera-support-tip, .sera-support:focus-visible .sera-support-tip { opacity: 1; transform: translateY(-50%) translateX(0); }
@keyframes sera-support-ping { 0% { box-shadow: 0 0 0 0 rgba(57,255,20,.45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(57,255,20,0); } }
@media (prefers-reduced-motion: reduce) { .sera-support::after { animation: none; } }
@media (max-width: 639px) { .sera-support { right: 16px; bottom: 16px; width: 54px; height: 54px; } }

/* How-it-works connector arrows: the page reads right-to-left, so point (and slide) the arrows leftwards. */
.sera-how-it-works .icon-right-marquee-container { transform: rotate(180deg); }
