/* ==========================================================================
   RentMath USA — Hub, Instruments, 50-State Directory, Affiliates & Print
   100% PC + Mobile Responsive | Container Queries | Anti-Tower Row Geometry
   ========================================================================== */

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 29, 43, 0.16);
}

.brand-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-usa {
  color: var(--emerald);
  margin-left: 1px;
}

.site-footer .brand-usa {
  color: #34d399;
}

.brand-chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--emerald-soft);
  color: var(--emerald);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 140ms, color 140ms;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: rgba(15, 29, 43, 0.06);
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sfx-btn {
  min-height: 38px;
  padding: 0 11px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

.mobile-menu-btn {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  place-items: center;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px clamp(16px, 4vw, 32px) 22px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-strong);
}

.mobile-drawer.open { display: flex; }

.mobile-drawer a {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-canvas);
  font-weight: 700;
}

/* Disclosure Bar (FTC Transparent Affiliate Notice) */
.disclosure-bar {
  background: var(--bg-navy);
  color: var(--text-on-dark-muted);
  font-size: 0.76rem;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-dark);
}

.disclosure-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

/* Sections & Hero */
.hero-section {
  padding: clamp(32px, 4.5vw, 64px) 0 clamp(40px, 5vw, 72px);
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(840px circle at 90% 10%, rgba(13, 122, 95, 0.08), transparent 56%),
    radial-gradient(640px circle at 8% 90%, rgba(168, 112, 32, 0.07), transparent 54%);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.92fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.section { padding: clamp(44px, 5.5vw, 80px) 0; }
.section-white {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 760px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

/* Horizontal Tool Cards (Anti-Tower Geometry: 2 per row PC, 1 per row Mobile) */
.tools-2grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-slot { container-type: inline-size; container-name: tool-card; }

.tool-row-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--ease-snappy), border-color 180ms, box-shadow 180ms;
}

.tool-row-card:hover {
  border-color: var(--emerald);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-row-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--emerald-soft);
  border: 1px solid rgba(13, 122, 95, 0.24);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.tool-meta { min-width: 0; flex: 1; }
.tool-meta h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.2;
}
.tool-meta p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}
.tool-tag-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--emerald);
  font-weight: 700;
  margin-top: 6px;
}

@container tool-card (max-width: 450px) {
  .tool-row-card { flex-direction: column; align-items: stretch; }
  .tool-row-card .btn { width: 100%; }
}

/* Tactile Calculator Instrument Deck (2-Col PC, 1-Col Mobile) */
.calc-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 22px;
  align-items: start;
}

.calc-panel {
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 2.5vw, 26px);
}

.calc-output-dark {
  border-radius: var(--r-lg);
  background: var(--bg-navy);
  color: var(--text-on-dark);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 2.8vw, 28px);
}

.hero-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #34d399;
  line-height: 1.08;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  font-size: 0.92rem;
  transition: border-color 140ms, background-color 140ms, box-shadow 140ms;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
}

.seg-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: var(--r-sm);
  background: var(--bg-tray);
  border: 1px solid var(--border-subtle);
}

.seg-opt {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.seg-opt.active {
  background: var(--bg-navy);
  color: #ffffff;
}

.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.kpi-mini {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-dark);
}

.kpi-mini small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
}

.kpi-mini strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #ffffff;
}

.visual-bar-track {
  width: 100%;
  height: 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  margin: 14px 0 8px;
}

.visual-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 220ms var(--ease-snappy);
}

.visual-bar-warn {
  height: 100%;
  background: #f59e0b;
  transition: width 220ms var(--ease-snappy);
}

/* Statutory Alert Box */
.statute-alert {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid rgba(185, 28, 28, 0.28);
  color: #7f1d1d;
  font-size: 0.86rem;
}

/* ==========================================================================
   Monetization Engine: Contextual Affiliate Trio + $19 One-Time Pack Banner
   ========================================================================== */
.monetize-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.aff-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.aff-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.aff-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 2px 0 0;
}

.aff-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

/* $19 Zero-Subscription Pack Banner */
.pack-upsell-banner {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #0f1d2b 0%, #16332c 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* 50-State Directory Grid */
.state-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.state-search-bar input {
  flex: 1;
  min-width: 220px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.state-pill-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
}

.state-pill-card:hover {
  border-color: var(--emerald);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.state-pill-card strong { font-size: 0.9rem; }
.state-pill-card span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table thead th {
  background: var(--bg-tray);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.data-table .col-win {
  background: rgba(13, 122, 95, 0.06);
  border-left: 2px solid var(--emerald);
  border-right: 2px solid var(--emerald);
}

/* Printable Letter Document Sheet (Receipt / Deposit Itemization) */
.doc-sheet {
  background: #ffffff;
  color: #0f1d2b;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  padding: clamp(20px, 3vw, 32px);
  font-size: 0.86rem;
}

.doc-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid #0f1d2b;
  margin-bottom: 16px;
}

.sig-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
  overflow: hidden;
}

.sig-box canvas { width: 100%; height: 96px; cursor: crosshair; }

/* FAQ Accordion */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq-item {
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.faq-q {
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.faq-a {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.faq-item[data-open="true"] .faq-a { display: block; }

/* Zero-Trap Checkout Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 29, 43, 0.72);
  backdrop-filter: blur(6px);
  padding: 20px;
  place-items: center;
}
.modal-backdrop.open { display: grid; }
.modal-card {
  width: min(100%, 540px);
  border-radius: var(--r-xl);
  background: var(--bg-surface);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}

/* Toast */
.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: 20px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--bg-navy);
  color: #ffffff;
  border: 1px solid var(--emerald-bright);
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms, transform 180ms;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Footer */
.site-footer {
  background: var(--bg-navy);
  color: var(--text-on-dark);
  padding: 52px 0 max(30px, env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-dark);
}

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #34d399;
  margin: 0 0 12px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a { font-size: 0.88rem; color: var(--text-on-dark-muted); }
.footer-col a:hover { color: #ffffff; }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
}

/* Responsive */
@media (max-width: 980px) {
  .hero-split, .calc-deck, .tools-2grid, .monetize-stack { grid-template-columns: 1fr; }
  .states-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1320px) {
  .brand-chip, .sfx-btn { display: none; }
}

@media (max-width: 1020px) {
  .nav-links, .hide-mobile { display: none; }
  .mobile-menu-btn { display: grid; }
}

@media (max-width: 560px) {
  .field-grid, .kpi-mini-grid, .footer-grid { grid-template-columns: 1fr; }
  .states-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-bar { grid-template-columns: 1fr; }
}

/* Isolated Letter PDF Print Mode */
@media print {
  @page { size: letter portrait; margin: 0.5in; }
  body { background: #ffffff !important; }
  .site-header, .disclosure-bar, .no-print, .monetize-stack, .pack-upsell-banner, .site-footer, .modal-backdrop, .toast {
    display: none !important;
  }
  .container, .calc-deck { display: block !important; max-width: 100% !important; padding: 0 !important; }
  .doc-sheet { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
}
