/* ═══════════════════════════════════════════════════════
   GRIDLESS — Design System
   Inspired by Linear (restraint), Stripe (calm authority),
   Notion (warm onboarding)
   ═══════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────── */
:root {
  /* Brand */
  --g-primary: #0C7C59;
  --g-primary-hover: #0A6847;
  --g-primary-light: #E8F5EE;
  --g-primary-subtle: #F0FDF6;

  /* Neutrals — warm, not clinical */
  --g-900: #111827;
  --g-800: #1F2937;
  --g-700: #374151;
  --g-600: #4B5563;
  --g-500: #6B7280;
  --g-400: #9CA3AF;
  --g-300: #D1D5DB;
  --g-200: #E5E7EB;
  --g-100: #F3F4F6;
  --g-50: #F9FAFB;
  --g-bg: #FAFBFC;
  --g-white: #FFFFFF;

  /* Semantic */
  --g-success: #059669;
  --g-warning: #D97706;
  --g-danger: #DC2626;
  --g-info: #2563EB;

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows — subtle, layered */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--g-700);
  background: var(--g-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--g-primary); text-decoration: none; }
a:hover { color: var(--g-primary-hover); }

img { max-width: 100%; display: block; }

/* ─── TYPOGRAPHY ────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.t-display-xl { font-size: 56px; }
.t-display-lg { font-size: 44px; }
.t-display-md { font-size: 34px; }

.t-heading {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--g-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.t-heading-lg { font-size: 24px; }
.t-heading-md { font-size: 20px; }
.t-heading-sm { font-size: 16px; }

.t-body { font-size: 15px; color: var(--g-600); line-height: 1.65; }
.t-body-sm { font-size: 13px; color: var(--g-500); line-height: 1.55; }
.t-body-xs { font-size: 11px; color: var(--g-400); line-height: 1.5; }

.t-label {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--g-500);
}

.t-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

.t-primary { color: var(--g-primary); }
.t-dark { color: var(--g-900); }
.t-muted { color: var(--g-400); }

/* ─── LAYOUT ────────────────────────────────────────── */
.l-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
}

.l-container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
}

.l-flex { display: flex; }
.l-flex-col { display: flex; flex-direction: column; }
.l-grid { display: grid; }
.l-center { align-items: center; }
.l-between { justify-content: space-between; }
.l-gap-1 { gap: var(--sp-1); }
.l-gap-2 { gap: var(--sp-2); }
.l-gap-3 { gap: var(--sp-3); }
.l-gap-4 { gap: var(--sp-4); }
.l-gap-6 { gap: var(--sp-6); }
.l-gap-8 { gap: var(--sp-8); }

/* ─── NAVBAR ────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--g-200);
  padding: 0 var(--sp-8);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}

.navbar-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--g-primary), var(--g-primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.navbar-name {
  font-weight: 800;
  font-size: 17px;
  color: var(--g-900);
  letter-spacing: -0.03em;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}

.navbar-link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--g-600);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.navbar-link:hover {
  background: var(--g-100);
  color: var(--g-900);
}

.navbar-link.active {
  color: var(--g-primary);
  background: var(--g-primary-light);
}

/* Mobile nav */
.navbar-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--g-600);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.navbar-hamburger:hover { background: var(--g-100); }

.navbar-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--g-white);
  border-bottom: 1px solid var(--g-200);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2) var(--sp-4);
  z-index: 100;
}

.navbar-mobile-link {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: 15px;
  font-weight: 500;
  color: var(--g-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.navbar-mobile-link:hover { background: var(--g-50); color: var(--g-900); }

@media (max-width: 768px) {
  .navbar-hamburger { display: flex; align-items: center; justify-content: center; }
  .navbar-mobile-menu[style*="display: block"] { display: block !important; }
  .navbar-nav-desktop { display: none !important; }
  .navbar-login-btn { display: none !important; }
  .navbar { position: relative; }
}

/* ─── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  line-height: 1;
  height: 40px;
}

.btn-primary {
  background: var(--g-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(12, 124, 89, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
  background: var(--g-primary-hover);
  box-shadow: 0 2px 8px rgba(12, 124, 89, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--g-white);
  color: var(--g-700);
  border: 1.5px solid var(--g-200);
}
.btn-secondary:hover {
  background: var(--g-50);
  border-color: var(--g-300);
}

.btn-ghost {
  background: transparent;
  color: var(--g-600);
}
.btn-ghost:hover {
  background: var(--g-100);
  color: var(--g-900);
}

.btn-lg {
  height: 48px;
  padding: var(--sp-4) var(--sp-8);
  font-size: 15px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  height: 32px;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* ─── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--g-300);
  box-shadow: var(--shadow-md);
}

.card-interactive:hover {
  border-color: var(--g-primary);
  box-shadow: 0 4px 16px rgba(12, 124, 89, 0.08);
  transform: translateY(-2px);
}

.card-body { padding: var(--sp-6); }
.card-body-sm { padding: var(--sp-4); }

/* ─── FORM ELEMENTS ─────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-label {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--g-500);
}

.form-label .required {
  color: var(--g-danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--g-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--g-800);
  background: var(--g-white);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
  height: 44px;
}

.form-input::placeholder {
  color: var(--g-400);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--g-primary);
  box-shadow: 0 0 0 3px rgba(12, 124, 89, 0.1);
  background: var(--g-primary-subtle);
}

.form-input-currency {
  padding-left: 32px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
}

.form-input-percent {
  padding-right: 32px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.form-prefix, .form-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--g-400);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}
.form-prefix { left: 14px; }
.form-suffix { right: 14px; }

.form-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--g-200);
  color: var(--g-500);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
}

.form-select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

/* ─── COMPUTED FIELD ────────────────────────────────── */
.computed-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--g-50);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.computed-field.highlight {
  background: var(--g-primary-light);
  border-color: #BBF7D0;
}

.computed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--g-200);
  color: var(--g-500);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.computed-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--g-800);
}

.computed-field.highlight .computed-value {
  color: var(--g-primary);
  font-size: 17px;
}

/* ─── WARNING BADGE ─────────────────────────────────── */
.warning-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #FEF3C7;
  color: var(--g-warning);
  font-size: 11px;
  font-weight: 600;
}

/* ─── SECTION ACCORDION ─────────────────────────────── */
.section-panel {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.section-panel.active {
  border-color: var(--g-primary);
  box-shadow: 0 2px 12px rgba(12, 124, 89, 0.06);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-5) var(--sp-6);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast);
}

.section-header:hover {
  background: var(--g-50);
}

.section-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--g-100);
}

.section-panel.active .section-icon {
  background: var(--g-primary-light);
}

.section-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--g-900);
}

.section-desc {
  font-size: 12.5px;
  color: var(--g-400);
  margin-top: 2px;
}

.section-body {
  padding: 0 var(--sp-6) var(--sp-6);
  display: none;
}

.section-panel.active .section-body {
  display: block;
  animation: slideReveal var(--duration-normal) var(--ease-out);
}

.section-chevron {
  color: var(--g-300);
  font-size: 18px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.section-panel.active .section-chevron {
  transform: rotate(180deg);
}

/* ─── PROGRESS BAR ──────────────────────────────────── */
.progress-track {
  height: 4px;
  background: var(--g-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--g-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-fill.complete {
  background: var(--g-success);
}

/* ─── SIDEBAR ───────────────────────────────────────── */
.sidebar {
  width: 252px;
  position: sticky;
  top: 72px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sidebar-card {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--g-600);
  text-align: left;
  transition: all var(--duration-fast);
  border-radius: var(--radius-sm);
  margin: 1px var(--sp-2);
  width: calc(100% - var(--sp-4));
}

.sidebar-nav-item:hover {
  background: var(--g-50);
  color: var(--g-900);
}

.sidebar-nav-item.active {
  background: var(--g-primary-light);
  color: var(--g-primary);
  font-weight: 600;
}

.sidebar-nav-icon { font-size: 15px; }

/* ─── TEMPLATE CARDS (Browser) ──────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.template-card {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.template-card:hover {
  border-color: var(--g-primary);
  box-shadow: 0 8px 24px rgba(12, 124, 89, 0.08);
  transform: translateY(-3px);
}

.template-thumb {
  height: 180px;
  background: var(--g-100);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.template-thumb-inner {
  width: 80%;
  height: 80%;
  background: var(--g-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.template-thumb-line {
  height: 6px;
  border-radius: 3px;
  background: var(--g-200);
}
.template-thumb-line.short { width: 60%; }
.template-thumb-line.accent { background: var(--g-primary-light); width: 40%; }

.template-meta {
  padding: var(--sp-5);
}

.template-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--g-primary-light);
  color: var(--g-primary);
}

.template-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--g-900);
  margin-top: var(--sp-3);
  line-height: 1.35;
}

.template-desc {
  font-size: 13px;
  color: var(--g-500);
  margin-top: var(--sp-2);
  line-height: 1.5;
}

.template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--g-100);
}

.template-stat {
  font-size: 12px;
  color: var(--g-400);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ─── PROPERTY TABS ─────────────────────────────────── */
.property-tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--sp-5);
}

.property-tab {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
  background: var(--g-50);
  color: var(--g-600);
}

.property-tab.active {
  background: var(--g-primary);
  color: white;
}

.property-tab-add {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--g-primary);
  background: var(--g-primary-subtle);
  color: var(--g-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ─── TOOLTIP ───────────────────────────────────────── */
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--g-900);
  color: white;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--g-900);
}

/* ─── DIVIDER ───────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--g-200);
}

.divider-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--g-400);
}

/* ─── BADGE ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-premium { background: #FEF3C7; color: #92400E; }

/* ─── ANIMATIONS ────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideReveal {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

/* ─── HERO (Landing page) ───────────────────────────── */
.hero {
  padding: var(--sp-20) 0 var(--sp-16);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  background: var(--g-primary-light);
  color: var(--g-primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--sp-6);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 52px;
  color: var(--g-900);
  line-height: 1.12;
  max-width: 700px;
  margin: 0 auto var(--sp-6);
}

.hero-title em {
  color: var(--g-primary);
  font-style: normal;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--g-500);
  max-width: 520px;
  margin: 0 auto var(--sp-10);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}

/* ─── LANDING PAGE COMPONENTS ──────────────────────── */
.section-padding { padding: var(--sp-16) 0; }
.section-bg { background: var(--g-white); border-top: 1px solid var(--g-100); border-bottom: 1px solid var(--g-100); }
.section-heading-narrow { max-width: 500px; margin-left: auto; margin-right: auto; }

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
}

.step-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--g-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
  font-size: 24px;
}

/* Section header row */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-8);
}

/* Template thumb blocks */
.template-thumb-blocks {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-top: auto;
}
.template-thumb-blocks.two-col { grid-template-columns: 1fr 2fr; }
.template-thumb-blocks.four-grid { grid-template-columns: 1fr 1fr; }

.template-thumb-block {
  background: var(--g-100);
  border-radius: 3px;
  height: 22px;
}
.template-thumb-block.accent { background: var(--g-primary-light); }
.template-thumb-block.wide { grid-column: span 1; }

/* Niche grid */
.niche-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.niche-card {
  background: var(--g-white);
  border: 1px solid var(--g-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}
.niche-card:hover { border-color: var(--g-300); box-shadow: var(--shadow-md); }

.niche-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--g-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.niche-card-content { flex: 1; min-width: 0; }

/* CTA box */
.cta-box {
  background: linear-gradient(135deg, #0f2b1d 0%, #1a4d35 40%, var(--g-primary) 100%);
  border-radius: var(--radius-xl);
  padding: var(--sp-16) var(--sp-12);
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.cta-circle-1 { top: -60px; right: -60px; width: 200px; height: 200px; }
.cta-circle-2 { bottom: -40px; left: 30%; width: 300px; height: 300px; background: rgba(255,255,255,0.02); }

.cta-content { position: relative; z-index: 1; }

.cta-title {
  font-family: var(--font-display);
  font-size: 34px;
  color: white;
  margin-bottom: var(--sp-4);
}

.cta-subtitle {
  font-size: 17px;
  opacity: 0.75;
  max-width: 420px;
  margin: 0 auto var(--sp-8);
}

.cta-btn {
  background: white;
  color: var(--g-primary);
  font-weight: 700;
}

/* ─── UTILITIES ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.relative { position: relative; }
/* ─── TEMPLATES PAGE LAYOUT ─────────────────────────── */
.templates-layout {
  display: flex;
  gap: var(--sp-8);
}

.templates-filter-sidebar {
  width: 200px;
  flex-shrink: 0;
}

/* ─── FOOTER ────────────────────────────────────────── */
.site-footer {
  padding: var(--sp-12) 0;
  border-top: 1px solid var(--g-200);
  margin-top: var(--sp-16);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-8);
}

.footer-brand { max-width: 280px; }

.footer-links {
  display: flex;
  gap: var(--sp-8);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer-link {
  font-size: 13px;
  color: var(--g-500);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-link:hover { color: var(--g-900); }

.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--g-100);
}

/* ─── UTILITIES ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.pt-0 { padding-top: 0; }

/* Number input spinner removal */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* ─── RESPONSIVE ────────────────────────────────────── */

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .l-container { max-width: 100%; }
  .l-container-narrow { max-width: 100%; }
  .navbar { padding: 0 var(--sp-4); }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: var(--sp-12) 0 var(--sp-10); }
  .hero-title { font-size: 44px; }
  .section-padding { padding: var(--sp-12) 0; }
}

/* Mobile (768px) */
@media (max-width: 768px) {
  /* Navbar */
  .navbar { padding: 0 var(--sp-3); height: 50px; }
  .navbar-nav-desktop { display: none !important; }
  .navbar-login-btn { display: none !important; }
  .navbar .l-flex.l-center.l-gap-8 { gap: var(--sp-3); }
  .navbar-hamburger { display: flex; align-items: center; justify-content: center; }
  .navbar-mobile-menu[style*="display: block"] { display: block !important; }
  .navbar { position: relative; }

  /* Containers */
  .l-container, .l-container-narrow { padding: 0 var(--sp-4); }

  /* Hero */
  .hero { padding: var(--sp-10) 0 var(--sp-8); }
  .hero-title { font-size: 32px; max-width: 100%; }
  .hero-subtitle { font-size: 15px; max-width: 100%; }
  .hero-badge { font-size: 11px; }
  .hero-actions { flex-direction: column; gap: var(--sp-3); }
  .hero-actions .btn { width: 100%; text-align: center; justify-content: center; }

  /* Steps */
  .steps-grid { grid-template-columns: 1fr; gap: var(--sp-6); }

  /* Section headers */
  .section-header-row { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .section-padding { padding: var(--sp-10) 0; }

  /* Templates */
  .template-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .template-thumb { height: 140px; }

  /* Niches */
  .niche-grid { grid-template-columns: 1fr; }
  .niche-badge { display: none; }

  /* CTA */
  .cta-box { padding: var(--sp-10) var(--sp-6); }
  .cta-title { font-size: 26px; }
  .cta-subtitle { font-size: 15px; }

  /* Footer */
  .footer-top { flex-direction: column; gap: var(--sp-6); }
  .footer-brand { max-width: 100%; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: var(--sp-6); }
  .footer-col { min-width: 120px; }
  .site-footer { padding: var(--sp-8) 0; margin-top: var(--sp-10); }

  /* Template browser sidebar */
  .templates-filter-sidebar { display: none; }

  /* Sidebar (workspace) */
  .sidebar { display: none; }

  /* General */
  .t-display-xl { font-size: 36px; }
  .t-display-lg { font-size: 30px; }
  .t-display-md { font-size: 24px; }
  .t-heading-lg { font-size: 20px; }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .navbar-name { font-size: 15px; }
  .btn-lg { height: 44px; padding: var(--sp-3) var(--sp-6); font-size: 14px; }
  .cta-title { font-size: 22px; }
  .template-meta { padding: var(--sp-4); }
  .template-name { font-size: 14px; }
  .card-body { padding: var(--sp-4); }
}
