/* ============================================================
   Devfolio Studio - main.css - RAINBOW FIXED V2 (Universal)
   Improved for all pages with utilities, forms, and polish.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@400&display=swap');

/* ---------- Variables ---------- */
:root {
  --bg: #fdfcff;
  --bg-2: #f5f3ff;
  --panel: #ffffff;
  --panel-2: #faf5ff;
  --border: #ede9fe;
  --border-2: #ddd6fe;
  --text: #0f0a1e;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --purple: #7c3aed;
  --pink: #ec4899;
  --blue: #3b82f6;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --rainbow: linear-gradient(135deg, #667eea 0%, #764ba2 15%, #f093fb 30%, #f5576c 45%, #4facfe 60%, #43e97b 75%, #fa709a 90%);
  --rainbow-2: linear-gradient(135deg, #a78bfa 0%, #f472b6 25%, #60a5fa 50%, #34d399 75%, #fbbf24 100%);
  --rainbow-soft: linear-gradient(135deg, rgba(124,58,237,.10), rgba(236,72,153,.10), rgba(59,130,246,.10));
  --max: 1200px;
  --radius: 20px;
  --font: 'Geist', system-ui, sans-serif;
  --shadow-sm: 0 4px 14px rgba(15,10,30,.08);
  --shadow-md: 0 8px 32px rgba(124,58,237,.12);
  --shadow-lg: 0 12px 48px rgba(124,58,237,.16);
  --transition: 0.25s ease;
}

/* ---------- Reset & Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px at 15% 20%, rgba(124,58,237,.10), transparent 60%),
    radial-gradient(600px at 85% 15%, rgba(236,72,153,.08), transparent 60%),
    radial-gradient(700px at 50% 100%, rgba(59,130,246,.06), transparent 70%);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 9999;
}
.skip-link:focus { top: 8px; }

/* ---------- Container ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.section-padding {
  padding: 88px 0;
}
@media (max-width: 600px) {
  .section-padding { padding: 56px 0; }
}

/* ---------- Typography ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-muted-2 { color: var(--muted-2); }
.rainbow-text {
  background: var(--rainbow-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.section-subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253,252,255,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 68px;
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--rainbow);
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(124,58,237,.25);
}
.badge {
  background: var(--rainbow-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--purple);
  margin-left: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  font-weight: 600;
}
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}
.btn-primary {
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--bg-2);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--text);
  background: var(--bg-2);
}
.btn-large {
  padding: 16px 26px;
  font-size: 15px;
  border-radius: 14px;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 999px;
}
.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rainbow);
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.card:hover::before { opacity: 1; }
.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Forms (global) ---------- */
input, textarea, select {
  font-family: var(--font);
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg-2);
  transition: border-color .2s, box-shadow .2s;
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.10);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.form-group { margin-bottom: 16px; }
.form-group .error-msg {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}
.form-group .error-msg.show { display: block; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Hero (shared) ---------- */
.hero-landing {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px 64px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  gap: 8px;
  background: var(--panel);
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--rainbow) border-box;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(124,58,237,.08);
}
.hero-landing h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .95;
  max-width: 820px;
  margin: 0 auto;
}
.hero-landing h1 .rainbow-text { /* already defined */ }
.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
  max-width: 680px;
  margin: 18px auto 0;
  line-height: 1.6;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Hero Meta (horizontal) ----- */
.hero-meta {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 500;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.hero-meta span:not(.hero-dot) { white-space: nowrap; }
.hero-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
  opacity: .6;
  flex-shrink: 0;
  display: inline-block;
}

/* ----- Trusted By ----- */
.trusted-by {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(237,233,254,.9);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.trusted-by-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  color: var(--muted-2);
}
.trusted-by .logos {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.trusted-by .logos span {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.trusted-by .logos span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.trusted-by .logos span:nth-child(1)::before { background: #7c3aed; }
.trusted-by .logos span:nth-child(2)::before { background: #ec4899; }
.trusted-by .logos span:nth-child(3)::before { background: #3b82f6; }
.trusted-by .logos span:nth-child(4)::before { background: #10b981; }

/* ---------- Sections (features, templates, how-it-works, faq) ---------- */
.features,
.templates-section,
.how-it-works,
.faq {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px;
  position: relative;
  z-index: 1;
}
.features h2,
.templates-section h2,
.how-it-works h2,
.faq h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.section-subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ---------- Templates Grid ---------- */
.templates-section .grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.templates-section .grid .card {
  padding: 0;
  overflow: hidden;
  min-height: 360px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}
.templates-section .grid .card > div:first-child {
  height: 190px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}
.template-info {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.template-info h3 { font-size: 15px; margin-bottom: 6px; }
.template-info p { font-size: 12px; line-height: 1.6; flex: 1; }
.template-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.template-actions a {
  font-size: 11px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}
.template-actions .view-live {
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fff;
}
.template-actions .use-template {
  background: var(--text);
  color: #fff;
}
.template-actions .view-live:hover {
  border-color: var(--text);
  color: var(--text);
}
.template-actions .use-template:hover {
  background: var(--purple);
}

/* ---------- CTA ---------- */
.cta {
  max-width: var(--max);
  margin: 0 auto 80px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
.cta-inner {
  background: linear-gradient(135deg, #fef7ff 0%, #f5f3ff 50%, #eff6ff 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 72px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px at 20% 20%, rgba(124,58,237,.08), transparent 60%),
    radial-gradient(600px at 80% 80%, rgba(236,72,153,.06), transparent 60%);
  pointer-events: none;
}
.cta h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  position: relative;
}
.cta p {
  color: var(--muted);
  margin: 14px auto 28px;
  max-width: 520px;
  font-size: 15px;
  position: relative;
}
.cta .btn { position: relative; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.faq details[open] {
  background: var(--panel-2);
  border-color: var(--border-2);
  box-shadow: 0 8px 24px rgba(124,58,237,.06);
}
.faq summary {
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
  transition: background .2s, color .2s;
}
.faq details[open] summary::after {
  content: '−';
  background: var(--text);
  color: #fff;
}
.faq details p {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: 0;
  position: relative;
  z-index: 1;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 36px;
}
.footer-grid h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-grid p,
.footer-grid li {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.footer-grid ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .templates-section .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hero-landing { padding: 56px 20px 48px; }
  .features,
  .templates-section,
  .how-it-works,
  .faq { padding: 56px 20px; }
  .templates-section .grid { grid-template-columns: 1fr; }
  .cta { padding: 0 16px; margin-bottom: 48px; }
  .cta-inner { padding: 48px 20px; }
  .hero-meta { gap: 8px 12px; font-size: 11px; }
  .trusted-by .logos { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}
/* Templates grid – larger cards */
.templates-section .grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.templates-section .card {
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.templates-section .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(124,58,237,0.12);
}
.templates-section .card .card-preview {
  border-radius: 16px 16px 0 0 !important;
}