/* ============================================================================
   LightCloudCRM Solutions — project styles
   Plain CSS (works with both the Tailwind Play CDN and the compiled build).
   Houses the exact brand tokens, component classes, brand gradients, motion
   fallbacks, accessibility helpers and the chatbot widget.
   ========================================================================== */

/* ---- Exact brand tokens (sampled from the logo) -------------------------- */
:root {
  --navy:        #14315F;
  --blue:        #24549C; /* PRIMARY */
  --blue-bright: #1FA2D6;
  --white:       #FFFFFF;
  --surface:     #F4F8FC;
  --ink:         #0F2547;
  --muted:       #5B6B85;
  --yellow:      #FFC83D; /* ACCENT */
  --gold:        #FCCC6C;
  --orange:      #FB8C3C;
  --coral:       #F94C3C;
  --danger-text: #B5281B; /* AA-contrast red for TEXT on white (coral itself is <4.5:1) */

  --grad-cool: linear-gradient(135deg, #24549C 0%, #1FA2D6 100%);
  --grad-warm: linear-gradient(135deg, #FFC83D 0%, #FB8C3C 60%, #F94C3C 100%);

  --shadow-soft: 0 4px 24px rgba(20, 49, 95, .08);
  --shadow-lift: 0 18px 50px rgba(20, 49, 95, .16);

  --radius-lg: 16px;
  --radius-xl: 24px;
  --header-h: 72px;

  /* Typography: Plus Jakarta Sans (display/headings) + Inter (body/UI). */
  --font-display: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --font-sans:    Inter, system-ui, sans-serif;
}

/* ---- Base ---------------------------------------------------------------- */
* { scroll-margin-top: calc(var(--header-h) + 16px); }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(36, 84, 156, .15); }
img { max-width: 100%; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.015em; }

/* Layout container full width with comfortable gutters. */
.container-page { width: 100%; max-width: 100%; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 1024px) { .container-page { padding-inline: 2rem; } }

/* ---- Accessibility helpers ---------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -120%);
  z-index: 100; background: var(--blue); color: #fff; padding: .65rem 1.25rem;
  border-radius: 0 0 12px 12px; font-weight: 600; transition: transform .2s ease;
}
.skip-link:focus { transform: translate(-50%, 0); outline: 3px solid var(--yellow); }

/* Consistent, visible focus ring for keyboard users. */
.focus-ring:focus-visible,
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(36, 84, 156, 1);
  outline-offset: 2px;
}

/* ---- Header ------------------------------------------------------------- */
[data-header] { background: transparent; }
[data-header].is-scrolled {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 rgba(20, 49, 95, .06), 0 10px 30px rgba(20, 49, 95, .06);
}

.nav-link {
  position: relative; padding: .5rem .9rem; border-radius: 10px;
  font-weight: 500; color: var(--ink); font-size: .95rem;
  transition: color .15s ease, background-color .15s ease;
}
.nav-link:hover { color: var(--blue); background: rgba(36, 84, 156, .06); }
.nav-link.is-active { color: var(--blue); font-weight: 600; }
.nav-link.is-active::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .15rem;
  height: 3px; border-radius: 99px; background: var(--yellow);
}

.mobile-link {
  display: block; padding: .85rem 1rem; border-radius: 12px;
  font-weight: 600; color: var(--ink); font-size: 1.05rem;
}
.mobile-link:hover { background: var(--surface); }
.mobile-link.is-active { color: var(--blue); background: rgba(36, 84, 156, .08); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  line-height: 1; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: 0.7; pointer-events: none; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(36, 84, 156, .28); }
.btn-primary:hover { background: var(--navy); box-shadow: var(--shadow-lift); }
.btn-accent { background: var(--yellow); color: var(--ink); box-shadow: 0 6px 18px rgba(255, 200, 61, .35); }
.btn-accent:hover { background: var(--gold); box-shadow: 0 10px 26px rgba(251, 140, 60, .4); }
.btn-ghost { background: transparent; color: var(--blue); border-color: rgba(36, 84, 156, .25); }
.btn-ghost:hover { background: rgba(36, 84, 156, .06); border-color: var(--blue); }
.btn-white { background: #fff; color: var(--blue); box-shadow: var(--shadow-soft); }
.btn-white:hover { background: var(--surface); box-shadow: var(--shadow-lift); }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.02rem; }

/* ---- Brand gradients & decorative washes -------------------------------- */
.bg-cool { background: var(--grad-cool) !important; }
.bg-warm { background: var(--grad-warm) !important; }
.text-gradient {
  background: var(--grad-cool); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.text-gradient-warm {
  background: var(--grad-warm); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Soft hero wash echoing the logo swirl (cool + warm blobs on light bg). */
.hero-wash { position: relative; overflow: clip; isolation: isolate; }
.hero-wash::before, .hero-wash::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(64px); opacity: .55; pointer-events: none;
}
.hero-wash::before {
  width: 42rem; height: 42rem; top: -14rem; right: -10rem;
  background: radial-gradient(circle at 30% 30%, rgba(31, 162, 214, .55), rgba(36, 84, 156, 0) 70%);
}
.hero-wash::after {
  width: 36rem; height: 36rem; bottom: -16rem; left: -10rem;
  background: radial-gradient(circle at 60% 40%, rgba(255, 200, 61, .5), rgba(251, 140, 60, 0) 70%);
}

/* Floating decorative blobs (animated gently in JS). */
.blob { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; z-index: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 600;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
}
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: var(--yellow); border-radius: 2px; }

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: #fff; border: 1px solid rgba(20, 49, 95, .15); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card-hover { cursor: pointer; }
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: rgba(31, 162, 214, .35); }

.icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 14px; color: #fff; background: var(--blue);
  box-shadow: 0 8px 20px rgba(36, 84, 156, .3);
}
.pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem;
  border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .01em;
}
.pill-blue { background: rgba(36, 84, 156, .1); color: var(--blue); }
.pill-yellow { background: rgba(255, 200, 61, .22); color: #8a6400; }

/* ---- Footer ------------------------------------------------------------- */
.footer-heading { color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-link { color: rgba(255, 255, 255, .72); transition: color .15s ease; }
.footer-link:hover { color: #fff; }
.social-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  border-radius: 12px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85);
  transition: background-color .2s ease, transform .2s ease;
}
.social-dot:hover { background: var(--blue-bright); color: #fff; transform: translateY(-2px); }

/* ---- Forms -------------------------------------------------------------- */
.form-label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .4rem; }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid rgba(20, 49, 95, .16); border-radius: 12px;
  padding: .75rem .9rem; font-size: .98rem; color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--blue-bright); box-shadow: 0 0 0 4px rgba(31, 162, 214, .15); outline: none;
}
.form-input.is-invalid, .form-textarea.is-invalid, .form-select.is-invalid { border-color: var(--coral); }
.field-error { color: var(--danger-text); font-size: .82rem; margin-top: .35rem; min-height: 1rem; }
/* Required-field marker. Uses the AA-contrast red, not raw coral, so it stays
   legible (>=4.5:1) on white per WCAG 2.1 AA. */
.req { color: var(--danger-text); font-weight: 700; }
.form-textarea { resize: vertical; min-height: 7rem; }

/* Honeypot — visually hidden but present for bots. */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Inline form status banners. */
.form-banner { border-radius: 12px; padding: .85rem 1rem; font-weight: 500; font-size: .92rem; }
.form-banner.is-success { background: rgba(36, 84, 156, .08); color: var(--blue); border: 1px solid rgba(36, 84, 156, .2); }
.form-banner.is-error { background: rgba(249, 76, 60, .08); color: #b5281b; border: 1px solid rgba(249, 76, 60, .25); }

.newsletter-msg.is-success { color: var(--gold); }
.newsletter-msg.is-error { color: #ffd2cd; }

/* ---- Accordion (FAQ / roles) ------------------------------------------- */
.accordion-item { border-bottom: 1px solid rgba(20, 49, 95, .1); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 0; text-align: left; font-weight: 600; color: var(--ink); font-size: 1.05rem; cursor: pointer;
}
.accordion-trigger .chevron { transition: transform .25s ease; color: var(--blue); flex-shrink: 0; }
.accordion-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.accordion-panel { overflow: hidden; height: 0; transition: height .3s ease; }
.accordion-panel-inner { padding-bottom: 1.4rem; color: var(--muted); }

/* ---- Scroll-reveal motion ----------------------------------------------- */
/* Only hide when JS is active (graceful no-JS degradation keeps content visible). */
.js [data-reveal] { opacity: 0; transform: translateY(24px); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Marquee / logo cloud */
.logo-cloud { filter: grayscale(1); opacity: .55; transition: opacity .2s ease, filter .2s ease; }
.logo-cloud:hover { filter: grayscale(0); opacity: 1; }

/* ---- Article body (trusted authored HTML) ------------------------------- */
.article-body { color: #28384f; font-size: 1.08rem; line-height: 1.75; }
.article-body > * + * { margin-top: 1.25rem; }
.article-body h2 { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--ink); margin-top: 2.5rem; }
.article-body h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); margin-top: 2rem; }
.article-body p { color: #28384f; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.article-body ul { list-style: none; padding-left: 0; display: grid; gap: .6rem; }
.article-body ul li { position: relative; padding-left: 1.75rem; }
.article-body ul li::before { content: ""; position: absolute; left: 0; top: .55em; width: .75rem; height: .75rem; border-radius: 3px; background: var(--blue); }
.article-body strong { color: var(--ink); }
.article-body blockquote { border-left: 3px solid var(--yellow); padding-left: 1.25rem; font-style: italic; color: var(--muted); }

/* ---- Chatbot ------------------------------------------------------------ */
.chat-launcher {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 70;
  width: 60px; height: 60px; border-radius: 50%; color: #fff; background: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(36, 84, 156, .45); cursor: pointer; border: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-lift); }
.chat-launcher__pulse {
  position: absolute; inset: 0; border-radius: 50%; background: var(--blue-bright);
  z-index: -1; animation: chatPulse 2.4s ease-out infinite;
}
@keyframes chatPulse { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(1.7); opacity: 0; } }

.chat-panel {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: calc(clamp(1rem, 3vw, 2rem) + 74px);
  z-index: 71; width: min(370px, calc(100vw - 2rem)); height: min(600px, calc(100vh - 120px));
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lift), 0 0 0 1px rgba(20, 49, 95, .06);
  display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
}
.chat-panel[hidden] { display: none; }
.chat-panel__header {
  background: var(--blue); padding: 1rem 1.1rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; color: #fff;
}
.chat-avatar { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .18); display: inline-flex; align-items: center; justify-content: center; }
.chat-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #46d6a0; box-shadow: 0 0 0 3px rgba(70, 214, 160, .25); }
.chat-icon-btn { color: #fff; opacity: .85; padding: .35rem; border-radius: 8px; }
.chat-icon-btn:hover { opacity: 1; background: rgba(255, 255, 255, .15); }

.chat-panel__messages { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .75rem; background: var(--surface); }
.chat-bubble { max-width: 85%; padding: .7rem .9rem; border-radius: 16px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.chat-bubble a { text-decoration: underline; }
.chat-bubble--bot { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid rgba(20, 49, 95, .08); border-bottom-left-radius: 4px; }
.chat-bubble--user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-typing { align-self: flex-start; background: #fff; border: 1px solid rgba(20, 49, 95, .08); border-radius: 16px; border-bottom-left-radius: 4px; padding: .8rem 1rem; display: inline-flex; gap: 4px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: chatDot 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatDot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat-panel__starters { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.1rem .75rem; background: var(--surface); }
.chat-starter { font-size: .82rem; font-weight: 500; color: var(--blue); background: rgba(36, 84, 156, .08); border: 1px solid rgba(36, 84, 156, .18); padding: .45rem .7rem; border-radius: 999px; cursor: pointer; transition: background-color .15s ease; }
.chat-starter:hover { background: rgba(36, 84, 156, .15); }

.chat-panel__composer { display: flex; align-items: flex-end; gap: .5rem; padding: .8rem; border-top: 1px solid rgba(20, 49, 95, .08); background: #fff; }
.chat-input { flex: 1; resize: none; max-height: 120px; border: 1px solid rgba(20, 49, 95, .16); border-radius: 14px; padding: .65rem .8rem; font-size: .92rem; font-family: inherit; color: var(--ink); }
.chat-input:focus { outline: none; border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(31, 162, 214, .15); }
.chat-send { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: none; transition: background-color .15s ease; }
.chat-send:hover { background: var(--navy); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }
.chat-panel__disclaimer { font-size: .72rem; color: var(--muted); text-align: center; padding: 0 1rem .7rem; background: #fff; }
.chat-panel__disclaimer a { color: var(--blue); text-decoration: underline; }

/* ---- Reduced motion: disable non-essential animation --------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .chat-launcher__pulse { display: none; }
}
