/* === SKIP LINK (accessibility) === */
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--accent); color: #fff;
  padding: 0.6rem 1.2rem; font-weight: 600; font-size: 0.9rem;
  border-radius: 0 0 8px 0; z-index: 9999; transition: top 0.2s;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #171b26;
  --surface2: #1e2333;
  --border: #272d3f;
  --accent: #4f6ef7;
  --accent2: #7c94fb;
  --green: #22c55e;
  --yellow: #f59e0b;
  --text: #e2e6f0;
  --muted: #6b7a9e;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.4rem; border-radius: 9px; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; border: none;
  transition: all 0.18s; text-decoration: none; gap: 0.4rem;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 12px rgba(79,110,247,0.35); }
.btn-primary:hover { background: #3d5ce8; box-shadow: 0 4px 20px rgba(79,110,247,0.5); transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent2); border: 1px solid var(--accent); }
.btn-outline:hover { background: rgba(79,110,247,0.1); text-decoration: none; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* === NAVBAR === */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(15,17,23,0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 1.25rem;
  height: 58px; display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1rem; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.logo-icon { font-size: 1.2rem; }
.nav-links { display: flex; gap: 1.5rem; flex: 1; }
.nav-links a { color: var(--muted); font-size: 0.88rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* === HERO === */
.hero { padding: 5rem 0 3.5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute;
  width: 650px; height: 650px;
  background: radial-gradient(circle, rgba(79,110,247,0.1) 0%, transparent 65%);
  top: -150px; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.hero-badge {
  display: inline-block; background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3); color: var(--green);
  padding: 0.28rem 0.9rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.18; margin-bottom: 1.1rem;
}
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 540px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats {
  display: inline-flex; align-items: center; gap: 1.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.8rem 1.5rem; flex-wrap: wrap; justify-content: center;
}
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-item strong { font-size: 1.3rem; font-weight: 800; color: var(--accent2); }
.stat-item span { font-size: 0.72rem; color: var(--muted); }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

/* === TRUST BAR === */
.trust-bar { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.trust-inner { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.trust-inner span { color: var(--muted); font-size: 0.84rem; }

/* === SECTIONS === */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-label { color: var(--accent2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.section > .container > h2, .section-alt > .container > h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.7rem;
}
.section-sub { color: var(--muted); font-size: 0.95rem; max-width: 560px; margin-bottom: 2.5rem; }

/* === TEMPLATES GRID === */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.template-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; cursor: pointer; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.template-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.template-card.selected { border-color: var(--accent); background: rgba(79,110,247,0.06); }
.template-icon { font-size: 1.8rem; }
.template-card h3 { font-size: 0.98rem; font-weight: 700; }
.template-card p { color: var(--muted); font-size: 0.84rem; line-height: 1.55; flex: 1; }
.template-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag { background: rgba(79,110,247,0.12); color: var(--accent2); border: 1px solid rgba(79,110,247,0.2); font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 5px; font-weight: 600; }

/* === GENERATOR === */
.generator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

/* FORM */
.form-section { margin-bottom: 1.5rem; }
.form-section-title { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.9rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.form-group label { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.required { color: #f87171; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 0.55rem 0.8rem; font-size: 0.9rem;
  width: 100%; transition: border-color 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-error { color: #f87171; font-size: 0.84rem; min-height: 1.2rem; margin-bottom: 0.7rem; }
.form-note { color: var(--muted); font-size: 0.78rem; text-align: center; margin-top: 0.6rem; }

/* PREVIEW */
.preview-panel {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 400px; display: flex; flex-direction: column; overflow: hidden; position: sticky; top: 72px;
}
.preview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; flex: 1; padding: 2rem; text-align: center; }
.preview-icon { font-size: 2.5rem; }
.preview-placeholder p { color: var(--muted); font-size: 0.9rem; }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.preview-header strong { font-size: 0.88rem; }
.contract-text { padding: 1rem; font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; color: var(--text); overflow-y: auto; max-height: 520px; font-family: 'Courier New', monospace; }

/* === HOW IT WORKS === */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.step-card h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 0.5rem; }
.step-card p { color: var(--muted); font-size: 0.85rem; }

/* === WHY SECTION === */
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.why-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; transition: border-color 0.2s; }
.why-card:hover { border-color: rgba(79,110,247,0.4); }
.why-icon { font-size: 1.6rem; margin-bottom: 0.7rem; }
.why-card h3 { font-size: 0.97rem; font-weight: 700; margin-bottom: 0.4rem; }
.why-card p { color: var(--muted); font-size: 0.84rem; line-height: 1.55; }

/* === FAQ === */
.faq-container h2 { margin-bottom: 2rem; }
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 720px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { padding: 1rem 1.2rem; font-size: 0.93rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--accent2); flex-shrink: 0; margin-left: 1rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.2rem 1rem; color: var(--muted); font-size: 0.87rem; line-height: 1.65; }

/* === CTA SECTION === */
.cta-section { padding: 4.5rem 0; text-align: center; background: linear-gradient(135deg, rgba(79,110,247,0.08) 0%, transparent 60%); border-top: 1px solid var(--border); }
.cta-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 0.8rem; }
.cta-section p { color: var(--muted); margin-bottom: 1.8rem; font-size: 0.95rem; }

/* === FOOTER === */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); font-size: 0.83rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-note { color: var(--muted); font-size: 0.77rem; max-width: 560px; line-height: 1.5; }
.footer-copy { color: var(--muted); font-size: 0.75rem; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .generator-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .nav-links { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1rem; padding: 0.7rem 1rem; }
  .stat-divider { display: none; }
  .trust-inner { gap: 0.8rem; justify-content: flex-start; padding: 0 1.25rem; }
}
@media (max-width: 480px) {
  .templates-grid, .steps-grid, .why-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .form-row { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
}
