:root {
  --navy:    #1A192E;
  --marine:  #5B3E9F;
  --red:     #7B1FE4;
  --cream:   #FAFAFA;
  --paper2:  #F5F3FF;
  --muted:   #6D6B7B;
  --border:  #CCCBD1;
  --green:   #1e6e4e;
  --amber:   #b5670f;
  --white:   #ffffff;
}

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

body {
  background: var(--cream);
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(27,58,92,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(200,57,43,0.04) 0%, transparent 55%);
}

/* ── HEADER ── */
header {
  background: var(--navy);
  color: white;
  padding: 0;
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: white;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.logo em { font-style: italic; color: var(--red); }

.back-link {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}
.back-link:hover { color: white; }

/* ── HERO ── */
.hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

@media (max-width: 700px) { .hero { flex-direction: column; padding: 2rem 1.5rem 1rem; } }

.hero-text h1 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 0.6rem;
}

.hero-text h1 em { font-style: italic; color: var(--red); font-weight: 300; }
.hero-text p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.hero-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-law   { background: #e8eef8; color: var(--marine); border: 1px solid #b8cce8; }
.badge-free  { background: #d4ede3; color: var(--green); border: 1px solid #a8d5bf; }
.badge-fast  { background: var(--paper2); color: var(--muted); border: 1px solid var(--border); }

/* ── AD ZONE ── */
.ad-zone {
  background: var(--paper2);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 0.2rem;
}
.ad-zone .ad-size { opacity: 0.4; font-size: 0.7rem; }
.ad-leaderboard { max-width: 1000px; margin: 0 auto 2rem; padding: 0 2rem; }
.ad-leaderboard .ad-zone { width: 100%; height: 90px; }
.ad-banner { max-width: 1000px; margin: 2rem auto; padding: 0 2rem; }
.ad-banner .ad-zone { width: 100%; height: 90px; }
.ad-sidebar .ad-zone { width: 100%; height: 280px; border-radius: 12px; }

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 720px) { .main { grid-template-columns: 1fr; padding: 0 1.5rem 3rem; } }

/* ── PANELS ── */
.panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel-head {
  background: var(--navy);
  color: white;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-head h2 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.2px;
}

.panel-head-icon { font-size: 1.1rem; }

.panel-body { padding: 1.4rem; }

/* ── FORM FIELDS ── */
.field { margin-bottom: 1rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--navy);
  background: var(--cream);
  transition: border-color 0.2s;
  appearance: none;
}

select {
  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 d='M1 1l5 5 5-5' stroke='%237a8696' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--marine);
  background: white;
}

textarea { resize: vertical; min-height: 60px; }

/* Amount fields */
.amount-wrap {
  position: relative;
}

.amount-symbol {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
}

.amount-wrap input { padding-right: 2rem; }

/* Separator */
.field-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2rem 0;
}

/* Section label inside form */
.form-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Total display */
.total-bar {
  background: var(--navy);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}

.total-label {
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  font-weight: 500;
}

.total-amount {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 1.4rem;
  color: white;
  letter-spacing: -0.5px;
  transition: all 0.3s;
}

/* Multi-month toggle */
.multi-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: var(--paper2);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.multi-toggle:hover { border-color: var(--marine); }
.multi-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--marine); }

.multi-toggle-text {
  font-size: 0.83rem;
  font-weight: 500;
}

.multi-toggle-sub {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
}

/* Generate button */
.btn-generate {
  width: 100%;
  padding: 0.95rem;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.btn-generate:hover { background: #b03020; transform: translateY(-1px); }
.btn-generate:active { transform: scale(0.99); }

/* ── PREVIEW PANEL ── */
.preview-sticky { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: 1rem; }

/* Quittance preview */
.quittance-preview {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.qp-head {
  background: var(--paper2);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qp-head-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.qp-body {
  padding: 1.4rem;
  min-height: 300px;
}

/* The actual quittance document look */
.quittance-doc {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.6;
}

.qdoc-header {
  background: var(--navy);
  color: white;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qdoc-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
}

.qdoc-period {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  opacity: 0.7;
}

.qdoc-body { padding: 1rem; background: white; }

.qdoc-section { margin-bottom: 0.8rem; }

.qdoc-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--paper2);
  padding-bottom: 0.2rem;
}

.qdoc-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  font-size: 0.75rem;
}

.qdoc-key { color: var(--muted); }
.qdoc-val { font-weight: 500; color: var(--navy); }

.qdoc-statement {
  background: var(--paper2);
  border-radius: 6px;
  padding: 0.7rem;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--navy);
  margin: 0.8rem 0;
}

.qdoc-amounts {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.qdoc-amount-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--paper2);
}

.qdoc-amount-row:last-child { border-bottom: none; }
.qdoc-amount-row.total-row {
  background: var(--navy);
  color: white;
  font-weight: 600;
}

.qdoc-footer {
  padding: 0.7rem 1rem;
  background: var(--paper2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.qdoc-sig-label { font-size: 0.65rem; color: var(--muted); margin-bottom: 0.4rem; }
.qdoc-sig-line { border-top: 1px solid var(--border); width: 120px; }

.qdoc-legal { font-size: 0.6rem; color: var(--muted); max-width: 180px; line-height: 1.4; text-align: right; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 0.7rem; opacity: 0.4; }
.empty-text { font-size: 0.85rem; }

/* Actions */
.action-row {
  display: flex;
  gap: 0.6rem;
}

.btn-action {
  flex: 1;
  padding: 0.65rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--navy);
  transition: all 0.2s;
}

.btn-action:hover { border-color: var(--navy); background: var(--navy); color: white; }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-action.primary {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.btn-action.primary:hover { background: var(--marine); border-color: var(--marine); }

/* AI Disclaimer */
.disclaimer {
  display: none;
  background: #fef3e8;
  border: 1.5px solid #e8c890;
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #7a4a0a;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.disclaimer.show { display: flex; }
.disclaimer strong { color: var(--amber); font-weight: 600; }

/* Multi-month list */
.months-list {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.months-list.show { display: flex; }

.month-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: var(--paper2);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.month-item:hover { border-color: var(--red); background: #f9e8e6; }
.month-item .mi-name { font-weight: 500; }
.month-item .mi-print { font-size: 0.7rem; color: var(--muted); }

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

.faq-section h2 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  margin-bottom: 1.2rem;
}

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

@media (max-width: 600px) { .faq-grid { grid-template-columns: 1fr; } }

.faq-item {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.faq-item[open] { border-color: var(--marine); }

.faq-item summary {
  padding: 0.9rem 1rem;
  font-weight: 500;
  font-size: 0.86rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--navy);
}

.faq-item summary::after { content: '+'; color: var(--red); font-size: 1.1rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item p {
  padding: 0.7rem 1rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: 0.75rem;
  padding: 1.5rem;
  border-top: 3px solid var(--red);
}

footer a { color: rgba(255,255,255,0.4); }

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

.animate-in { animation: fadeIn 0.35s ease forwards; }
