:root {
  --bg: #FAFAF8;
  --bg2: #F3F3EE;
  --surface: #FFFFFF;
  --surface2: #F7F7F3;
  --border: #E8E8E2;
  --text: #1A1A18;
  --text2: #5C5C58;
  --text3: #9C9C96;
  /* --accent: #FF5C28; */
  --accent: #7C3AED;
  /* --accent2: #FF8A5C; */
  --accent2: #47326d;
  --email-color: #7C3AED;
  --sms-color: #0891B2;
  --wa-color: #16A34A;
  --radius: 14px;
  --shadow: 0 2px 20px rgba(0,0,0,0.07);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
  --bg: #111110;
  --bg2: #1A1A18;
  --surface: #1F1F1D;
  --surface2: #252523;
  --border: #2E2E2C;
  --text: #F5F5F0;
  --text2: #A8A8A0;
  --text3: #6C6C68;
  --shadow: 0 2px 20px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.4);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
/* ---- NAV ---- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.9);
}
[data-theme="dark"] nav { background: rgba(17,17,16,0.9); }
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Google Sans', sans-serif; font-weight: 800;
  font-size: 20px; letter-spacing: -0.5px;
}
.logo-icon {
  width: 34px; height: 34px; background: var(--accent);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 17px;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
  font-weight: 500; color: var(--text2);
  transition: var(--transition);
}
.nav-links a:hover { background: var(--bg2); color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition); color: var(--text2);
}
.theme-toggle:hover { background: var(--bg2); }
.btn-cta {
  padding: 9px 20px; background: var(--accent); color: white;
  border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: var(--transition); border: none; cursor: pointer;
}
.btn-cta:hover { background: #E04D20; transform: translateY(-1px); }
/* ---- HERO ---- */
.hero {
  max-width: 1180px; margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 6px 16px 6px 8px;
  font-size: 13px; font-weight: 500; color: var(--text2);
  margin-bottom: 28px;
}
.hero-badge-dot {
  width: 22px; height: 22px; background: var(--accent);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 11px;
}
.hero h1 {
  font-family: 'Google Sans', sans-serif; font-weight: 800;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08; letter-spacing: -2px;
  color: var(--text); margin-bottom: 20px;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: clamp(16px, 2vw, 19px); color: var(--text2);
  max-width: 540px; margin: 0 auto 44px;
  font-weight: 300; line-height: 1.65;
}
/* ---- AI CHATBOX ---- */
.ai-box {
  max-width: 760px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.ai-box-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255,92,40,0.08), rgba(255,138,92,0.04));
  border-bottom: 1px solid var(--border);
}
.ai-dot { width: 8px; height: 8px; border-radius: 50%; }
.ai-dot.red { background: #FF5F57; }
.ai-dot.yellow { background: #FFBD2E; }
.ai-dot.green { background: #28CA41; }
.ai-box-label {
  margin-left: auto; font-size: 12px; font-weight: 600;
  color: var(--accent); display: flex; align-items: center; gap: 5px;
  text-transform: uppercase; letter-spacing: 1px;
}
.ai-box-label::before {
  content: ''; width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.ai-box-body { padding: 20px; }
.ai-type-row {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.ai-type-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--surface2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text2); transition: var(--transition);
}
.ai-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.ai-type-btn.selected { border-color: var(--accent); background: rgba(255,92,40,0.08); color: var(--accent); }
.ai-type-btn .dot { width: 8px; height: 8px; border-radius: 50%; }
.ai-textarea-wrap { position: relative; }
.ai-textarea {
  width: 100%; min-height: 90px; resize: none;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 14px 16px; padding-right: 120px;
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  color: var(--text); line-height: 1.6; outline: none;
  transition: border-color 0.2s;
}
.ai-textarea::placeholder { color: var(--text3); }
.ai-textarea:focus { border-color: var(--accent); }
.ai-submit-btn {
  position: absolute; right: 10px; bottom: 10px;
  padding: 9px 18px; background: var(--accent); color: white;
  border: none; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.ai-submit-btn:hover { background: #E04D20; }
.ai-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-extras {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.ai-extra-input {
  flex: 1; min-width: 200px; padding: 9px 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.ai-extra-input:focus { border-color: var(--accent); }
.ai-extra-input::placeholder { color: var(--text3); }
.color-picker-wrap {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); white-space: nowrap;
}
.color-swatch {
  width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid var(--border); cursor: pointer;
  overflow: hidden; position: relative;
}
.color-swatch input[type="color"] {
  position: absolute; inset: -4px; width: 140%; height: 140%;
  cursor: pointer; opacity: 0;
}
/* ---- AI RESULT ---- */
.ai-result {
  margin-top: 16px; border-top: 1px solid var(--border);
  padding-top: 16px; display: none;
}
.ai-result.visible { display: block; }
.ai-result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ai-result-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3);
}
.ai-copy-btn {
  padding: 5px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  color: var(--text2); transition: var(--transition);
}
.ai-copy-btn:hover { background: var(--bg2); }
.ai-result-content {
  background: var(--surface2); border-radius: 12px;
  padding: 16px; font-size: 14px; color: var(--text2);
  line-height: 1.8; white-space: pre-wrap;
  max-height: 260px; overflow-y: auto;
}
.ai-result-content.html-preview { white-space: normal; }
.ai-loading { text-align: center; padding: 24px; color: var(--text3); }
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ---- STATS ---- */
.stats-bar {
  background: var(--surface); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; justify-content: center; gap: 0;
  padding: 0 24px;
}
.stat-item {
  padding: 20px 40px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Google Sans', sans-serif; font-size: 26px;
  font-weight: 800; color: var(--text); letter-spacing: -1px;
}
.stat-label { font-size: 12px; color: var(--text3); margin-top: 2px; }
/* ---- SECTION ---- */
.section { padding: 72px 24px; max-width: 1180px; margin: 0 auto; }
.section-header { margin-bottom: 40px; }
.section-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 12px; padding: 5px 12px;
  border-radius: 100px; border: 1.5px solid;
}
.section-tag.email { color: var(--email-color); border-color: var(--email-color); background: rgba(124,58,237,0.06); }
.section-tag.sms { color: var(--sms-color); border-color: var(--sms-color); background: rgba(8,145,178,0.06); }
.section-tag.whatsapp { color: var(--wa-color); border-color: var(--wa-color); background: rgba(22,163,74,0.06); }
.section-title {
  font-family: 'Google Sans', sans-serif; font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.15;
  margin-bottom: 10px;
}
.section-desc { font-size: 16px; color: var(--text2); max-width: 520px; font-weight: 300; }
/* ---- FILTER PILLS ---- */
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px;
}
.filter-pill {
  padding: 6px 14px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--surface2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text2); transition: var(--transition);
}
.filter-pill:hover { border-color: var(--text2); color: var(--text); }
.filter-pill.active { background: var(--text); border-color: var(--text); color: var(--bg); }
/* ---- EMAIL CARDS ---- */
.email-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.email-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--transition); cursor: pointer;
}
.email-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: transparent; }
/* .email-preview-frame {
  height: 220px; overflow: hidden; position: relative;
  background: var(--bg2);
}
.email-preview-frame iframe {
  width: 200%; height: 200%;
  transform: scale(0.5); transform-origin: top left;
  border: none; pointer-events: none;
} */
 .email-preview-frame {
  height: 220px;
  overflow: hidden;
  position: relative;
  background: var(--bg2);
}

.email-preview-frame iframe {
  width: 600px;             /* fixed email width */
  height: 800px;            /* tall enough to show full template */
  border: none;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(var(--preview-scale));
  transform-origin: top center;
}

.email-preview-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.15));
}
.email-card-body { padding: 16px 18px; }
.email-card-title {
  font-family: 'Google Sans', sans-serif; font-weight: 700;
  font-size: 16px; margin-bottom: 6px;
}
.email-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
  font-size: 11px; font-weight: 500; padding: 3px 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 100px; color: var(--text3);
}
.email-card-actions { display: flex; gap: 8px; }
.card-btn {
  flex: 1; padding: 9px; border-radius: 10px;
  border: 1.5px solid var(--border); background: transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text2); font-family: 'DM Sans', sans-serif;
  transition: var(--transition); text-align: center;
}
.card-btn:hover { background: var(--bg2); color: var(--text); }
.card-btn.primary {
  background: var(--email-color); border-color: var(--email-color);
  color: white;
}
.card-btn.primary:hover { opacity: 0.9; }
/* ---- SMS/WA CARDS ---- */
.text-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.text-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: var(--transition);
}
.text-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: transparent; }
.text-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.text-card-title {
  font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: 15px;
}
.sms-meta {
  display: flex; align-items: center; gap: 8px;
}
.sms-badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 100px;
}
.sms-badge.pages { background: rgba(8,145,178,0.1); color: var(--sms-color); }
.sms-badge.chars { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }
.wa-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; background: rgba(22,163,74,0.1); color: var(--wa-color); }
.text-body {
  background: var(--surface2); border-radius: 12px;
  padding: 14px 16px; font-size: 14px; color: var(--text2);
  line-height: 1.75; margin-bottom: 14px; min-height: 80px;
  border: 1px solid var(--border);
}
.text-body.whatsapp { border-left: 3px solid var(--wa-color); }
.text-body.sms { border-left: 3px solid var(--sms-color); }
.text-card-actions { display: flex; gap: 8px; }
.copy-btn {
  flex: 1; padding: 9px; border-radius: 10px;
  border: 1.5px solid var(--border); background: transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text2); font-family: 'DM Sans', sans-serif;
  transition: var(--transition); display: flex; align-items: center;
  justify-content: center; gap: 5px;
}
.copy-btn:hover { background: var(--bg2); color: var(--text); }
.copy-btn.copied { background: var(--wa-color); border-color: var(--wa-color); color: white; }
.copy-btn.copied-sms { background: var(--sms-color); border-color: var(--sms-color); color: white; }
/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: 20px;
  width: 100%; max-width: 700px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  position: sticky; top: 0; background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px; display: flex;
  align-items: center; justify-content: space-between; z-index: 1;
}
.modal-title { font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: 20px; }
.modal-close {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text2); transition: var(--transition);
}
.modal-close:hover { background: var(--bg2); color: var(--text); }
.modal-body { padding: 24px; }
.modal-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.modal-tab {
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent;
  transition: var(--transition); margin-bottom: -1px; background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: 'DM Sans', sans-serif;
}
.modal-tab.active { color: var(--email-color); border-bottom-color: var(--email-color); }
.modal-tab:hover:not(.active) { color: var(--text); }
.modal-preview-wrap {
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; margin-bottom: 16px; background: white;
}
.modal-preview-wrap iframe {
  width: 100%; height: 500px; border: none; display: block;
}
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface2);
  font-size: 14px; font-weight: 500; cursor: pointer;
  color: var(--text2); font-family: 'DM Sans', sans-serif;
  transition: var(--transition);
}
.modal-btn:hover { background: var(--bg2); color: var(--text); }
.modal-btn.primary { background: var(--email-color); border-color: var(--email-color); color: white; }
.modal-btn.primary:hover { opacity: 0.9; }
/* ---- FOOTER ---- */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px 24px 32px; margin-top: 48px;
}
.footer-inner { max-width: 1180px; margin: 0 auto; }
.footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap; margin-bottom: 40px;
}
.footer-logo { font-family: 'Google Sans', sans-serif; font-weight: 800; font-size: 20px; }
.footer-tagline { font-size: 14px; color: var(--text3); margin-top: 6px; max-width: 240px; }
.footer-links h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 12px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links li a { font-size: 14px; color: var(--text2); transition: color 0.2s; }
.footer-links li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text3);
}
/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: 24px; max-width: 800px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-question {
  font-family: 'Google Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.faq-answer {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.6;
  margin: 0;
}
/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .stats-inner { flex-wrap: wrap; justify-content: flex-start; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); padding: 16px 20px; }
  .footer-top { flex-direction: column; gap: 24px; }
  .ai-submit-btn { position: static; width: 100%; margin-top: 10px; border-radius: 10px; }
  .ai-textarea { padding-right: 16px; }
}
/* ---- SECTION DIVIDER ---- */
.section-divider {
  max-width: 1180px; margin: 0 auto;
  border-top: 1px solid var(--border);
}
/* ---- EMPTY STATE EMOJI ---- */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text3); font-size: 15px;
}
.empty-state .emoji { font-size: 48px; display: block; margin-bottom: 12px; }
/* Scroll fade in */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }


/* Animated highlight on color swatches */
.color-swatch-row.__highlighted__ {
  box-shadow: 0 0 0 3px rgba(255, 92, 40, 0.2);
}

/* Pulse animation on Colors tab when triggered from preview */
@keyframes tabPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}