/* Obituary writer. Loads after site.css. */

/* ==================== HERO COMPACT ==================== */
.hero-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 64px;
  text-align: center;
  background: linear-gradient(180deg, var(--off-white) 0%, var(--white) 100%);
  position: relative;
  overflow: hidden;
}
.hero-compact::before {
  content: '';
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(226,242,55,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-compact.compressed {
  display: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-compact h1 {
  font-size: 44px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.5px; color: var(--text-dark); margin-bottom: 14px;
  max-width: 700px;
}
.hero-sub {
  font-size: 18px; color: var(--text-body); max-width: 540px;
  margin: 0 auto 36px; line-height: 1.6;
}

.hero-input-wrap {
  display: flex; gap: 0;
  max-width: 520px; margin: 0 auto 24px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.hero-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(226,242,55,0.15);
}
.hero-input-wrap input {
  flex: 1; padding: 14px 20px; border: none;
  font-family: inherit; font-size: 16px; color: var(--text-dark);
  background: transparent; outline: none; min-width: 0;
  border-radius: 10px;
}
.hero-input-wrap input::placeholder { color: var(--gray-300); }
.hero-start-btn {
  padding: 14px 28px;
  background: var(--text-dark); color: var(--white); border: none;
  font-family: inherit; font-size: 15px; font-weight: 600;
  border-radius: 10px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.hero-start-btn:hover { opacity: 0.9; }

.hero-trust {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  margin-bottom: 0; position: relative;
}
.hero-trust span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.hero-trust svg { flex-shrink: 0; color: #22c55e; }

/* Recent generations */
.recent-wrap {
  margin-top: 32px; position: relative;
}
.recent-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-light); margin-bottom: 10px;
}
.recent-list { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.recent-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-body);
  cursor: pointer; transition: all 0.2s;
}
.recent-item:hover { border-color: var(--gray-300); background: var(--off-white); }
.recent-item-name { font-weight: 600; color: var(--text-dark); }
.recent-item-date { font-size: 12px; color: var(--text-light); }

/* ==================== TOOL SECTION ==================== */
.tool-section {
  display: none;
  padding: 76px 0 60px;
}
.tool-section.visible {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-layout {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 40px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 48px;
  align-items: start;
}

/* ==================== FORM ==================== */
.tool-form {
  padding: 0 0 40px;
}

.field-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 16px;
}

.collapsible-toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); cursor: pointer;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--text-body);
  margin: 12px 0 0;
  width: 100%;
  transition: all 0.2s;
}
.collapsible-toggle:hover { border-color: var(--gray-300); background: var(--light-gray); }
.collapsible-toggle.open { border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: 0; border-bottom-color: transparent; }
.collapsible-toggle .optional-label { font-weight: 400; font-size: 12px; color: var(--text-light); }
.collapsible-chevron {
  width: 20px; height: 20px;
  transition: transform 0.3s;
  color: var(--text-muted);
}
.collapsible-toggle.open .collapsible-chevron { transform: rotate(180deg); }
.collapsible-content {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
  border: 1px solid var(--border-light); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin-bottom: 0;
}
.collapsible-content:not(.open) { border-color: transparent; }
.collapsible-content.open {
  max-height: 600px;
  padding: 20px 18px;
}

.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-compact { display: flex; gap: 14px; align-items: flex-end; }

.form-group label {
  display: block; font-size: 14px; font-weight: 500;
  color: var(--text-dark); margin-bottom: 6px;
}
.form-group .helper-text { font-size: 12px; color: var(--text-light); margin-top: 3px; }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 14px; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--text-dark);
  background: var(--white); transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--gray-300); box-shadow: 0 0 0 3px rgba(226,242,55,0.3);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #8a8a8a; }
.form-group textarea { resize: none; min-height: 48px; overflow: hidden; }
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* Gender pills */
.gender-pills { display: flex; gap: 6px; }
.gender-pill {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--text-body);
  cursor: pointer; transition: all 0.2s; background: var(--white);
}
.gender-pill:hover { border-color: var(--gray-300); }
.gender-pill.selected { border-color: var(--accent); background: rgba(226,242,55,0.08); color: var(--text-dark); }
.gender-pill input { display: none; }

/* Length pills */
.length-pills { display: flex; gap: 6px; }
.length-pill {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--text-body);
  cursor: pointer; transition: all 0.2s; background: var(--white);
}
.length-pill:hover { border-color: var(--gray-300); }
.length-pill.selected { border-color: var(--accent); background: rgba(226,242,55,0.08); color: var(--text-dark); }
.length-pill input { display: none; }
.form-group-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Radio buttons */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--text-dark); }
.radio-option span { font-size: 13px; color: var(--text-body); }
.donation-charity-input { display: none; margin-top: 6px; margin-left: 24px; }
.donation-charity-input.visible { display: block; }
.donation-charity-input input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  color: var(--text-dark); outline: none;
}

/* Generate area */
.generate-wrap {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.btn-generate {
  width: 100%; height: 54px;
  background: linear-gradient(135deg, #e2f237 0%, #c9d42e 100%);
  color: var(--text-dark);
  border: none; font-size: 16px; font-weight: 700; padding: 0 28px;
  border-radius: var(--radius-md); cursor: pointer; transition: all 0.25s;
  font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(226,242,55,0.3);
}
.btn-generate:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(226,242,55,0.4); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-generate svg { width: 18px; height: 18px; }
.generate-hint {
  font-size: 12px; color: var(--text-light); text-align: center; margin-top: 8px; line-height: 1.5;
}
.generate-progress {
  display: none; margin-top: 14px;
}
.generate-progress.visible { display: block; }
.progress-bar-track {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: 2px; transition: width 0.5s ease;
}
.progress-bar-label {
  font-size: 12px; color: var(--text-muted); margin-top: 6px; text-align: center;
}
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(26,26,26,0.2); border-top-color: var(--text-dark);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.privacy-note {
  font-size: 11px; color: var(--text-light); text-align: center;
  margin-top: 10px; line-height: 1.5;
}
.privacy-note svg { display: inline-block; vertical-align: -2px; margin-right: 3px; }

/* ==================== PREVIEW PANEL ==================== */
.tool-preview-wrap {
  position: sticky;
  top: 76px;
  align-self: start;
}
.tool-preview {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 28px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* Tone toggles */
.tone-toggles {
  display: none; gap: 0;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 10px;
  background: var(--off-white);
  flex-wrap: wrap;
}
.tone-toggles.visible { display: flex; }
.tone-label {
  font-size: 11px; font-weight: 500; color: var(--text-light);
  padding: 7px 8px 7px 4px; white-space: nowrap;
}

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-light); font-size: 12px; font-weight: 500;
  animation: bobDown 2s ease-in-out infinite;
}
@keyframes bobDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Start new prominent */
.start-new-strip {
  display: none; text-align: center; padding: 20px 48px;
  max-width: 1200px; margin: 0 auto;
}
.start-new-strip.visible { display: block; }
.btn-start-new {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  font-weight: 600; color: var(--text-body); cursor: pointer; transition: all 0.2s;
}
.btn-start-new:hover { border-color: var(--gray-300); background: var(--off-white); }
.tone-btn {
  padding: 6px 12px; border: none; background: none;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-radius: var(--radius-full);
  transition: all 0.2s; white-space: nowrap;
}
.tone-btn:hover { color: var(--text-body); background: rgba(0,0,0,0.03); }
.tone-btn.active {
  color: var(--text-dark); background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* Preview tabs */
.preview-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border-light);
  padding: 0 20px;
  align-items: center;
}
.preview-tabs .word-count-inline {
  margin-left: auto; font-size: 11px; color: var(--text-light);
  font-family: inherit; padding-right: 4px;
  display: none;
}
.preview-tabs .word-count-inline.visible { display: block; }
.preview-tab {
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.2s; font-family: inherit;
}
.preview-tab.active { color: var(--text-dark); font-weight: 600; border-bottom-color: var(--accent); }
.preview-tab:hover { color: var(--text-dark); }

/* Preview name header */
.preview-name-header {
  display: none;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px; font-weight: 600; color: var(--text-dark);
  letter-spacing: -0.2px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.preview-name-header.visible { display: block; }

/* Preview paper */
.preview-paper {
  padding: 36px 32px;
  min-height: 320px;
  background: linear-gradient(135deg, #fdfdf9 0%, #f9f8f4 100%);
  position: relative;
}
.preview-paper::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
}
.preview-pane { display: none; }
.preview-pane.active { display: block; }
.preview-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px; line-height: 1.85; color: var(--text-dark);
  white-space: pre-wrap;
  position: relative;
  outline: none;
}
.preview-text[contenteditable="true"]:hover {
  background: rgba(226,242,55,0.04);
  border-radius: 4px;
}
.preview-text[contenteditable="true"]:focus {
  background: rgba(226,242,55,0.06);
  border-radius: 4px;
}
.preview-edit-hint {
  display: none; font-size: 11px; color: var(--text-muted);
  font-family: inherit; text-align: center;
  margin-top: 12px; padding: 6px 10px;
  background: rgba(0,0,0,0.03); border-radius: var(--radius-sm);
}
.preview-edit-hint svg { vertical-align: -2px; margin-right: 3px; }
.preview-edit-hint.visible { display: block; }
/* Empty state */
.preview-empty {
  text-align: center; padding: 60px 24px;
  font-family: inherit;
}
.preview-empty-icon {
  font-size: 36px; margin-bottom: 12px; display: block; opacity: 0.25;
}
.preview-empty-title {
  font-size: 16px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px;
}
.preview-empty-sub {
  font-size: 13px; color: var(--text-light); line-height: 1.6; max-width: 320px; margin: 0 auto;
}

/* Section hints */
.section-hint {
  font-size: 12px; color: var(--text-light); font-style: italic;
  margin-top: 4px; padding-left: 14px;
}
/* Streaming cursor */
.streaming-cursor {
  display: inline-block; width: 2px; height: 18px;
  background: var(--text-dark); vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite; margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.word-count { display: none; }
/* Stale banner */
.stale-banner {
  display: none; padding: 10px 16px;
  background: #fefce8; border-bottom: 1px solid #fde68a;
  font-family: inherit; font-size: 13px; color: #92400e;
  text-align: center;
}
.stale-banner.visible { display: block; animation: fadeIn 0.3s ease; }
.stale-banner button {
  background: none; border: none; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #92400e;
  text-decoration: underline; cursor: pointer; margin-left: 6px;
}

.ai-badge {
  display: none; font-size: 12px; font-style: italic; color: var(--text-light);
  text-align: center; margin-top: 16px;
  font-family: inherit;
}
.ai-badge.visible { display: block; animation: fadeIn 0.6s ease; }
.preview-powered {
  display: none; font-size: 11px; color: var(--text-light);
  text-align: center; margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-family: inherit;
}
.preview-powered.visible { display: block; }
.preview-powered a { color: var(--text-muted); text-decoration: underline; }
.preview-powered a:hover { color: var(--text-dark); }

/* Preview upsell */
.preview-upsell {
  display: none; margin-top: 16px;
}
.preview-upsell.visible { display: block; animation: fadeIn 0.6s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.preview-upsell-inner {
  background: linear-gradient(135deg, #0a1628 0%, #162a50 40%, #1c3a6e 70%, #1a2f5a 100%);
  border-radius: var(--radius-xl); padding: 32px 36px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(10,22,40,0.25);
}
.preview-upsell p {
  font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.65; margin-bottom: 20px;
  max-width: 380px; margin-left: auto; margin-right: auto;
}
.preview-upsell strong { color: #ffffff; }
.preview-upsell-form {
  display: flex; gap: 0; background: #ffffff; border-radius: 10px;
  padding: 4px; align-items: center;
  max-width: 380px; margin: 0 auto;
}
.preview-upsell-form input[type="email"] {
  flex: 1; padding: 11px 16px; border: none; border-radius: 7px;
  font-family: inherit; font-size: 13px; background: transparent;
  color: var(--text-dark); outline: none; min-width: 0;
}
.preview-upsell-form input::placeholder { color: var(--text-light); }
.preview-upsell-form button {
  padding: 11px 24px; background: var(--accent); color: var(--text-dark);
  border: none; border-radius: 7px; font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.2s; flex-shrink: 0;
}
.preview-upsell-form button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.preview-upsell-msg { font-size: 14px; color: #ffffff; font-weight: 600; margin-top: 10px; }

/* Export bar */
.export-bar {
  display: none;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--off-white);
  gap: 8px;
  flex-wrap: wrap;
}
.export-bar.visible { display: flex; }
.btn-export {
  padding: 8px 16px; font-family: inherit; font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 5px; border: none;
}
.btn-export-primary {
  background: var(--blue); color: var(--white);
}
.btn-export-primary:hover { background: var(--blue-hover); }
.btn-export-secondary {
  background: var(--white); color: var(--text-body); border: 1px solid var(--border);
}
.btn-export-secondary:hover { border-color: var(--gray-300); }
.btn-export-link {
  background: none; color: var(--text-muted); padding: 8px 10px;
  font-weight: 500; text-decoration: underline;
}
.btn-export-link:hover { color: var(--text-dark); }
.btn-undo {
  display: none; padding: 8px 14px; font-family: inherit; font-size: 13px;
  font-weight: 500; color: var(--text-muted); background: none;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s; margin-left: auto;
  align-items: center; gap: 5px;
}
.btn-undo.visible { display: inline-flex; }
.btn-undo:hover { border-color: var(--gray-300); color: var(--text-body); }


/* ==================== POST-GENERATE ==================== */
.post-generate {
  display: none;
  max-width: 1280px; margin: 0 auto;
  padding: 0 48px 40px;
}
.post-generate.visible { display: block; animation: fadeSlideIn 0.4s ease; }

.post-generate-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

/* Email capture */
.email-capture-card {
  background: var(--off-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
}
.email-capture-card h3 {
  font-size: 15px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px;
}
.email-capture-card p {
  font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
}
.email-capture-form {
  display: flex; gap: 8px;
}
.email-capture-form input[type="email"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  outline: none; min-width: 0;
}
.email-capture-form input:focus { border-color: var(--gray-300); }
.email-capture-form button {
  padding: 9px 18px; background: var(--blue); color: var(--white);
  border: none; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.2s;
}
.email-capture-form button:hover { background: var(--blue-hover); }
.email-capture-msg {
  display: none; font-size: 13px; font-weight: 600; color: #22c55e; margin-top: 8px;
}

/* Contextual upsell */
.upsell-card {
  background: linear-gradient(135deg, #0a1628 0%, #162a50 40%, #1c3a6e 70%, #1a2f5a 100%);
  border-radius: var(--radius-md); padding: 24px;
  color: var(--white);
}
.upsell-card p {
  font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.65; margin-bottom: 16px;
}
.upsell-card strong { color: var(--white); }
.upsell-card a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  text-decoration: none; transition: opacity 0.2s;
}
.upsell-card a:hover { opacity: 0.85; }

/* ==================== ERROR ==================== */
.error-message {
  display: none; max-width: 640px; margin: 0 auto 24px; padding: 14px 18px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm);
  color: #991b1b; font-size: 13px; text-align: center;
}
.error-message.visible { display: block; }
.error-message button {
  background: none; border: none; color: #991b1b; font-weight: 600;
  text-decoration: underline; cursor: pointer; font-family: inherit; font-size: 13px; margin-left: 8px;
}
.error-message a {
  color: var(--blue); font-weight: 700; text-decoration: underline;
}
.error-message a:hover { color: var(--blue-hover); }
.generations-remaining {
  display: none; font-size: 12px; color: var(--text-light);
  font-family: inherit; text-align: center; margin-top: 10px;
}
.generations-remaining.visible { display: block; }
.generations-remaining.warning { color: #b45309; }

/* Feature teaser buttons */
.feature-teaser-bar {
  display: none; padding: 10px 20px;
  border-top: 1px solid var(--border-light);
  gap: 8px; flex-wrap: wrap; justify-content: center;
}
.feature-teaser-bar.visible { display: flex; }
.btn-teaser {
  padding: 8px 16px; font-family: inherit; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--off-white); color: var(--text-light); border: 1px solid var(--border-light);
  opacity: 0.7;
}
.btn-teaser:hover { opacity: 1; }
.btn-teaser svg { opacity: 0.5; }
.teaser-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text-dark); color: var(--white); font-size: 11px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm); white-space: nowrap;
  font-family: inherit;
}
.btn-teaser-wrap { position: relative; display: inline-flex; }
.btn-teaser-wrap:hover .teaser-tooltip { display: block; }

/* ==================== BELOW FOLD SOCIAL PROOF ==================== */
.below-fold-proof {
  padding: 80px 0;
  background: var(--off-white);
  border-top: 1px solid var(--border-light);
}
.proof-layout {
  max-width: 900px; margin: 0 auto;
  text-align: center;
}
.proof-layout h2 {
  font-size: 28px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 40px; letter-spacing: -0.3px;
}
.testimonial-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 960px; margin: 0 auto 40px;
}
.testimonial-card {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  text-align: left;
}
.testimonial-stars { color: #f59e0b; font-size: 14px; letter-spacing: 2px; margin-bottom: 10px; }
.testimonial-quote {
  font-size: 15px; font-style: italic; color: var(--text-body);
  line-height: 1.65; margin-bottom: 10px;
}
.testimonial-attr {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.proof-stats {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
}
.proof-stat { text-align: center; }
.proof-stat-num {
  font-size: 28px; font-weight: 700; color: var(--text-dark);
  display: block; margin-bottom: 4px;
}
.proof-stat-label {
  font-size: 13px; color: var(--text-muted);
}

/* ==================== PRE-FOOTER CTA ==================== */
.pre-footer-cta {
  padding: 80px 0;
  text-align: center;
}
.pre-footer-cta-inner {
  max-width: 680px; margin: 0 auto;
  background: linear-gradient(135deg, #0a1628 0%, #162a50 40%, #1c3a6e 70%, #1a2f5a 100%);
  border-radius: var(--radius-xl); padding: 48px;
  box-shadow: 0 20px 50px rgba(10,22,40,0.25);
}
.pre-footer-cta h2 {
  font-size: 24px; font-weight: 700; color: #ffffff;
  margin-bottom: 8px; letter-spacing: -0.3px;
}
.pre-footer-cta p {
  font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 28px; line-height: 1.6;
}
.pre-footer-cta-form {
  display: flex; gap: 0; background: #ffffff; border-radius: 12px;
  padding: 5px; align-items: center; max-width: 460px; margin: 0 auto;
}
.pre-footer-cta-form input[type="email"] {
  font-family: inherit; font-size: 14px; padding: 12px 18px;
  border: none; border-radius: 8px; background: transparent;
  color: var(--text-dark); flex: 1; outline: none; min-width: 0;
}
.pre-footer-cta-form input[type="email"]::placeholder { color: var(--text-light); }
.pre-footer-cta-form button {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px 28px; background: #e2f237; color: #1a1a1a; border: none;
  border-radius: 8px; cursor: pointer; transition: background 0.2s, transform 0.2s;
  white-space: nowrap; flex-shrink: 0;
}
.pre-footer-cta-form button:hover { background: #d4e42e; transform: translateY(-1px); }
.pre-footer-cta-msg { font-size: 14px; color: #ffffff; margin-top: 12px; font-weight: 600; }
.preview-upsell-msg a, .pre-footer-cta-msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .tool-layout { gap: 32px; }
  .post-generate-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; max-width: 520px; }
}

@media (max-width: 768px) {
  .hero-compact { padding: 100px 20px 48px; }
  .hero-compact h1 { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .hero-input-wrap { flex-direction: column; gap: 8px; padding: 8px; }
  .hero-start-btn { width: 100%; text-align: center; }
  .hero-trust { flex-direction: column; gap: 8px; align-items: center; }

  .tool-layout { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; }
  .tool-preview-wrap { position: static; }
  .tool-preview-wrap:not(.has-content) { display: none; }
  .tool-preview-wrap.has-content { display: block; }
  .mobile-preview-btn.visible { display: block; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .form-row-compact { flex-wrap: wrap; }
  .form-row-compact .form-group { width: 100% !important; flex: unset !important; }
  .gender-pills { flex-wrap: wrap; }

  .form-group input[type="text"], .form-group input[type="number"],
  .form-group textarea, .form-group select { font-size: 16px; min-height: 44px; }

  .tone-toggles { padding: 6px 8px; }
  .tone-btn { font-size: 11px; padding: 5px 10px; }
  .preview-paper { padding: 20px 16px; }

  .export-bar { flex-direction: column; }
  .btn-export { width: 100%; justify-content: center; text-align: center; }
  .preview-upsell-form { flex-direction: column; gap: 6px; background: none; padding: 0; max-width: 100%; }
  .preview-upsell-form input[type="email"] { width: 100%; background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 13px 16px; }
  .preview-upsell-form input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }
  .preview-upsell-form button { width: 100%; border-radius: 8px; }

  .post-generate { padding: 0 20px 40px; }
  .post-generate-grid { grid-template-columns: 1fr; }

  .below-fold-proof { padding: 60px 20px; }
  .proof-stats { flex-direction: column; gap: 24px; }

  .faq-section { padding: 60px 20px; }
  .faq-section h2 { font-size: 24px; }
  .faq-question { font-size: 15px; }

  .pre-footer-cta { padding: 60px 20px; }
  .pre-footer-cta-inner { padding: 32px 20px; }
  .pre-footer-cta h2 { font-size: 20px; }
  .pre-footer-cta-form { flex-direction: column; gap: 8px; background: none; padding: 0; max-width: 100%; }
  .pre-footer-cta-form input[type="email"] { width: 100%; background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; padding: 13px 18px; }
  .pre-footer-cta-form input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }
  .pre-footer-cta-form button { width: 100%; border-radius: 10px; }

}

/* Light hero: undo the homepage hero grid and white text */
.hero-compact .hero-inner { display: block; max-width: none; padding: 0; }
.hero-compact .hero-sub { color: var(--text-muted); font-size: 18px; max-width: 540px; margin: 0 auto 36px; }
.hero-compact h1, .faq-section h2 { color: var(--navy-deep); }
.faq-section h2 { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 40px; letter-spacing: -0.8px; }
.faq-chevron { width: 18px; height: 18px; }
.nav[data-light-nav] .nav-links a::after { background: var(--blue); }
