/* ===========================================
   ListingMath styles
   Warm editorial aesthetic for craft sellers
   =========================================== */

:root {
  --cream: #F7F2E8;
  --paper: #FFFEFB;
  --paper-shade: #F2EDE2;
  --forest: #1A3A2E;
  --forest-dark: #0F2A20;
  --moss: #2D5A3D;
  --terracotta: #C44536;
  --terracotta-soft: #E8B5A8;
  --amber: #D4A574;
  --amber-soft: #F4E4CD;
  --ink: #1F1D1B;
  --ink-soft: #4A453F;
  --shadow-text: #6B645C;
  --line: #E0D6C2;
  --line-soft: #EDE5D2;

  --success-bg: #E8F0E5;
  --success-text: #2D5A3D;
  --warning-bg: #FBEDD9;
  --warning-text: #8B5A0F;
  --danger-bg: #F8E0D8;
  --danger-text: #A0341C;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(45, 90, 61, 0.05) 0%, transparent 50%);
  min-height: 100vh;
}

/* ============ Header ============ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--forest);
  position: relative;
  flex-shrink: 0;
}

.logo-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--forest); }

/* ============ Hero ============ */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  overflow: hidden;
}

.hero-inner {
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
  background: var(--amber-soft);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.eyebrow-dark {
  color: var(--amber);
  background: rgba(212, 165, 116, 0.15);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--forest-dark);
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--terracotta);
}

.hero-sub {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  max-width: 600px;
}

.btn-primary {
  display: inline-block;
  background: var(--forest);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--forest-dark);
  transform: translateY(-1px);
}

.hero-note {
  font-size: 14px;
  color: var(--shadow-text);
  margin-top: 1rem;
}

.hero-decoration {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.circle { position: absolute; border-radius: 50%; opacity: 0.5; }
.circle-1 {
  width: 320px; height: 320px;
  background: var(--amber-soft);
  top: 20%; right: 10%;
}
.circle-2 {
  width: 180px; height: 180px;
  background: var(--terracotta-soft);
  bottom: 10%; right: 40%;
  opacity: 0.3;
}

/* ============ Section header ============ */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2,
.faq-section h2,
.waitlist-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--forest-dark);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--ink-soft);
  font-size: 17px;
}

/* ============ Calculator ============ */
.calculator-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.calc-card {
  background: var(--paper);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  padding: 2.5rem;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 1px 0 var(--line-soft), 0 20px 40px -20px rgba(31, 29, 27, 0.08);
}

.platform-toggle {
  display: flex;
  gap: 0;
  background: var(--paper-shade);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 2rem;
}

.platform-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--shadow-text);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-btn:hover { color: var(--ink); }
.platform-btn.active {
  background: var(--forest);
  color: var(--paper);
}

.platform-inputs {
  /* Container for platform-specific input sections */
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input-wrap { position: relative; }

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--shadow-text);
  font-weight: 600;
  pointer-events: none;
}

.input-wrap input,
.input-group input[type="number"],
.input-group select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input,
.input-wrap input[type="number"] {
  padding-left: 30px;
}

.input-prefix {
  font-size: 15px;
}

.input-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B645C' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
  cursor: pointer;
}

.input-wrap input:hover,
.input-group input:hover,
.input-group select:hover {
  border-color: var(--shadow-text);
}

.input-wrap input:focus,
.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(26, 58, 46, 0.1);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--forest);
}

.muted { color: var(--shadow-text); font-weight: 400; }

/* Format toggle (KDP) */
.format-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 1.25rem;
}

.format-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--paper-shade);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.format-option:hover {
  border-color: var(--shadow-text);
}

.format-option input {
  margin: 0;
  accent-color: var(--forest);
}

.format-option:has(input:checked) {
  background: var(--paper);
  border-color: var(--forest);
  color: var(--forest);
}

/* Results */
.results {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 12px;
  margin: 0.5rem 0 1.5rem;
}

.result-tile {
  background: var(--paper-shade);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.result-tile.result-profit {
  background: var(--success-bg);
  transition: background 0.3s;
}

.result-tile.result-profit.warning { background: var(--warning-bg); }
.result-tile.result-profit.danger { background: var(--danger-bg); }

.result-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shadow-text);
  margin-bottom: 6px;
}

.result-profit .result-label { color: var(--success-text); }
.result-profit.warning .result-label { color: var(--warning-text); }
.result-profit.danger .result-label { color: var(--danger-text); }

.result-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.result-profit .result-value { color: var(--success-text); }
.result-profit.warning .result-value { color: var(--warning-text); }
.result-profit.danger .result-value { color: var(--danger-text); }

.result-meta {
  font-size: 12px;
  color: var(--success-text);
  margin-top: 4px;
  font-weight: 500;
}

.result-profit.warning .result-meta { color: var(--warning-text); }
.result-profit.danger .result-meta { color: var(--danger-text); }

/* Fee breakdown */
.fee-details {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.25rem;
}

.fee-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fee-details summary::-webkit-details-marker { display: none; }
.fee-details summary::before {
  content: "+";
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s;
}
.fee-details[open] summary::before { content: "−"; }

.fee-list { margin-top: 1rem; font-size: 14px; }
.fee-list .fee-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
.fee-list .fee-row .fee-label { color: var(--ink-soft); }
.fee-list .fee-row .fee-value { font-weight: 500; color: var(--ink); }
.fee-list .fee-row.fee-total {
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 600;
}
.fee-list .fee-row.fee-section {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  font-weight: 600;
  color: var(--forest);
}

.rates-note {
  font-size: 12px;
  color: var(--shadow-text);
  text-align: center;
  margin-top: 1.5rem;
  font-style: italic;
}

/* ============ Waitlist ============ */
.waitlist-section {
  background: var(--forest-dark);
  color: var(--paper);
  padding: 5rem 2rem;
  margin-top: 3rem;
}

.waitlist-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.waitlist-content h2 {
  color: var(--paper);
  margin-bottom: 1rem;
}

.waitlist-content p {
  color: rgba(247, 242, 232, 0.8);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.waitlist-form { max-width: 460px; }
.hidden-field { display: none; }

.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.form-row input {
  flex: 1;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  background: rgba(247, 242, 232, 0.08);
  border: 1px solid rgba(247, 242, 232, 0.2);
  border-radius: var(--radius-md);
  color: var(--paper);
}

.form-row input::placeholder { color: rgba(247, 242, 232, 0.5); }

.form-row input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.form-row button {
  background: var(--amber);
  color: var(--forest-dark);
  border: none;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.form-row button:hover {
  background: #E0B687;
  transform: translateY(-1px);
}

.form-note { font-size: 13px; color: rgba(247, 242, 232, 0.5); }

.form-success {
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--paper);
}

/* Preview table */
.preview-window {
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
  position: relative;
  transform: rotate(-1deg);
}

.preview-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--paper-shade);
  border-bottom: 1px solid var(--line);
}

.preview-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.preview-bar span:nth-child(1) { background: var(--terracotta); }
.preview-bar span:nth-child(2) { background: var(--amber); }
.preview-bar span:nth-child(3) { background: var(--moss); }

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.preview-table th,
.preview-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.preview-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--shadow-text);
  background: var(--paper-shade);
}

.preview-table td:last-child,
.preview-table th:last-child {
  text-align: right;
  font-weight: 600;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.dot-green { background: var(--moss); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--terracotta); }

.profit-good { color: var(--moss); }
.profit-warn { color: #8B5A0F; }
.profit-bad { color: var(--terracotta); }

.preview-blur { filter: blur(4px); opacity: 0.7; }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shadow-text);
  background: var(--paper-shade);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============ FAQ ============ */
.faq-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.faq-item {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--line);
}

.faq-item h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--forest-dark);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--paper-shade);
  border-top: 1px solid var(--line);
  padding: 2rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--forest);
}

.footer-note {
  font-size: 13px;
  color: var(--shadow-text);
}

/* ============ Mobile ============ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .hero { padding: 2rem 1.5rem 4rem; }
  .hero-decoration { display: none; }
  .calc-card { padding: 1.5rem; }
  .input-grid { grid-template-columns: 1fr; gap: 1rem; }
  .results { grid-template-columns: 1fr; }
  .waitlist-inner { grid-template-columns: 1fr; gap: 3rem; }
  .waitlist-preview { display: none; }
  .form-row { flex-direction: column; }
  .faq-grid { grid-template-columns: 1fr; }
  .calculator-section { padding: 2rem 1.5rem; }
  .waitlist-section { padding: 3rem 1.5rem; }
  .faq-section { padding: 3rem 1.5rem; }
  .platform-btn { padding: 10px 8px; font-size: 14px; }
  .format-toggle { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.25rem; }
  .platform-btn { padding: 8px 4px; font-size: 13px; }
}

/* ===========================================
   Penny: the guide bot
   =========================================== */

.bot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: background 0.2s, transform 0.2s;
}

.bot-toggle:hover {
  background: var(--forest-dark);
  transform: translateY(-2px) scale(1.05);
}

.bot-toggle-icon {
  width: 24px;
  height: 24px;
}

.bot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--terracotta);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 100px;
  border: 2px solid var(--cream);
  text-transform: uppercase;
}

@keyframes botPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3); }
  50% { transform: scale(1.08); box-shadow: 0 12px 32px -8px rgba(26, 58, 46, 0.4); }
}

.bot-pulse {
  animation: botPulse 2s ease-in-out 3;
}

.bot-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  max-height: 540px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  z-index: 99;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--forest-dark);
  color: var(--paper);
}

.bot-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--amber);
  position: relative;
  flex-shrink: 0;
}

.bot-avatar::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--forest);
}

.bot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}

.bot-status {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.bot-close {
  background: transparent;
  border: none;
  color: var(--paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}

.bot-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.bot-conversation {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.bot-message {
  background: var(--paper-shade);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 90%;
  align-self: flex-start;
}

.bot-message strong {
  color: var(--forest);
  font-weight: 600;
}

.bot-user-message {
  background: var(--forest);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: 14px 14px 4px 14px;
  font-size: 13px;
  align-self: flex-end;
  max-width: 85%;
  line-height: 1.4;
}

.bot-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  align-self: stretch;
}

.bot-option {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-weight: 500;
  line-height: 1.35;
}

.bot-option:hover {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--forest);
}

@media (max-width: 480px) {
  .bot-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 76px;
    max-height: 70vh;
  }
  .bot-toggle {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }
}
