/* ============================================================
   WApp Flow — Global Styles (styles.css)
   ============================================================ */

/* ---- Variables ---- */
:root {
  --bg:        #080a0c;
  --bg-alt:    #0d1014;
  --bg-card:   #111418;
  --bg-card2:  #161b20;
  --border:    rgba(255,255,255,0.07);
  --border-h:  rgba(255,255,255,0.15);
  --text:      #f0f2f4;
  --muted:     #7a8290;
  --muted2:    #4a5260;
  --green:     #25d366;
  --green-d:   #128c7e;
  --teal:      #0cc0df;
  --purple:    #9b59f7;
  --red:       #ff5f56;
  --yellow:    #f7b731;

  --font-h:    'Outfit', sans-serif;
  --font-b:    'Inter', sans-serif;
  --font-m:    'Fira Code', monospace;

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --glow-g: 0 0 24px rgba(37,211,102,0.35);
}

/* ---- Reset ---- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--bg); color: var(--text);
  font-family: var(--font-b); line-height: 1.65; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1,h2,h3,h4,h5 { font-family: var(--font-h); letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.grad-text {
  background: linear-gradient(135deg, var(--green) 0%, var(--teal) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Layout ---- */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 760px; margin: 0 auto; }
.section { padding: 100px 0; position: relative; z-index: 2; }
.bg-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---- Section Head ---- */
.section-head { text-align: center; margin-bottom: 56px; }
.section-head p { color: var(--muted); margin-top: .75rem; font-size: 1.05rem; max-width: 580px; margin-left: auto; margin-right: auto; }
.label {
  display: inline-block; margin-bottom: .75rem;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--green);
  border: 1px solid rgba(37,211,102,.25); border-radius: 50px;
  padding: .25rem .9rem; background: rgba(37,211,102,.06);
}

/* ---- Reveal Animation ---- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in  { opacity: 1; transform: translateY(0); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .8rem 1.6rem; border-radius: var(--r-md);
  font-family: var(--font-h); font-weight: 600; cursor: pointer;
  border: none; transition: all .25s ease; font-size: 1rem;
}
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--r-lg); }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-xs { padding: .4rem 1rem; font-size: .8rem; border-radius: var(--r-sm); }

.btn-primary { background: var(--green-d); color: #fff; }
.btn-primary:hover { background: #0f7a6e; transform: translateY(-2px); box-shadow: var(--glow-g); }
.btn-glow { box-shadow: 0 0 18px rgba(37,211,102,.4); }
.btn-glow:hover { box-shadow: 0 0 28px rgba(37,211,102,.65); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-h); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-block { width: 100%; }
.btn-outline-xs { background: transparent; color: var(--text); border: 1px solid var(--border-h); }
.btn-outline-xs:hover { background: rgba(255,255,255,.06); }
.btn-danger-xs { background: transparent; color: var(--red); border: 1px solid rgba(255,95,86,.35); }
.btn-danger-xs:hover { background: rgba(255,95,86,.08); }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }

/* ---- NAVBAR ---- */
.navbar {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  background: rgba(8,10,12,.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); transition: all .3s;
}
.navbar.scrolled { background: rgba(8,10,12,.97); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 1.1rem 5%;
  display: flex; align-items: center; gap: 2rem;
}
.brand { display: flex; align-items: center; gap: .4rem;
  font-family: var(--font-h); font-weight: 800; font-size: 1.35rem; }
.brand-icon { font-size: 1.1rem; }
.brand-accent { color: var(--green); }
.nav-links { display: flex; gap: 1.75rem; margin-left: 1rem; }
.nav-links a { font-size: .875rem; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: .75rem; align-items: center; }
.burger { display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .4rem; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }

/* ---- HERO ---- */
.hero { padding: 180px 0 120px; text-align: center; position: relative; overflow: hidden; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.g1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(37,211,102,.12), transparent 70%);
       top: -200px; left: -200px; }
.g2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(12,192,223,.1), transparent 70%);
       top: 0; right: -150px; }
.g3 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(155,89,247,.08), transparent 70%);
       bottom: -100px; left: 40%; }
.hero .container { position: relative; z-index: 2; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem 1rem; border: 1px solid var(--border-h);
  border-radius: 50px; font-size: .8rem; color: var(--muted);
  background: rgba(255,255,255,.03); margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}
.dot-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
.hero-title { margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 2.5rem; }
.hero-btns { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; justify-content: center; gap: 0; flex-wrap: wrap;
  max-width: 700px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: rgba(255,255,255,.02); backdrop-filter: blur(8px);
  overflow: hidden;
}
.stat { flex: 1; min-width: 140px; padding: 1.25rem 1rem; text-align: center;
  border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat strong { display: block; font-family: var(--font-h); font-size: 1.6rem; font-weight: 700; color: var(--green); }
.stat span { font-size: .8rem; color: var(--muted); }

/* ---- FEATURES GRID ---- */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
}
.feat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem 1.5rem;
  transition: all .3s ease;
}
.feat-card:hover { border-color: var(--border-h); transform: translateY(-4px); box-shadow: var(--shadow); }
.feat-card-highlight { border-color: rgba(37,211,102,.25); background: rgba(37,211,102,.04); }
.feat-icon { font-size: 1.75rem; margin-bottom: 1rem; }
.feat-card h3 { margin-bottom: .5rem; font-size: 1rem; }
.feat-card p { font-size: .875rem; color: var(--muted); line-height: 1.6; }

/* ---- ENGINE CARDS ---- */
.engine-cards { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.engine-card {
  flex: 1; min-width: 200px; max-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2rem 1.5rem; text-align: center;
  transition: all .3s;
}
.engine-card.active, .engine-card:hover { border-color: var(--green-d); box-shadow: 0 0 20px rgba(18,140,126,.2); }
.engine-card h4 { font-size: 1rem; margin-bottom: .5rem; }
.engine-card p { font-size: .8rem; color: var(--muted); margin-bottom: 1rem; }
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 50px; font-size: .7rem; font-weight: 700; }
.badge-green { background: rgba(37,211,102,.12); color: var(--green); }
.badge-blue { background: rgba(12,192,223,.12); color: var(--teal); }
.badge-purple { background: rgba(155,89,247,.12); color: var(--purple); }
.badge-gray { background: rgba(255,255,255,.07); color: var(--muted); }

/* ---- SECURITY LAYOUT ---- */
.security-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.sec-item { display: flex; gap: 1.25rem; margin-bottom: 2rem; }
.sec-icon { font-size: 1.5rem; padding: .75rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); flex-shrink: 0; }
.sec-item h4 { margin-bottom: .3rem; font-size: .95rem; }
.sec-item p { font-size: .85rem; color: var(--muted); }

/* Security Code Box */
.sec-code-box {
  background: #0c1014; border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.sec-code-header {
  background: rgba(255,255,255,.03); padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
}
.sec-dot { width: 11px; height: 11px; border-radius: 50%; }
.sec-dot.r { background: #ff5f56; } .sec-dot.y { background: #ffbd2e; } .sec-dot.g { background: #27c93f; }
.sec-code-title { font-size: .75rem; color: var(--muted); margin-left: .5rem; font-family: var(--font-m); }
.sec-code { padding: 1.5rem; font-family: var(--font-m); font-size: .82rem; line-height: 1.9; color: #cdd6f4; overflow-x: auto; }
.kw  { color: #89b4fa; }
.val { color: #a6e3a1; }
.key { color: #f5c2e7; }
.cm  { color: #585b70; font-style: italic; }

/* ---- TEMPLATES ---- */
.templates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 0; }
.tmpl {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; transition: all .3s; cursor: pointer;
}
.tmpl:hover { border-color: var(--border-h); transform: translateY(-3px); }
.tmpl-icon { font-size: 1.75rem; display: block; margin-bottom: .75rem; }
.tmpl h4 { margin-bottom: .25rem; font-size: .9rem; }
.tmpl p { font-size: .75rem; color: var(--muted); margin-bottom: 1rem; }
.tmpl-preview-btn {
  background: transparent; border: 1px solid var(--border-h); color: var(--muted);
  padding: .35rem .85rem; border-radius: var(--r-sm); font-size: .75rem;
  cursor: pointer; transition: all .2s;
}
.tmpl-preview-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }

/* Template Modal */
.tmpl-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  z-index: 9000; align-items: center; justify-content: center;
}
.tmpl-modal.open { display: flex; }
.tmpl-modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 2rem; width: 90%; max-width: 420px; position: relative; }
.tmpl-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none;
  color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.tmpl-close:hover { color: var(--text); }
.chat-ui { background: #0c1a16; border-radius: var(--r-lg); overflow: hidden; }
.chat-header { background: var(--green-d); padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center;
  justify-content: center; color: var(--green-d); font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.chat-header strong { display: block; font-size: .875rem; }
.online-txt { font-size: .7rem; opacity: .75; }
.chat-body { padding: 1rem; }
.chat-bubble { background: #1d2b22; border-radius: var(--r-md); border-top-right-radius: 2px;
  padding: .75rem 1rem; font-size: .875rem; margin-bottom: .4rem; max-width: 90%; }
.chat-meta { font-size: .7rem; color: var(--muted); text-align: right; }

/* ---- API LAYOUT ---- */
.api-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: start; }
.api-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: .75rem; transition: border-color .2s; }
.api-row:hover { border-color: var(--border-h); }
.method { font-family: var(--font-m); font-weight: 700; font-size: .8rem;
  padding: .2rem .6rem; border-radius: 4px; flex-shrink: 0; }
.method.post { background: rgba(247,183,49,.12); color: var(--yellow); }
.method.get  { background: rgba(37,211,102,.1); color: var(--green); }
.api-row code { font-family: var(--font-m); font-size: .82rem; color: var(--muted); }
.api-key-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.75rem; }
.api-key-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.api-key-display { font-family: var(--font-m); font-size: .875rem; padding: .75rem 1rem;
  background: #0c1014; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 1rem; }
.api-key-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.api-note { font-size: .78rem; color: var(--muted); }
.api-note a { color: var(--teal); text-decoration: underline; }

/* ---- STEPS ---- */
.steps { display: flex; flex-direction: column; gap: 1rem; }
.step { display: flex; align-items: flex-start; gap: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.5rem; transition: all .3s; }
.step:hover { border-color: var(--border-h); }
.step-n { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--green-d), var(--green));
  display: flex; align-items: center; justify-content: center; font-family: var(--font-h); font-weight: 800;
  font-size: 1.1rem; flex-shrink: 0; }
.step-body h4 { margin-bottom: .3rem; }
.step-body p { font-size: .9rem; color: var(--muted); }
.step-body code { background: rgba(255,255,255,.1); padding: .15rem .4rem; border-radius: 4px;
  font-family: var(--font-m); font-size: .85rem; color: var(--purple); }

/* ---- ACCORDION ---- */
.accordion { display: flex; flex-direction: column; gap: .75rem; }
.acc-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.acc-head { width: 100%; background: transparent; border: none; padding: 1.25rem 1.5rem;
  color: var(--text); font-family: var(--font-h); font-size: 1rem; font-weight: 600;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background .2s; }
.acc-head:hover { background: rgba(255,255,255,.02); }
.acc-icon { font-size: 1.2rem; color: var(--muted); transition: transform .3s; }
.acc-item.open .acc-icon { transform: rotate(45deg); color: var(--green); }
.acc-body { max-height: 0; overflow: hidden; padding: 0 1.5rem; color: var(--muted); font-size: .9rem; transition: max-height .35s ease, padding .35s ease; }
.acc-item.open .acc-body { max-height: 300px; padding: 0 1.5rem 1.25rem; }

/* ---- FOOTER ---- */
.footer { padding: 64px 0 32px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-brand .brand { font-size: 1.35rem; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; color: var(--muted); max-width: 260px; margin-bottom: 1rem; }
.footer-col h5 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: .875rem; color: var(--muted); margin-bottom: .6rem; transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom span { font-size: .8rem; color: var(--muted2); }
.footer-badges { display: flex; gap: .5rem; }
.f-badge { padding: .2rem .6rem; background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 50px; font-size: .7rem; color: var(--muted); }

/* ---- CODE WINDOWS ---- */
.code-win {
  background: #0c1014; border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.code-win pre { padding: 1.25rem; font-family: var(--font-m); font-size: .82rem;
  line-height: 1.9; color: #cdd6f4; overflow-x: auto; }
.code-win.small pre { font-size: .78rem; padding: 1rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .templates-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .security-layout { grid-template-columns: 1fr; }
  .api-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions .btn-outline-xs { display: none; }
  .burger { display: flex; }
  .feature-grid, .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 140px 0 80px; }
  .hero-stats .stat { min-width: 100px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .feature-grid, .templates-grid { grid-template-columns: 1fr; }
  .engine-cards { flex-direction: column; align-items: center; }
  .footer-grid { grid-template-columns: 1fr; }
}
