/* ============================================================================
   CheckTheOrg design system — "Midnight Aurora"
   Premium fintech trust aesthetic for Indian job seekers.
   Layered on top of Tailwind (CDN). All motion respects prefers-reduced-motion.
   ========================================================================== */

:root {
  --ink:      #070B18;   /* near-black navy base            */
  --ink-2:    #0C1226;   /* raised surface                  */
  --surface:  #0F1730;   /* card on dark                    */
  --line:     rgba(148, 163, 184, 0.14);

  --mint:     #10E0A0;   /* trust / safe                    */
  --cyan:     #22D3EE;
  --violet:   #8B5CF6;   /* "intelligence" secondary        */
  --indigo:   #6366F1;
  --amber:    #FBBF24;   /* caution                         */
  --rose:     #FB7185;   /* risk                            */

  --paper:    #F6F8FE;   /* light app background            */
  --card:     #FFFFFF;
  --text:     #0B1220;
  --muted:    #64748B;
}

* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

html { scroll-behavior: smooth; overflow-x: hidden; }
html, body { max-width: 100%; }
[x-cloak] { display: none !important; }

/* Glowing score ring (home panel) — the arc colour pulses a soft halo. The
   glow uses currentColor, so it matches the ring's emerald/amber/rose. */
.ring-glow { animation: ringGlow 2.6s ease-in-out infinite; }
@keyframes ringGlow {
  0%, 100% { filter: drop-shadow(0 0 2px currentColor); }
  50%      { filter: drop-shadow(0 0 7px currentColor); }
}
@media (prefers-reduced-motion: reduce) {
  .ring-glow { animation: none; filter: drop-shadow(0 0 4px currentColor); }
}

/* ── Nav interactions ─────────────────────────────────────────────────────
   Text links get an animated gradient underline; the Sign-in button lifts,
   glows, and catches a light sweep on hover. Professional, not flashy. */
.nav-link { position: relative; padding-bottom: 3px; }
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.nav-link:hover::after { transform: scaleX(1); }

.btn-signin {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--mint), var(--cyan));
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.btn-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(16, 224, 160, .6);
  filter: brightness(1.05);
}
.btn-signin:active { transform: translateY(0); }
.btn-signin::before {   /* diagonal light sweep */
  content: "";
  position: absolute; top: 0; left: -130%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg);
  transition: left .6s ease;
}
.btn-signin:hover::before { left: 150%; }

@media (prefers-reduced-motion: reduce) {
  .nav-link::after { transition: none; }
  .btn-signin, .btn-signin:hover { transform: none; }
  .btn-signin::before { display: none; }
}

/* Self-contained entrance for HTMX-swapped cards (no JS dependency — plays on
   every insert, so swapped content is never left stuck invisible). */
.pop-in { animation: popIn .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

/* Big paper-plane + confetti celebration on review submit */
.celebrate-overlay {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none; overflow: hidden;
  display: grid; place-items: center;
}
.celebrate-plane-big {
  width: min(80vw, 760px);
  filter: drop-shadow(0 24px 46px rgba(16, 224, 160, .40));
  animation: plane-swoosh 2.1s cubic-bezier(.5, .04, .35, 1) forwards;
}
.celebrate-plane-big svg { width: 100%; height: auto; display: block; }
@keyframes plane-swoosh {
  0%   { transform: translate(-82vw, 46vh) rotate(14deg) scale(.32); opacity: 0; }
  16%  { opacity: 1; }
  46%  { transform: translate(0, 0) rotate(-7deg) scale(1); opacity: 1; }
  64%  { transform: translate(5vw, -3vh) rotate(-10deg) scale(1); opacity: 1; }
  100% { transform: translate(128vw, -72vh) rotate(-28deg) scale(.42); opacity: 0; }
}

.confetti {
  position: absolute; top: 44%; left: 50%;
  width: 11px; height: 15px;
  will-change: transform, opacity;
  animation: confetti-fly var(--dur, 1600ms) cubic-bezier(.15, .6, .4, 1) var(--delay, 0ms) forwards;
}
@keyframes confetti-fly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(.5); }
}

@media (prefers-reduced-motion: reduce) {
  .pop-in { animation: none; opacity: 1; }
  .celebrate-overlay { display: none; }
}

/* Scroll-reading progress bar (top of viewport) */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--mint), var(--cyan), var(--violet));
  box-shadow: 0 0 10px rgba(16, 224, 160, 0.5); transition: width .1s linear;
  will-change: width; pointer-events: none;
}
/* Score rings that draw themselves in on scroll */
.ring-anim { transition: stroke-dashoffset 1.3s cubic-bezier(.16, 1, .3, 1); }

body {
  background: var(--paper);
  color: var(--text);
  /* faint mesh so light pages never feel flat */
  background-image:
    radial-gradient(60rem 60rem at 110% -10%, rgba(139, 92, 246, 0.07), transparent 60%),
    radial-gradient(50rem 50rem at -10% 10%, rgba(16, 224, 160, 0.07), transparent 55%);
  background-attachment: fixed;
  transition: background-color .4s ease, color .4s ease;
}

/* ============================================================================
   DARK MODE — the nav/heroes/footer are already dark, so this darkens only the
   "paper" body zone (cards, report, dropdown). Flipped by data-theme on <html>.
   ========================================================================== */
:root[data-theme="dark"] {
  --paper: #080C17;
  --card:  #0F1629;
  --text:  #E5E9F0;
  --muted: #8B95A7;
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(60rem 60rem at 110% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(50rem 50rem at -10% 10%, rgba(16, 224, 160, 0.10), transparent 55%);
}
/* Retro-fit the Tailwind utilities used across the light body. The dark chrome
   (bg-ink / text-white / glass) uses a different class set, so it's untouched. */
[data-theme="dark"] .bg-white { background-color: var(--card) !important; }
[data-theme="dark"] .bg-white\/95 { background-color: color-mix(in srgb, var(--card) 95%, transparent) !important; }
[data-theme="dark"] .bg-white\/90 { background-color: color-mix(in srgb, var(--card) 90%, transparent) !important; }
[data-theme="dark"] .text-slate-900 { color: #F1F5F9 !important; }
[data-theme="dark"] .text-slate-800 { color: #E2E8F0 !important; }
[data-theme="dark"] .text-slate-700 { color: #CBD5E1 !important; }
[data-theme="dark"] .text-slate-600 { color: #A9B4C4 !important; }
[data-theme="dark"] .text-slate-500 { color: #8B95A7 !important; }
[data-theme="dark"] .bg-slate-50  { background-color: rgba(255,255,255,0.03) !important; }
[data-theme="dark"] .bg-slate-100 { background-color: rgba(255,255,255,0.07) !important; }
[data-theme="dark"] .border-slate-100 { border-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .border-slate-200 { border-color: rgba(255,255,255,0.10) !important; }
[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .divide-slate-50  > :not([hidden]) ~ :not([hidden]) { border-color: rgba(255,255,255,0.06) !important; }
/* Soft coloured tint chips → translucent so they read on dark */
[data-theme="dark"] .bg-emerald-50 { background-color: rgba(16,185,129,0.14) !important; }
[data-theme="dark"] .bg-rose-50    { background-color: rgba(244,63,94,0.14) !important; }
[data-theme="dark"] .bg-amber-50   { background-color: rgba(251,191,36,0.14) !important; }
[data-theme="dark"] .bg-indigo-50, [data-theme="dark"] .bg-indigo-50\/70,
[data-theme="dark"] .bg-indigo-50\/60 { background-color: rgba(99,102,241,0.14) !important; }
[data-theme="dark"] .bg-indigo-100, [data-theme="dark"] .from-indigo-100 { background-color: rgba(99,102,241,0.20) !important; }
[data-theme="dark"] .text-indigo-900\/80 { color: #c7d2fe !important; }
/* Cards get a lighter border + deeper shadow on dark */
[data-theme="dark"] .card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -22px rgba(0,0,0,.7);
}
[data-theme="dark"] .ring-slate-900\/5 { --tw-ring-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .dropdown-scroll { box-shadow: 0 24px 60px -15px rgba(0,0,0,0.6); }

/* ---- Theme toggle: animated sliding switch ---- */
.theme-switch {
  position: relative; flex-shrink: 0; width: 56px; height: 30px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer; transition: background .35s ease, border-color .35s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-switch:hover { background: rgba(255, 255, 255, 0.14); }
:root[data-theme="dark"] .theme-switch { background: rgba(99, 102, 241, 0.18); border-color: rgba(139, 92, 246, 0.35); }
/* faint icons on the track */
.theme-switch .ts-icon { position: absolute; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: rgba(255,255,255,.5); pointer-events: none; }
.theme-switch .ts-sun { left: 8px; } .theme-switch .ts-moon { right: 8px; }
/* the sliding knob */
.theme-switch .ts-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--violet));
  box-shadow: 0 3px 8px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.12);
  display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); /* springy slide */
}
:root[data-theme="dark"] .theme-switch .ts-knob { transform: translateX(26px); }
.theme-switch .ts-knob svg { position: absolute; width: 13px; height: 13px; color: #0B1220; transition: opacity .3s ease, transform .5s cubic-bezier(.34,1.56,.64,1); }
.theme-switch .k-moon { opacity: 0; transform: rotate(-40deg); }
.theme-switch .k-sun  { opacity: 1; transform: rotate(0); }
:root[data-theme="dark"] .theme-switch .k-sun  { opacity: 0; transform: rotate(40deg); }
:root[data-theme="dark"] .theme-switch .k-moon { opacity: 1; transform: rotate(0); }

input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

::selection { background: rgba(16, 224, 160, 0.25); }

/* Hide the page scrollbar — the animated progress bar at the top already shows
   scroll position. (The search dropdown keeps its own thin scrollbar below.)
   Scrolling still works via wheel/trackpad/keys. */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Search dropdown — slim, subtle scrollbar (overrides the bold global one) */
.dropdown-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.dropdown-scroll::-webkit-scrollbar { width: 6px; }
.dropdown-scroll::-webkit-scrollbar-track { background: transparent; }
.dropdown-scroll::-webkit-scrollbar-thumb {
  background: #d7dde7; border-radius: 99px; border: none;
}
.dropdown-scroll::-webkit-scrollbar-thumb:hover { background: #b6bfce; }

/* ============================================================================
   Aurora — the living background behind dark sections
   ========================================================================== */
.aurora { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 55vw; height: 55vw; border-radius: 50%;
  filter: blur(80px); opacity: 0.6; will-change: transform; transform-origin: center;
}
/* Seamless multi-point orbits (0% == 100%) with breathing scale + rotation, each on
   a different (and now livelier) tempo so the field visibly flows and never syncs. */
.aurora::before {
  background: radial-gradient(circle at 30% 30%, var(--mint), transparent 60%);
  top: -20%; left: -12%; animation: drift1 15s ease-in-out infinite;
}
.aurora::after {
  background: radial-gradient(circle at 70% 70%, var(--violet), transparent 60%);
  bottom: -24%; right: -12%; animation: drift2 19s ease-in-out infinite;
}
.aurora .blob3 {
  position: absolute; width: 44vw; height: 44vw; border-radius: 50%; filter: blur(80px);
  background: radial-gradient(circle, var(--cyan), transparent 60%);
  opacity: 0.5; top: 14%; left: 36%; animation: drift3 23s ease-in-out infinite;
  will-change: transform; transform-origin: center;
}
@keyframes drift1 {
  0%, 100% { transform: translate(-8%, -6%) scale(1) rotate(0deg); }
  33%      { transform: translate(30%, 20%) scale(1.35) rotate(16deg); }
  66%      { transform: translate(12%, 34%) scale(1.15) rotate(-10deg); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(10%, 8%) scale(1.1) rotate(0deg); }
  33%      { transform: translate(-28%, -22%) scale(1.4) rotate(-16deg); }
  66%      { transform: translate(-8%, 16%) scale(1.2) rotate(10deg); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(6%, -8%) scale(0.9) rotate(0deg); }
  33%      { transform: translate(-30%, 18%) scale(1.28) rotate(14deg); }
  66%      { transform: translate(-14%, -12%) scale(1.05) rotate(-12deg); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after, .aurora .blob3 { animation: none; }
}

/* Star/grain dust over hero */
.stardust {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.5) 0.5px, transparent 0.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 75%);
          mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 75%);
}

/* ============================================================================
   Typography helpers
   ========================================================================== */
.font-display { font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; }

/* The hero→body wave fills with the body colour in either theme (Tailwind has no
   `text-paper`, so define it here). */
.text-paper { color: var(--paper); }

.text-gradient {
  background: linear-gradient(100deg, var(--mint), var(--cyan) 45%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* ============================================================================
   Glass cards & surfaces
   ========================================================================== */
.glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.card {
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -18px rgba(15, 23, 42, 0.25);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}

/* Card that lives on the always-dark hero — stays dark in BOTH themes so its
   white text never disappears (unlike .card, which flips white in light mode). */
.card-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 22px 48px -24px rgba(0, 0, 0, .7);
  backdrop-filter: blur(10px);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px -20px rgba(16, 224, 160, 0.35), 0 1px 2px rgba(15,23,42,.05);
}

/* --- Feature showcase (homepage) --- */
.feature-card {
  position: relative;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent, #10E0A0) 45%, transparent);
  box-shadow: 0 24px 50px -22px color-mix(in srgb, var(--accent, #10E0A0) 55%, transparent),
              0 1px 2px rgba(15,23,42,.05);
}
/* Soft accent glow that blooms from the icon on hover */
.feature-card::after {
  content: ""; position: absolute; top: -40%; left: -20%;
  width: 55%; height: 120%; border-radius: 999px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent, #10E0A0) 30%, transparent), transparent);
  opacity: 0; transform: scale(.6); transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
.feature-card:hover::after { opacity: .5; transform: scale(1); }

/* Gently floating icon tile */
.floaty { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Meter bar that fills once its card reveals into view */
.meter-fill { width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1) .2s; }
.reveal.in .meter-fill { width: var(--fill, 74%); }

@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none; }
  .meter-fill { transition: none; width: var(--fill, 74%); }
}

/* Gradient ring border (used for premium/CTA cards) */
.ring-gradient {
  position: relative; border-radius: 1.25rem;
}
.ring-gradient::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, var(--mint), var(--violet));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

/* ============================================================================
   Buttons & interactive glow
   ========================================================================== */
.btn-glow {
  position: relative; isolation: isolate; transition: transform .2s ease, box-shadow .3s ease;
}
.btn-glow:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(16, 224, 160, 0.55); }
.btn-glow:active { transform: translateY(0); }

.search-shell { position: relative; }
.search-shell::after {
  content: ""; position: absolute; inset: -2px; border-radius: 1rem; z-index: -1;
  background: linear-gradient(120deg, var(--mint), var(--cyan), var(--violet));
  opacity: 0; filter: blur(10px); transition: opacity .4s ease;
}
.search-shell:focus-within::after { opacity: 0.7; }

/* ============================================================================
   Scroll-reveal choreography
   ========================================================================== */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================================
   Score dial
   ========================================================================== */
.dial svg { transform: rotate(-90deg); overflow: visible; }
.dial .track { stroke: rgba(148, 163, 184, 0.18); }
.dial .progress {
  stroke-linecap: round;
  transition: stroke-dashoffset 1.7s cubic-bezier(.16,1,.3,1);
  filter: drop-shadow(0 0 8px currentColor);
}
.dial .tick { transition: opacity .3s ease; }

/* Animated pillar / theme bars */
.bar-fill { width: 0; transition: width 1.2s cubic-bezier(.16,1,.3,1); }
.bar-track.in .bar-fill { width: var(--w, 0%); }

/* Flag rows cascade in */
.flag-row { opacity: 0; transform: translateX(-8px); animation: flagIn .5s forwards; }
@keyframes flagIn { to { opacity: 1; transform: none; } }

/* Pulse dot for live/verified badges */
.pulse-dot { position: relative; }
.pulse-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.6); opacity: 0; } }

/* Marquee for source logos strip. Two identical groups butted together; the
   track animates by exactly one group width (-50%) for a seamless loop. Each
   group is padded/wide enough to cover any viewport, so no empty gap appears. */
.marquee { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; gap: 3rem; padding-right: 3rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .bar-fill { width: var(--w, 0%); }
}

/* cursor spotlight in the hero (JS sets --sx/--sy; reduced-motion: stays centered) */
.hero-spot{ position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(360px circle at var(--sx,50%) var(--sy,30%), rgba(120,220,255,.09), transparent 70%);
  transition:background .12s linear; }
