/* ============================================================
   FreelanceBidder — Design System
   Vanilla CSS, no framework. Light app pages, dark landing hero.
   ============================================================ */

:root {
  /* Palette */
  --navy-950: #070d1a;
  --navy-900: #0b1220;
  --navy-800: #101a2e;
  --navy-700: #1a2842;
  --primary: #4f6df5;
  --primary-600: #3d58e0;
  --primary-soft: #eef1fe;
  --violet: #7c5cfc;
  --grad: linear-gradient(135deg, #4f6df5 0%, #7c5cfc 100%);
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #d97706;
  --amber-soft: #fdf3e3;

  /* Neutrals */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --page: #f6f8fb;
  --surface: #ffffff;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Shape */
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 44px rgba(15, 23, 42, 0.13);
  --shadow-glow: 0 8px 40px rgba(79, 109, 245, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font);
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 13px 22px; cursor: pointer; white-space: nowrap;
  transition: all 0.18s ease; text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 9px 15px; font-size: 13.5px; }
.btn-lg { padding: 16px 30px; font-size: 16px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 2px 10px rgba(79, 109, 245, 0.35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-glow); color: #fff; }

.btn-white { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border-color: var(--line); }
.btn-white:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); color: var(--ink); }

.btn-ghost-light { background: rgba(255,255,255,0.08); color: #e2e8f0; border-color: rgba(255,255,255,0.18); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.14); color: #fff; }

.btn-outline { background: transparent; color: var(--primary); border-color: #c7d2fe; }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-600); }

.btn-outline-danger { background: transparent; color: var(--red); border-color: #fca5a5; }
.btn-outline-danger:hover:not(:disabled) { background: var(--red-soft); }

.btn-outline-success { background: transparent; color: var(--green); border-color: #86efac; }
.btn-outline-success:hover:not(:disabled) { background: var(--green-soft); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; color: #fff; }

/* Spinner inside buttons */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
.spinner-dark { border-color: rgba(15,23,42,0.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Nav (app + landing) ============ */
.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a { font: 500 14.5px/1 var(--font); transition: color 0.15s; }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* Dark variant (landing) */
.nav-dark { background: rgba(7, 13, 26, 0.82); border-bottom: 1px solid rgba(255,255,255,0.07); }
.nav-dark .nav-links a { color: #a7b3c9; }
.nav-dark .nav-links a:hover { color: #fff; }

/* Light variant (app pages) */
.nav-light { background: rgba(255,255,255,0.88); border-bottom: 1px solid var(--line); }
.nav-light .nav-links a { color: var(--ink-2); }
.nav-light .nav-links a:hover, .nav-light .nav-links a.active { color: var(--primary); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; font: 800 19px/1 var(--font); letter-spacing: -0.4px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(79,109,245,0.4); flex: none;
}
.logo-mark svg { width: 17px; height: 17px; }
.logo-dark { color: #fff; } .logo-dark:hover { color: #fff; }
.logo-light { color: var(--ink); } .logo-light:hover { color: var(--ink); }
.logo em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; border-radius: 2px; background: currentColor; transition: 0.2s; }
.nav-dark .nav-toggle { color: #cbd5e1; }
.nav-light .nav-toggle { color: var(--ink); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 10px 24px 18px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; font-size: 16px; }
  .nav-dark .nav-links { background: #0b1220; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-light .nav-links { background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .nav-cta .hide-mobile { display: none; }
}

/* ============ Landing: hero ============ */
.hero {
  background:
    radial-gradient(1000px 500px at 70% -10%, rgba(124, 92, 252, 0.28), transparent 60%),
    radial-gradient(800px 420px at 15% 10%, rgba(79, 109, 245, 0.22), transparent 55%),
    var(--navy-950);
  color: #fff;
  padding: 92px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(7,13,26,0.6));
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12.5px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  color: #a5b4fc; background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.3);
  padding: 8px 14px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero h1 {
  font-size: clamp(34px, 5vw, 54px); font-weight: 800; line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #93c5fd, #a78bfa);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 17.5px; color: #9fb0ca; max-width: 540px; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-bullets { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; }
.hero-bullets li { display: flex; align-items: center; gap: 8px; color: #8fa2bf; font-size: 13.5px; font-weight: 500; }
.hero-bullets svg { width: 15px; height: 15px; color: #4ade80; flex: none; }

/* Hero mock dashboard */
.mock {
  background: rgba(16, 26, 46, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
}
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mock-title { font: 700 14px/1 var(--font); color: #e2e8f0; }
.mock-live {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11.5px/1 var(--font); color: #4ade80;
  background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74,222,128,0.25);
  padding: 6px 11px; border-radius: 999px;
}
.mock-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; animation: pulse 1.6s infinite; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mock-stat { background: rgba(255,255,255,0.045); border: 1px solid rgba(148,163,184,0.12); border-radius: 12px; padding: 12px 14px; }
.mock-stat b { display: block; font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mock-stat span { font-size: 11px; color: #7f92b0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.mock-feed { display: flex; flex-direction: column; gap: 9px; }
.mock-row {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,0.035); border: 1px solid rgba(148,163,184,0.1);
  border-radius: 11px; padding: 11px 13px;
}
.mock-row .ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: rgba(79,109,245,0.16);
}
.mock-row .tx { flex: 1; min-width: 0; }
.mock-row .tx b { display: block; font-size: 13px; font-weight: 600; color: #dbe4f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-row .tx span { font-size: 11.5px; color: #7c8db0; }
.mock-badge { font: 700 10.5px/1 var(--font); padding: 5px 9px; border-radius: 999px; flex: none; }
.mock-badge.ok { color: #4ade80; background: rgba(74,222,128,0.12); }
.mock-badge.wait { color: #fbbf24; background: rgba(251,191,36,0.12); }

/* ============ Landing: sections ============ */
.section { padding: 88px 0; }
.section-dark { background: var(--navy-950); color: #fff; }
.section-tint { background: #fff; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 54px; }
.sec-kicker {
  font: 700 12px/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 14px; display: block;
}
.sec-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 14px; }
.sec-head p { color: var(--muted); font-size: 16px; }
.section-dark .sec-head p { color: #93a5c4; }

/* Stat strip */
.strip { border-block: 1px solid rgba(255,255,255,0.08); background: var(--navy-900); padding: 34px 0; }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.strip-grid b { display: block; font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.strip-grid span { font-size: 13px; color: #7f92b0; font-weight: 500; }
@media (max-width: 760px) { .strip-grid { grid-template-columns: repeat(2, 1fr); gap: 26px 14px; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 28px; position: relative; box-shadow: var(--shadow-sm);
}
.step-num {
  width: 42px; height: 42px; border-radius: 12px; background: var(--grad);
  color: #fff; font: 800 17px/1 var(--font);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(79,109,245,0.35);
}
.step h3 { font-size: 17.5px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.step p { color: var(--muted); font-size: 14.5px; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; transition: all 0.2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #c7d2fe; }
.feature-ic {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 20px;
}
.feature h3 { font-size: 16px; font-weight: 700; margin-bottom: 7px; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Compare table */
.compare { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.compare table { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare th, .compare td { padding: 15px 20px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line-soft); }
.compare thead th { font-weight: 700; color: var(--ink); background: #fafbfd; font-size: 13.5px; }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare td:first-child { font-weight: 600; color: var(--ink-2); }
.compare .col-hl { background: var(--primary-soft); }
.compare thead .col-hl { color: var(--primary-600); }
.yes { color: var(--green); font-weight: 700; }
.no { color: #94a3b8; }

/* Case study band */
.case {
  background: radial-gradient(700px 300px at 80% 0%, rgba(124,92,252,0.3), transparent 55%), var(--navy-900);
  border-radius: 24px; color: #fff; padding: 54px 50px;
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center;
}
@media (max-width: 860px) { .case { grid-template-columns: 1fr; padding: 40px 28px; } }
.case h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.case p { color: #9fb0ca; font-size: 15.5px; margin-bottom: 22px; }
.case-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.case-stat { background: rgba(255,255,255,0.06); border: 1px solid rgba(148,163,184,0.16); border-radius: 14px; padding: 18px 22px; min-width: 130px; }
.case-stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(90deg,#93c5fd,#a78bfa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.case-stat span { font-size: 12.5px; color: #8fa2bf; font-weight: 500; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 920px) { .pricing { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; } }
.price-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 30px; display: flex; flex-direction: column; position: relative;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.price-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.price-card.hl { border: 2px solid var(--primary); box-shadow: 0 12px 40px rgba(79,109,245,0.18); }
.price-tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font: 700 11.5px/1 var(--font);
  letter-spacing: 0.06em; padding: 7px 16px; border-radius: 999px; text-transform: uppercase;
}
.price-name { font: 700 15px/1 var(--font); color: var(--ink-2); margin-bottom: 14px; }
.price-amount { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.price-amount b { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.price-amount span { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.price-note { font-size: 13px; color: var(--muted); margin-bottom: 24px; min-height: 20px; }
.price-note .save { color: var(--green); font-weight: 700; }
.price-list { list-style: none; margin-bottom: 28px; flex: 1; display: flex; flex-direction: column; gap: 11px; }
.price-list li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.price-list svg { width: 16px; height: 16px; color: var(--green); flex: none; margin-top: 3px; }
.price-list li.dim { color: #94a3b8; }
.price-list li.dim svg { color: #cbd5e1; }

/* Testimonials */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .quotes { grid-template-columns: 1fr; } }
.quote {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 16px;
}
.quote-stars { color: #f59e0b; font-size: 14px; letter-spacing: 2px; }
.quote p { font-size: 14.5px; color: var(--ink-2); flex: 1; }
.quote-by { display: flex; align-items: center; gap: 12px; }
.quote-av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--grad); color: #fff; font: 700 14px/1 var(--font);
  display: flex; align-items: center; justify-content: center;
}
.quote-by b { display: block; font-size: 13.5px; font-weight: 700; }
.quote-by span { font-size: 12.5px; color: var(--muted); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq-q {
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  font: 600 15.5px/1.4 var(--font); color: var(--ink);
  padding: 19px 22px; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-q::after { content: "+"; font-size: 21px; color: var(--primary); font-weight: 400; flex: none; transition: transform 0.2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; }
.faq-a p { padding: 0 22px 20px; color: var(--muted); font-size: 14.5px; }

/* CTA band */
.cta-band {
  background: radial-gradient(600px 300px at 50% -20%, rgba(124,92,252,0.4), transparent 60%), var(--navy-950);
  border-radius: 24px; text-align: center; color: #fff; padding: 66px 30px;
}
.cta-band h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.cta-band p { color: #9fb0ca; margin-bottom: 28px; font-size: 16px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 46px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.contact-info > p { color: var(--muted); margin-bottom: 26px; }
.contact-ways { display: flex; flex-direction: column; gap: 14px; }
.contact-way {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 18px;
  color: var(--ink); transition: all 0.15s;
}
.contact-way:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); color: var(--ink); }
.contact-way .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.contact-way b { display: block; font-size: 14px; font-weight: 700; }
.contact-way span { font-size: 13px; color: var(--muted); }

/* ============ Forms ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font: 600 13.5px/1 var(--font); color: var(--ink-2); margin-bottom: 8px; }
.field label .req { color: var(--red); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.field .hint a { font-weight: 600; }
.input, .select, .textarea {
  width: 100%; font: 400 14.5px/1.45 var(--font); color: var(--ink);
  background: #fff; border: 1px solid #d7dee9; border-radius: var(--r-sm);
  padding: 12px 14px; transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(79, 109, 245, 0.14);
}
.textarea { resize: vertical; min-height: 96px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.form-error { color: var(--red); font-size: 13.5px; font-weight: 500; }
.form-ok { color: var(--green); font-size: 13.5px; font-weight: 500; }

.shake { animation: shaker 0.28s ease-in-out 0s 2; border-color: var(--red) !important; }
@keyframes shaker { 0%,100% { transform: translateX(0); } 25% { transform: translateX(4px); } 75% { transform: translateX(-4px); } }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1;
  transition: 0.2s; cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::before { transform: translateX(19px); }

/* ============ Auth card pages ============ */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 20px;
  background:
    radial-gradient(700px 340px at 85% -10%, rgba(124,92,252,0.1), transparent 55%),
    radial-gradient(600px 300px at 10% 0%, rgba(79,109,245,0.09), transparent 50%),
    var(--page);
}
.auth-card {
  width: 100%; max-width: 424px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 38px 34px; box-shadow: var(--shadow-md);
}
.auth-card .logo { justify-content: center; display: flex; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 22px; }
.auth-foot a { font-weight: 600; }

/* ============ App dashboard ============ */
.app-main { padding: 34px 0 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 26px; }
.card-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.card-title .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

/* Status banner */
.status-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 20px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
}
.status-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(22,163,74,0.15); animation: pulse 1.8s infinite; }
.status-dot.off { background: #94a3b8; }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(217,119,6,0.14); }
.status-banner .lbl { font-weight: 700; font-size: 15px; }
.status-banner .msg { color: var(--muted); font-size: 13.5px; flex: 1; min-width: 200px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .v.ok { color: var(--green); } .stat .v.bad { color: var(--red); } .stat .v.brand { color: var(--primary); }

/* Two-col dashboard layout */
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 1020px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; }
@media (max-width: 1020px) { .dash-side { position: static; } }

/* Info rows in side cards */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; gap: 12px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { font-weight: 700; text-align: right; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--font); padding: 6px 11px; border-radius: 999px; }
.badge-green { color: var(--green); background: var(--green-soft); }
.badge-red { color: var(--red); background: var(--red-soft); }
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-gray { color: var(--muted); background: #eef2f7; }
.badge-brand { color: var(--primary-600); background: var(--primary-soft); }

/* Form sections inside settings card */
.fieldset { border: 0; padding: 22px 0; border-top: 1px solid var(--line-soft); }
.fieldset:first-of-type { border-top: 0; padding-top: 0; }
.fieldset-legend { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.fieldset-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Token input w/ inline action */
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; min-width: 0; }

/* NDA collapsible body */
.nda-body { display: none; padding-top: 14px; }
.nda-body.open { display: block; }
.nda-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.nda-toggle-row .tx b { display: block; font-size: 14px; font-weight: 700; }
.nda-toggle-row .tx span { font-size: 13px; color: var(--muted); }

/* ============ Table (bid history) ============ */
.table-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.table-tools .input { max-width: 280px; }
.table-tools .select { max-width: 170px; width: auto; }
.table-tools .spacer { flex: 1; }
.table-meta { font-size: 13px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th {
  text-align: left; font: 700 12px/1 var(--font); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); background: #fafbfd; padding: 13px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.tbl th .arrow { opacity: 0.45; font-size: 10px; margin-left: 4px; }
.tbl td { padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfe; }
.tbl .t-time { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbl .t-msg { color: var(--muted); max-width: 360px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

/* Mobile cards for history */
.hist-cards { display: none; flex-direction: column; gap: 12px; }
.hist-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-sm); }
.hist-card .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.hist-card .time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-card .kw { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.hist-card .msg { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 760px) {
  .tbl-wrap { display: none; }
  .hist-cards { display: flex; }
}

/* ============ Modals ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(9, 14, 26, 0.55); backdrop-filter: blur(3px);
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 7vh 18px 40px;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; padding: 30px 28px; position: relative;
  animation: modalIn 0.22s ease;
}
.modal-box.wide { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: #f1f5f9; color: var(--muted);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: #e2e8f0; color: var(--ink); }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; padding-right: 30px; }
.modal-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.modal-note {
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--muted); padding: 12px 14px; margin-top: 18px;
}

/* Plan option rows inside payment modal */
.plan-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .plan-opts { grid-template-columns: 1fr; } }
.plan-opt { border: 1.5px solid var(--line); border-radius: 14px; padding: 20px 18px; position: relative; }
.plan-opt.hl { border-color: var(--primary); background: var(--primary-soft); }
.plan-opt .nm { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.plan-opt .pr { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 2px; }
.plan-opt .per { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.plan-opt .save-tag { position: absolute; top: -10px; right: 12px; background: var(--green); color: #fff; font: 700 10.5px/1 var(--font); padding: 5px 9px; border-radius: 999px; }

/* Progress bar (token modal) */
.progress { height: 6px; background: #e9edf3; border-radius: 999px; overflow: hidden; margin-top: 16px; display: none; }
.progress .bar { height: 100%; width: 0%; background: var(--grad); border-radius: 999px; transition: width 0.3s linear; }

/* ============ Toasts ============ */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 92vw; }
.toast {
  background: var(--navy-900); color: #e6edf7; border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px; padding: 13px 18px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn 0.25s ease; max-width: 380px;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--primary); }

/* ============ Page loader overlay ============ */
.page-loader {
  position: fixed; inset: 0; z-index: 90; background: rgba(246,248,251,0.75);
  backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center;
}
.page-loader.show { display: flex; }
.page-loader .ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #dbe3ef; border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* ============ Footer ============ */
.footer { background: var(--navy-950); color: #8fa2bf; padding: 60px 0 30px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }
.footer .about { font-size: 14px; max-width: 320px; margin-top: 14px; }
.footer h5 { color: #e2e8f0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 16px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: #8fa2bf; font-size: 14px; transition: color 0.15s; }
.footer ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(148,163,184,0.14); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: #64748b;
}
.footer-bottom a { color: #8fa2bf; } .footer-bottom a:hover { color: #fff; }

/* Utilities */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
