:root {
  --bg-root: #040b08;
  --bg-secondary: #07140f;
  --surface-1: rgba(8, 22, 16, 0.9);
  --surface-2: rgba(12, 31, 22, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border-soft: rgba(74, 222, 128, 0.24);
  --border-strong: rgba(52, 211, 153, 0.45);
  --text-primary: #ecfff3;
  --text-secondary: #a6c8b3;
  --text-muted: #6b947f;
  --accent-cyan: #34d399;
  --accent-blue: #22c55e;
  --accent-purple: #10b981;
  --accent-green: #16a34a;
  --danger: #fb7185;
  --success: #22c55e;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-lg: 0 30px 80px -38px rgba(0, 0, 0, 0.86);
  --shadow-md: 0 20px 44px -28px rgba(0, 0, 0, 0.7);
  --gradient-main: linear-gradient(135deg, #22c55e 0%, #16a34a 52%, #34d399 100%);
  --gradient-hero: radial-gradient(circle at 10% -20%, rgba(34, 197, 94, 0.24), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.2), transparent 42%),
    linear-gradient(180deg, #05120c 0%, #040a07 100%);
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======== LIGHT THEME ======== */
body.light-theme {
  --bg-root: #f0faf4;
  --bg-secondary: #e2f5e9;
  --surface-1: rgba(255, 255, 255, 0.95);
  --surface-2: rgba(240, 250, 244, 0.97);
  --surface-soft: rgba(22, 163, 74, 0.06);
  --border-soft: rgba(22, 163, 74, 0.28);
  --border-strong: rgba(16, 130, 62, 0.6);
  --text-primary: #0a2e18;
  --text-secondary: #1a5c35;
  --text-muted: #4a8c62;
  --accent-cyan: #059669;
  --accent-blue: #16a34a;
  --accent-purple: #047857;
  --accent-green: #15803d;
  --danger: #dc2626;
  --success: #15803d;
  --shadow-lg: 0 30px 80px -38px rgba(0, 80, 30, 0.22);
  --shadow-md: 0 20px 44px -28px rgba(0, 80, 30, 0.15);
  --gradient-main: linear-gradient(135deg, #22c55e 0%, #16a34a 52%, #34d399 100%);
  --gradient-hero: radial-gradient(circle at 10% -20%, rgba(34, 197, 94, 0.18), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.14), transparent 42%),
    linear-gradient(180deg, #e8f7ed 0%, #f0faf5 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-root);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 300ms ease, color 300ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  opacity: 0.28;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(130px);
  z-index: -1;
}

.orb-a {
  width: 520px;
  height: 520px;
  left: -200px;
  top: -180px;
  background: rgba(34, 197, 94, 0.24);
}

.orb-b {
  width: 620px;
  height: 620px;
  right: -220px;
  top: -90px;
  background: rgba(16, 185, 129, 0.2);
}

.orb-c {
  width: 540px;
  height: 540px;
  left: 20%;
  bottom: -300px;
  background: rgba(74, 222, 128, 0.2);
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(74, 222, 128, 0.18);
  background: rgba(4, 11, 8, 0.8);
  color: #d2ead8;
}

.topbar-content {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 8px;
  position: relative;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  width: auto;
  height: 52px;
  object-fit: contain;
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: #9ab9a7;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
}

.nav-icon-btn:hover {
  border-color: var(--border-strong);
  color: #ecfff3;
  background: rgba(34, 197, 94, 0.12);
}

.nav-hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: #9ab9a7;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-hamburger span {
  width: 16px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
}

.nav-hamburger:hover {
  border-color: var(--border-strong);
  color: #ecfff3;
  background: rgba(34, 197, 94, 0.12);
}

.topbar-content.nav-open .nav-hamburger {
  border-color: var(--border-strong);
  color: #ecfff3;
}

.nav-menu-link {
  border: 1px solid rgba(74, 222, 128, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: #9ab9a7;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

/* ===== LAMP / THEME TOGGLE BUTTON ===== */
.theme-toggle-btn {
  position: relative;
  transition: var(--transition), box-shadow 300ms ease;
}

.theme-toggle-btn .lamp-icon {
  position: absolute;
  transition: opacity 200ms ease, transform 200ms ease;
}

.theme-toggle-btn .lamp-off {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle-btn .lamp-on {
  opacity: 0;
  transform: scale(0.7);
}

body.light-theme .theme-toggle-btn .lamp-off {
  opacity: 0;
  transform: scale(0.7);
}

body.light-theme .theme-toggle-btn .lamp-on {
  opacity: 1;
  transform: scale(1);
  color: #eab308;
  stroke: #eab308;
}

body.light-theme .theme-toggle-btn {
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.1);
  box-shadow: 0 0 12px 2px rgba(234, 179, 8, 0.25);
}

/* Nav right controls wrapper (hamburger + mobile lamp) */
.nav-right-controls {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Desktop lamp btn inside nav-actions — hide on mobile */
.theme-toggle-desktop {
  display: inline-flex;
}

.nav-menu-link:hover {
  border-color: var(--border-strong);
  color: #ecfff3;
  background: rgba(34, 197, 94, 0.12);
}

/* ========= LIGHT THEME SECTION OVERRIDES ========= */
body.light-theme body::before {
  opacity: 0.06;
}

body.light-theme .bg-orb {
  opacity: 0.35;
}

body.light-theme .hero {
  background:
    radial-gradient(circle at 10% -20%, rgba(34, 197, 94, 0.18), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.14), transparent 42%),
    linear-gradient(rgba(240, 250, 244, 0.92), rgba(240, 250, 244, 0.97)),
    url('whatsapp-bg.png') center/cover no-repeat;
}

body.light-theme .hero h1 {
  color: #0a2e18;
}

body.light-theme .hero-subtitle {
  color: #1a5c35;
}

body.light-theme .hero-label {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.38);
  background: rgba(5, 150, 105, 0.08);
}

body.light-theme .trust-pills li {
  background: rgba(22, 163, 74, 0.07);
  color: #1a5c35;
  border-color: rgba(22, 163, 74, 0.3);
}

body.light-theme .tool-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 250, 244, 0.95));
  border-color: rgba(22, 163, 74, 0.28);
  box-shadow: 0 20px 60px -20px rgba(0, 80, 30, 0.18);
}

body.light-theme .form-field input,
body.light-theme .form-field textarea,
body.light-theme .form-field select {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(22, 163, 74, 0.32);
  color: #0a2e18;
}

body.light-theme .form-field input::placeholder,
body.light-theme .form-field textarea::placeholder {
  color: #4a8c62;
}

body.light-theme .template-chip {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(22, 163, 74, 0.28);
  color: #1a5c35;
}

body.light-theme .template-chip:hover {
  background: rgba(22, 163, 74, 0.1);
  color: #0a2e18;
}

body.light-theme .template-custom input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(22, 163, 74, 0.28);
  color: #0a2e18;
}

body.light-theme .templates-card,
body.light-theme .history-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(22, 163, 74, 0.25);
}

body.light-theme .result-card {
  background: linear-gradient(150deg, rgba(240, 255, 248, 0.95), rgba(220, 252, 231, 0.9));
  border-color: rgba(22, 163, 74, 0.4);
}

body.light-theme .result-card h3 {
  color: #0a2e18;
}

body.light-theme .generated-link {
  color: #059669;
}

body.light-theme .message-preview {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
  color: #1a5c35;
}

body.light-theme .history-item {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(22, 163, 74, 0.24);
}

body.light-theme .history-name {
  color: #0a2e18;
}

body.light-theme .history-tab {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(22, 163, 74, 0.28);
  color: #1a5c35;
}

body.light-theme .history-tab.active {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.5);
  color: #0a2e18;
}

body.light-theme .history-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(22, 163, 74, 0.24);
  color: #1a5c35;
}

body.light-theme .history-btn:hover {
  background: rgba(22, 163, 74, 0.1);
  color: #0a2e18;
}

body.light-theme .history-btn.delete {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

body.light-theme .history-btn.delete:hover {
  background: rgba(220, 38, 38, 0.08);
}

body.light-theme .content-section {
  background: transparent;
}

body.light-theme .content-title {
  color: #0a2e18;
}

body.light-theme .content-block {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(22, 163, 74, 0.24);
}

body.light-theme .content-block h3 {
  color: #0a2e18;
}

body.light-theme .content-block p,
body.light-theme .content-block li {
  color: #1a5c35;
}

body.light-theme .faq-item {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(22, 163, 74, 0.24);
}

body.light-theme .faq-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(22, 163, 74, 0.4);
}

body.light-theme .faq-summary {
  color: #0a2e18;
}

body.light-theme .faq-summary::after {
  color: #059669;
}

body.light-theme .faq-details {
  color: #1a5c35;
}

body.light-theme .final-cta-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 252, 244, 0.96));
  border-color: rgba(22, 163, 74, 0.34);
}

body.light-theme .final-cta-card h2 {
  color: #0a2e18;
}

body.light-theme .final-cta-card p {
  color: #1a5c35;
}

body.light-theme .footer {
  border-color: rgba(22, 163, 74, 0.22);
}

body.light-theme .footer p {
  color: #4a8c62;
}

body.light-theme .btn-soft {
  color: #0a2e18;
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(255, 255, 255, 0.7);
}

body.light-theme .btn-soft:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(22, 163, 74, 0.1);
}

body.light-theme .btn-outline {
  color: #1a5c35;
  border-color: rgba(22, 163, 74, 0.3);
}

body.light-theme .btn-outline:hover:not(:disabled) {
  color: #0a2e18;
  background: rgba(22, 163, 74, 0.1);
}

body.light-theme .modal {
  background: rgba(240, 252, 244, 0.8);
}

body.light-theme .modal-panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(240, 252, 244, 0.97));
  border-color: rgba(22, 163, 74, 0.36);
}

body.light-theme .modal-head h3 {
  color: #0a2e18;
}

body.light-theme .modal-subtitle {
  color: #1a5c35;
}

body.light-theme .close-modal {
  color: #1a5c35;
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(255, 255, 255, 0.6);
}

body.light-theme .toast {
  background: rgba(255, 255, 255, 0.97);
  color: #0a2e18;
  border-color: rgba(22, 163, 74, 0.35);
}

body.light-theme .section-kicker {
  color: #059669;
}

body.light-theme .tool-header h2,
body.light-theme .templates-head h3,
body.light-theme .history-head h3 {
  color: #0a2e18;
}

body.light-theme .tool-header p,
body.light-theme .templates-head p,
body.light-theme .history-head p {
  color: #1a5c35;
}

body.light-theme .result-label {
  color: #15803d;
}

body.light-theme .result-microcopy {
  color: #1a5c35;
}

body.light-theme .history-meta,
body.light-theme .history-message {
  color: #1a5c35;
}

body.light-theme .history-empty {
  color: #4a8c62;
  border-color: rgba(22, 163, 74, 0.28);
}

body.light-theme .template-remove-btn {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.06);
  color: #dc2626;
}

body.light-theme .favorite-btn {
  border-color: rgba(202, 138, 4, 0.4);
  background: rgba(202, 138, 4, 0.06);
  color: #92400e;
}

body.light-theme .favorite-btn.is-active {
  background: rgba(202, 138, 4, 0.15);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(5.8rem, 7vw, 8rem) 0 clamp(2.2rem, 4.5vw, 3.6rem);
  background: 
    radial-gradient(circle at 10% -20%, rgba(34, 197, 94, 0.3), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.25), transparent 42%),
    linear-gradient(rgba(4, 11, 8, 0.85), rgba(4, 11, 8, 0.95)), 
    url('whatsapp-bg.png') center/cover no-repeat;
  border-bottom: 1px solid rgba(74, 222, 128, 0.14);
}

.hero-content {
  text-align: center;
}

.hero-label {
  margin: 0 auto 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8);
  }
  70% {
    box-shadow: 0 0 0 11px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.hero h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 900;
  max-width: 16ch;
  margin-inline: auto;
}

.hero h1::after {
  content: "";
  display: block;
  width: min(260px, 44vw);
  height: 4px;
  margin: 1rem auto 0;
  border-radius: 999px;
  background: var(--gradient-main);
  opacity: 0.9;
}

.hero-subtitle {
  margin: 1.15rem auto 0;
  max-width: 70ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.6vw, 1.14rem);
}

.hero-button {
  margin-top: 1.8rem;
}

.trust-pills {
  margin: 2rem auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.trust-pills li {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.52rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 600;
}

.tool-section {
  padding: clamp(1.7rem, 4vw, 3.2rem) 0;
}

.tool-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, var(--surface-1), var(--surface-2));
  box-shadow: var(--shadow-lg);
  padding: clamp(1rem, 2.8vw, 2.2rem);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--gradient-main);
}

.tool-header {
  margin-bottom: 1.45rem;
}

.section-kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
}

.tool-header h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.45rem, 3.2vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.tool-header p {
  margin: 0.7rem 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.tool-form {
  margin-top: 1.1rem;
}

.form-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.46rem;
}

.form-field label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid rgba(74, 222, 128, 0.26);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
  padding: 0.82rem 0.95rem;
  transition: var(--transition);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 0.82rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.form-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
}

.primary-actions,
.extra-actions,
.result-actions,
.modal-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.primary-actions {
  margin-top: 1.1rem;
}

.extra-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  min-height: 47px;
  padding: 0.78rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.btn-primary {
  color: #ffffff;
  background: var(--gradient-main);
  box-shadow: 0 14px 35px -18px rgba(22, 163, 74, 0.68);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 42px -16px rgba(22, 163, 74, 0.78);
}

.btn-soft {
  color: var(--text-primary);
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
}

.btn-soft:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(34, 197, 94, 0.11);
}

.btn-outline {
  color: var(--text-secondary);
  border-color: rgba(74, 222, 128, 0.24);
  background: transparent;
}

.btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(16, 185, 129, 0.13);
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.templates-card,
.history-card {
  margin-top: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(74, 222, 128, 0.22);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
}

.templates-head h3,
.history-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.01em;
}

.templates-head p,
.history-head p {
  margin: 0.32rem 0 0;
  color: var(--text-secondary);
  font-size: 0.89rem;
}

.template-list {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.template-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.template-chip {
  border: 1px solid rgba(74, 222, 128, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.template-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.template-remove-btn {
  border: 1px solid rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.template-remove-btn:hover {
  background: rgba(251, 113, 133, 0.18);
  color: #ffd2da;
}

.template-custom {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.template-custom input {
  border: 1px solid rgba(74, 222, 128, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.76rem 0.9rem;
  font-size: 0.92rem;
  font-family: inherit;
}

.template-custom input::placeholder {
  color: var(--text-muted);
}

.template-custom input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.result-card {
  margin-top: 1.3rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: linear-gradient(150deg, rgba(15, 32, 32, 0.8), rgba(7, 19, 35, 0.86));
  padding: 1.1rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.result-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-label {
  margin: 0;
  color: var(--success);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.result-card h3 {
  margin: 0.48rem 0 0;
  font-size: clamp(1.15rem, 3.2vw, 1.6rem);
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.02em;
}

.generated-link {
  display: block;
  margin-top: 0.72rem;
  color: var(--accent-cyan);
  text-decoration: none;
  word-break: break-all;
  font-size: 0.92rem;
  font-weight: 700;
}

.generated-link:hover {
  text-decoration: underline;
}

.result-microcopy {
  margin: 0.72rem 0 0;
  color: var(--text-secondary);
  font-size: 0.91rem;
}

.message-preview {
  margin: 0.72rem 0 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.08);
  color: #b7f3d4;
  padding: 0.7rem 0.8rem;
  font-size: 0.88rem;
}

.history-tabs {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
}

.history-tab {
  border: 1px solid rgba(74, 222, 128, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.history-tab.active {
  color: #ffffff;
  border-color: rgba(34, 197, 94, 0.54);
  background: rgba(34, 197, 94, 0.2);
}

.history-list {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.history-empty {
  border-radius: var(--radius-md);
  border: 1px dashed rgba(74, 222, 128, 0.24);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

.history-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(74, 222, 128, 0.2);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
}

.history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.history-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.history-meta {
  margin: 0.28rem 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.favorite-btn {
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.08);
  color: #fcd34d;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.26rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}

.favorite-btn.is-active {
  background: rgba(250, 204, 21, 0.24);
}

.history-message {
  margin: 0.52rem 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.history-actions {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.52rem;
}

.history-btn {
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  min-height: 38px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.history-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.history-btn.delete {
  border-color: rgba(251, 113, 133, 0.26);
  color: #fda4af;
}

.history-btn.delete:hover {
  background: rgba(251, 113, 133, 0.11);
}

.content-section {
  padding: clamp(2.2rem, 5vw, 4.3rem) 0;
}

.content-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.content-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
}

.content-block {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(74, 222, 128, 0.22);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
}

.content-block h3 {
  margin: 0;
  font-size: 1.02rem;
  font-family: "Outfit", sans-serif;
}

.content-block p,
.content-block li {
  color: var(--text-secondary);
  font-size: 0.91rem;
}

.content-block p {
  margin: 0.58rem 0 0;
}

.content-block ul,
.content-block ol {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.38rem;
}

.final-cta {
  padding: clamp(0.7rem, 2vw, 1.4rem) 0 clamp(2.2rem, 5vw, 3.8rem);
}

.final-cta-card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: linear-gradient(160deg, rgba(7, 21, 14, 0.94), rgba(10, 31, 19, 0.9));
  padding: clamp(1.2rem, 4vw, 2.3rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-cta-card::after {
  content: "";
  position: absolute;
  inset: auto -12% -50% auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.24), transparent 65%);
  pointer-events: none;
}

.final-cta-card h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.5rem, 3.9vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.final-cta-card p {
  margin: 0.75rem auto 0;
  max-width: 70ch;
  color: var(--text-secondary);
}

.final-cta-btn {
  margin-top: 1.3rem;
  min-width: min(420px, 100%);
}

.footer {
  padding: 1.2rem 1rem 1.7rem;
  border-top: 1px solid rgba(74, 222, 128, 0.2);
  text-align: center;
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  padding: 1rem;
  background: rgba(2, 10, 7, 0.74);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal.is-open {
  display: flex;
}

.modal-panel {
  width: min(580px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: linear-gradient(170deg, rgba(8, 26, 17, 0.95), rgba(5, 18, 12, 0.95));
  padding: 1rem;
  box-shadow: var(--shadow-md);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.12rem;
  font-family: "Outfit", sans-serif;
}

.close-modal {
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-radius: 10px;
  min-height: 36px;
  padding: 0.25rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-subtitle {
  margin: 0.52rem 0 0;
  color: var(--text-secondary);
  font-size: 0.89rem;
}

.qr-stage {
  margin-top: 0.85rem;
  display: flex;
  justify-content: center;
}

.qr-surface {
  border-radius: 16px;
  background: #f4f7ff;
  min-width: 260px;
  min-height: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

#qrCodeMount {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.6rem;
  z-index: 70;
}

.toast {
  width: min(320px, calc(100vw - 2rem));
  border-radius: 12px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(5, 16, 11, 0.95);
  color: var(--text-primary);
  padding: 0.74rem 0.82rem;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  animation: toastIn 240ms ease;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.38);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.4);
}

.toast.info {
  border-color: rgba(34, 197, 94, 0.42);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 760px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-field.full {
    grid-column: 1 / -1;
  }

  .primary-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .template-custom {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .modal-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .trust-pills {
    justify-content: center;
  }

  .trust-pills li {
    font-size: 0.79rem;
    text-align: center;
  }

  .history-actions {
    grid-template-columns: 1fr;
  }

  .nav-logo img {
    height: 44px;
  }
}

@media (max-width: 900px) {
  /* Show the right-side wrapper (lamp + hamburger) */
  .nav-right-controls {
    display: inline-flex;
  }

  /* Show the hamburger inside the wrapper */
  .nav-hamburger {
    display: inline-flex;
  }

  /* Theme btn inside the dropdown is hidden on mobile (we show the one in nav-right-controls) */
  .theme-toggle-desktop {
    display: none;
  }

  .nav-actions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: min(92vw, 340px);
    padding: 0.6rem;
    border: 1px solid rgba(74, 222, 128, 0.24);
    border-radius: 14px;
    background: rgba(4, 11, 8, 0.97);
    box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.8);
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    display: none;
  }

  body.light-theme .nav-actions {
    background: rgba(240, 252, 244, 0.99);
    border-color: rgba(22, 163, 74, 0.45);
    box-shadow: 0 18px 30px -20px rgba(0, 80, 30, 0.2);
  }

  body.light-theme .nav-menu-link {
    color: #0a2e18;
    border-color: rgba(22, 163, 74, 0.4);
    background: rgba(255, 255, 255, 0.75);
    font-weight: 700;
  }

  body.light-theme .nav-menu-link:hover {
    color: #022e10;
    border-color: rgba(16, 130, 62, 0.7);
    background: rgba(22, 163, 74, 0.14);
  }

  body.light-theme .nav-actions .nav-icon-btn {
    color: #0a2e18;
    border-color: rgba(22, 163, 74, 0.4);
    background: rgba(255, 255, 255, 0.75);
  }

  body.light-theme .nav-actions .nav-icon-btn:hover {
    color: #022e10;
    border-color: rgba(16, 130, 62, 0.7);
    background: rgba(22, 163, 74, 0.14);
  }

  .topbar-content.nav-open .nav-actions {
    display: flex;
  }

  .nav-icon-btn,
  .nav-menu-link {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 38px;
    padding: 0.55rem 0.75rem;
  }

  .nav-icon-btn {
    border-radius: 999px;
  }

  /* Mobile lamp btn should stay compact even when sibling .nav-icon-btn gets width:100% */
  .nav-right-controls .theme-toggle-btn {
    width: 38px;
    height: 38px;
    min-height: unset;
    flex-shrink: 0;
  }
}

/* ===== FAQ and Text Changes ===== */
.content-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.content-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 0.8rem;
}

.faq-section {
  margin-top: 4rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.faq-summary {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none; /* Hide default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent-cyan);
  transition: transform 300ms;
  line-height: 1;
}

details[open] .faq-summary::after {
  content: "-";
  transform: rotate(180deg);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-details {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-secondary);
  border-top: 1px solid transparent;
  animation: faqOpen 300ms ease forwards;
}

@keyframes faqOpen {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .hero {
    min-height: auto;
  }
}

