/* ─────────────────────────────────────────────────────────
   FreeForms — Main Design System + Landing Page Styles
   ───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg:        #f8f9fa;
  --surface:   #ffffff;
  --card:      #ffffff;
  --border:    #dadce0;
  --primary:   #1a73e8;
  --primary-d: #1557b0;
  --accent:    #34a853;
  --success:   #1e8e3e;
  --danger:    #d93025;
  --warn:      #f9ab00;
  --text:      #202124;
  --muted:     #5f6368;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-hover: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 100px 0; }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 7vw, 4rem); font-weight: 800; line-height: 1.15; letter-spacing: -1px; word-break: break-word; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { color: var(--muted); line-height: 1.7; }

/* ── Gradient text removed for minimal mode ── */
.gradient-text {
  color: var(--primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
}
.btn-primary:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card); border-color: rgba(0,0,0,0.05); }

.btn-white {
  background: #fff;
  color: #11111b;
}
.btn-white:hover { background: #e8e8f0; transform: translateY(-1px); }

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.25);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: white;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.nav-links a:not(.btn) {
  padding: 8px 14px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--text); background: var(--card); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 1rem; margin-left: auto; }
.nav-mobile { display: none; flex-direction: column; gap: 8px; padding: 16px 24px; background: var(--surface); border-top: 1px solid var(--border); position: absolute; top: 100%; left: 0; width: 100%; box-shadow: var(--shadow); z-index: 99; }
.nav-mobile.open { display: flex; }
.nav-mobile a { padding: 12px 14px; border-radius: 8px; color: var(--muted); font-size: 1.05rem; }
.nav-mobile a:hover { color: var(--text); background: var(--card); }
.nav-mobile a.btn-primary { color: #ffffff; text-align: center; justify-content: center; background: var(--primary); }
.nav-mobile a.btn-primary:hover { background: var(--primary-d); color: #ffffff; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; background: var(--bg); }
.orb { display: none; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content { position: relative; z-index: 1; text-align: center; padding: 80px 24px; width: 100%; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #e8f0fe;
  border: 1px solid rgba(26,115,232,0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 28px;
}
.badge-dot { width: 7px; height: 7px; background: var(--primary); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }
.hero-title { margin-bottom: 20px; }
.hero-subtitle {
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--muted);
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }

/* ── Code card ── */
.hero-code-card, .code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}
.hero-code-card {
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow);
  text-align: left;
}
.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.code-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #28c840; }
.code-filename { font-size: 0.8rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.code-body, .code-preview {
  padding: 20px 24px;
  margin: 0;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.8;
}
.code-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #f8f9fa;
}
.code-hint { font-size: 0.82rem; color: var(--success); }

/* Code syntax colors (Light Mode adapted) */
.ct     { color: #5f6368; }
.ct-tag { color: #1a73e8; }
.ct-attr{ color: #d93025; }
.ct-str { color: #1e8e3e; }
.ct-id  { color: #f9ab00; }
.ct-kw  { color: #1a73e8; }
.ct-fn  { color: #d93025; }

/* ── Section header ── */
.section-header { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: #e8f0fe;
  border: 1px solid rgba(26,115,232,0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p { max-width: 500px; margin: 0 auto; }

/* ── How it works ── */
.how-it-works { background: var(--surface); }
.steps-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.step-card {
  flex: 1;
  min-width: 220px;
  max-width: 300px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}
.step-card:hover { border-color: rgba(26,115,232,0.3); transform: translateY(-4px); }
.step-number {
  position: absolute;
  top: -14px; left: 24px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid rgba(26,115,232,0.3);
  padding: 3px 10px;
  border-radius: 999px;
}
.step-icon { font-size: 2.4rem; margin-bottom: 16px; }
.step-card h3 { margin-bottom: 10px; }
.step-card p { font-size: 0.92rem; }
.step-connector {
  flex: 0 0 60px;
  height: 2px;
  background: var(--primary);
  opacity: 0.4;
  margin-top: 70px;
}

/* ── Features ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: rgba(26,115,232,0.3);
  background: rgba(26,115,232,0.05);
  transform: translateY(-3px);
}
.feature-icon { font-size: 2rem; margin-bottom: 14px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; }
.feature-card code {
  background: rgba(26,115,232,0.15);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82em;
}

/* ── Integration section ── */
.integration-section { background: var(--surface); }
.integration-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.integration-text .section-tag { margin-bottom: 12px; }
.integration-text h2 { margin-bottom: 16px; }
.integration-text p { margin-bottom: 24px; }
.feature-list { list-style: none; margin-bottom: 32px; }
.feature-list li { padding: 6px 0; color: var(--muted); font-size: 0.95rem; }
.feature-list li span { color: var(--success); margin-right: 8px; }

.code-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  width: fit-content;
}
.code-tab {
  padding: 7px 18px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}
.code-tab.active { background: var(--primary); color: #ffffff; }
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-panel .code-body { font-size: 0.82rem; }

/* ── CTA ── */
.cta-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: white;
  border-radius: 24px;
  padding: 80px 40px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(26,115,232,0.25);
  border: none;
  overflow: hidden;
  position: relative;
}
.cta-orb { display: none; }
.cta-card h2 { margin-bottom: 16px; position: relative; z-index: 2; font-weight: 800; }
.cta-card p  { margin-bottom: 36px; position: relative; z-index: 2; color: rgba(255,255,255,0.9); font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-card .btn { position: relative; z-index: 2; padding: 14px 32px; font-size: 1.05rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.cta-card .btn-white { background: #ffffff; color: var(--primary); }

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 12px; max-width: 240px; }
.footer-brand .nav-logo { margin-bottom: 0; }
.footer-links h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 16px; }
.footer-links a { display: block; color: var(--muted); font-size: 0.9rem; padding: 4px 0; transition: var(--transition); }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  max-width: 320px;
}
.toast-success { background: rgba(52,211,153,0.15); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }
.toast-error   { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }
.toast-info    { background: rgba(26,115,232,0.15); border: 1px solid rgba(26,115,232,0.3); color: var(--primary); }
@keyframes toast-in { from{ opacity:0; transform:translateX(20px) } to{ opacity:1; transform:none } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h3 { margin-bottom: 8px; }
.modal p  { margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Form elements ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  
 outline: 1px solid var(--primary); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 5px; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-active  { background: rgba(52,211,153,0.12); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.badge-paused  { background: rgba(251,191,36,0.12); color: var(--warn);    border: 1px solid rgba(251,191,36,0.25); }
.badge-unread  { background: #e8f0fe; color: var(--primary); border: 1px solid rgba(26,115,232,0.25); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .integration-split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { flex-direction: column; align-items: center; }
  .step-connector { width: 2px; height: 40px; background: var(--primary); margin: 0; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .section { padding: 64px 0; }
}
