/* ==========================================================
   CaretIQ — Global Design System
   Light theme, soft gradients, minimal Apple-inspired SaaS UI
   ========================================================== */

:root {
  --color-bg: #fbfbfd;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f6fa;
  --color-border: #e7e8ee;
  --color-text: #16171d;
  --color-text-muted: #6b6f7b;
  --color-text-faint: #9497a3;

  --color-primary: #4f46e5;
  --color-primary-dark: #3f37c9;
  --color-primary-light: #eef0ff;
  --color-accent: #06b6a4;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-success: #10b981;

  --gradient-hero: linear-gradient(135deg, #eef0ff 0%, #f8f6ff 40%, #eafffb 100%);
  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c6ff0 100%);
  --gradient-accent: linear-gradient(135deg, #06b6a4 0%, #4f46e5 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 17, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 17, 30, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 17, 30, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--color-text-muted);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--color-text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  margin-left: 4px;
  line-height: 1;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle-bar + .nav-toggle-bar { margin-top: 5px; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 70, 229, 0.36); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { color: var(--color-text); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 15.5px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Sections & Cards ---------- */
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  max-width: 620px;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ---------- Hero ---------- */
.hero {
  background: var(--gradient-hero);
  padding: 110px 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 820px;
  margin: 0 auto 22px;
}
.hero p.lead {
  font-size: 18.5px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
}
.hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-badges {
  display: flex; justify-content: center; gap: 28px; margin-top: 54px;
  flex-wrap: wrap; color: var(--color-text-faint); font-size: 13.5px; font-weight: 600;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--color-text);
}
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-sans);
  background: var(--color-surface);
  color: var(--color-text);
  transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
textarea { resize: vertical; min-height: 120px; }

.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-surface-alt);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--color-primary); background: var(--color-primary-light); }
.upload-zone .icon { font-size: 30px; margin-bottom: 10px; }

/* ---------- Grid layouts ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Badges / tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}
.tag-success { background: #ecfdf5; color: #067a55; }
.tag-danger { background: #fef2f2; color: #b91c1c; }
.tag-warning { background: #fffbeb; color: #92400e; }
.tag-primary { background: var(--color-primary-light); color: var(--color-primary); }

/* ---------- Score ring ---------- */
.score-ring { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring-value {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-ring-value .num { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.score-ring-value .label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; }

/* ---------- Progress bar (breakdown) ---------- */
.metric-row { margin-bottom: 16px; }
.metric-row .metric-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.progress-track { height: 8px; background: var(--color-surface-alt); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-primary); border-radius: var(--radius-full); transition: width 0.6s ease; }

/* ---------- Pricing ---------- */
.price-card { padding: 36px 30px; text-align: left; }
.price-card.featured { border: 2px solid var(--color-primary); box-shadow: var(--shadow-lg); position: relative; }
.price-card .price { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; margin: 14px 0; }
.price-card .price span { font-size: 15px; font-weight: 500; color: var(--color-text-muted); }
.price-card ul { margin: 22px 0; }
.price-card li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; color: var(--color-text-muted); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--color-border); padding: 50px 0 30px; margin-top: 60px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; margin-bottom: 14px; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a { display: block; font-size: 14px; color: var(--color-text-muted); margin-bottom: 10px; }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; color: var(--color-text-faint); font-size: 13px; margin-top: 40px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--color-text); color: white;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999; opacity: 0; transform: translateY(10px);
  transition: var(--transition);
  max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-success); }

/* ---------- Lock overlay for premium templates ---------- */
.template-card { position: relative; overflow: hidden; }
.template-thumb {
  aspect-ratio: 3/4;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-faint);
  font-size: 13px;
  position: relative;
}
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(22, 23, 29, 0.55);
  backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: white; gap: 8px; font-weight: 600; font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 680px) {
  .nav-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: #fff;
    padding: 8px 24px 18px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 12px 24px rgba(15, 16, 22, 0.08);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
  .nav-links a:last-child { border-bottom: none; }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
  .hero { padding: 70px 0 60px; }
}
