/* ArmaRenta Lease Generator — scoped styles (DARK THEME, matches live site).
 * Served at /lease-generator.css by app.py. All rules namespaced under .lg-root.
 * Site tokens: bg #070B16, ink #EAF1FF, muted #94A1BE, accent orange #FF9000 / #FB7E00.
 * Fonts: Inter / Space Grotesk (already loaded by the page).
 */
.lg-root {
  --lg-bg: #0C1322;          /* slightly lifted from page bg for the panel */
  --lg-card: #111A2C;
  --lg-card-2: #0A111F;
  --lg-ink: #EAF1FF;
  --lg-muted: #94A1BE;
  --lg-line: rgba(255,255,255,.12);
  --lg-line-2: rgba(255,255,255,.20);
  --lg-orange: #FF9000;
  --lg-orange-2: #FB7E00;
  --lg-teal: #6EE7B7;
  font-family: "Inter", system-ui, Segoe UI, Roboto, sans-serif;
  color: var(--lg-ink);
  background: var(--lg-bg);
  border: 1px solid var(--lg-line);
  border-radius: 18px;
  padding: 22px;
  margin: 26px 0;
  line-height: 1.55;
}

.lg-head { margin-bottom: 14px; }
.lg-title {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700; font-size: 1.4rem; line-height: 1.2; margin: 0 0 6px; color: var(--lg-ink);
}
.lg-root .lg-sub { margin: 0; color: var(--lg-muted); font-size: 0.92rem; max-width: 62ch; }
.lg-root .lg-disclaimer { color: var(--lg-muted); }
.lg-root .lg-nudge p { color: var(--lg-ink); }

/* toolbar */
.lg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.lg-btn {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--lg-line-2); background: var(--lg-card); color: var(--lg-ink);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; transition: .15s; text-decoration: none;
}
.lg-btn:hover { border-color: var(--lg-orange); }
.lg-btn-primary {
  background: linear-gradient(135deg, var(--lg-orange), var(--lg-orange-2));
  border-color: transparent; color: #241400; box-shadow: 0 10px 30px rgba(255,144,0,.30);
}
.lg-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(255,144,0,.42); }
.lg-btn-ghost { background: transparent; color: var(--lg-muted); border-color: transparent; }
.lg-flash {
  font-size: 0.85rem; color: #062018; background: var(--lg-teal);
  padding: 4px 10px; border-radius: 8px; opacity: 0; transform: translateY(-2px);
  transition: .2s; pointer-events: none;
}
.lg-flash.show { opacity: 1; transform: none; }

/* warnings */
.lg-warnings:empty { display: none; }
.lg-warn {
  background: rgba(255,144,0,.12); border: 1px solid rgba(255,144,0,.35); color: var(--lg-orange-soft, #FFB257);
  padding: 9px 12px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 8px;
}

/* layout */
.lg-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .lg-body { grid-template-columns: 1fr; } }

/* form */
.lg-form { display: flex; flex-direction: column; gap: 14px; }
.lg-group {
  border: 1px solid var(--lg-line); border-radius: 12px; padding: 16px 14px 4px;
  margin: 0; background: var(--lg-card);
}
.lg-group legend {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: .08em; color: #241400;
  background: linear-gradient(135deg, var(--lg-orange), var(--lg-orange-2));
  padding: 4px 12px; border-radius: 999px;
}
.lg-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.lg-label { font-size: 0.82rem; font-weight: 600; color: var(--lg-ink); }
.lg-hint { font-size: 0.74rem; color: var(--lg-muted); }
.lg-field input, .lg-field select {
  font: inherit; font-size: 0.92rem; padding: 9px 11px;
  border: 1px solid var(--lg-line-2); border-radius: 9px;
  background: var(--lg-card-2); color: var(--lg-ink); width: 100%; box-sizing: border-box;
}
.lg-field input::placeholder { color: #5e6c87; }
.lg-field input:focus, .lg-field select:focus {
  outline: none; border-color: var(--lg-orange); box-shadow: 0 0 0 3px rgba(255,144,0,.25);
}
/* Native option list: set BOTH bg and text so it's readable regardless of OS/browser
   defaults (Windows/Chrome inherits the select's dark bg for the popup). */
.lg-root .lg-field select option {
  background: #0C1322;
  color: #EAF1FF;
}
.lg-root .lg-field select option:checked { background: #FF9000; color: #241400; }

/* preview — the contract itself stays a light "paper" sheet for print fidelity */
.lg-preview { position: sticky; top: 16px; }
@media (max-width: 820px) { .lg-preview { position: static; } }
.lg-preview-tag {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--lg-muted); margin-bottom: 6px;
}
.lg-doc {
  background: #fdfdfb; border: 1px solid var(--lg-line); border-radius: 10px;
  padding: 26px 28px; max-height: 70vh; overflow: auto;
  font-family: "Times New Roman", Georgia, serif; font-size: 0.86rem; line-height: 1.6; color: #15181f;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.lg-doc .lg-doc-title {
  text-align: center; font-family: "Times New Roman", Georgia, serif;
  font-size: 1.05rem; letter-spacing: 1px; margin: 0 0 16px; font-weight: 700;
}
/* High specificity (.lg-root .lg-doc …) so the host site's .prose p/strong/a
   rules (color:#C9D3EA / #fff / orange) cannot bleed into the paper preview. */
.lg-root .lg-doc,
.lg-root .lg-doc p,
.lg-root .lg-doc li { color: #15181f; }
.lg-root .lg-doc strong { color: #000; }
.lg-root .lg-doc p { margin: 9px 0; text-align: justify; }
.lg-root .lg-doc .lg-clause { margin: 11px 0; }
.lg-root .lg-doc a { color: #0A2540; text-decoration: underline; }
.lg-root .lg-doc .lg-muted { color: #555; font-size: 0.78rem; }
.lg-root .lg-doc .lg-doc-title { color: #15181f; }
.lg-sign { display: flex; gap: 40px; margin: 28px 0 6px; }
.lg-sign > div { flex: 1; text-align: center; font-size: 0.82rem; }
.lg-sigline { border-top: 1px solid #15181f; height: 26px; margin-bottom: 6px; }

/* disclaimer + nudge */
.lg-disclaimer {
  margin: 16px 0 0; font-size: 0.78rem; color: var(--lg-muted);
  border-top: 1px solid var(--lg-line); padding-top: 12px;
}
.lg-nudge {
  display: none; margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,144,0,.14), rgba(255,144,0,.05));
  border: 1px solid rgba(255,144,0,.3);
  color: var(--lg-ink); align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between;
}
.lg-nudge.show { display: flex; }
.lg-nudge p { margin: 0; font-size: 0.92rem; max-width: 48ch; }
.lg-nudge .lg-btn-primary { white-space: nowrap; }

/* print: PDF opens its own window; this also covers Ctrl+P on the page */
@media print {
  body * { visibility: hidden; }
  .lg-root .lg-doc, .lg-root .lg-doc * { visibility: visible; }
  .lg-root .lg-doc { position: absolute; left: 0; top: 0; border: 0; max-height: none; box-shadow: none; }
}

/* ---- Rental Tax Estimator result rows (.rt-*), shown inside the light .lg-doc pane ---- */
.lg-root .rt-out { padding: 18px 20px; }
.lg-root .rt-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid #e6e8ee;
}
.lg-root .rt-row:last-child { border-bottom: 0; }
.lg-root .rt-row .rt-l { color: #15181f; font-weight: 600; font-size: 0.9rem; font-family: "Inter", sans-serif; }
.lg-root .rt-row .rt-v { color: #15181f; font-weight: 700; font-size: 0.98rem; white-space: nowrap; font-family: "Inter", sans-serif; }
.lg-root .rt-row .rt-note { display: block; color: #5b6577; font-weight: 400; font-size: 0.76rem; margin-top: 3px; max-width: 42ch; }
.lg-root .rt-row.rt-strong .rt-l, .lg-root .rt-row.rt-strong .rt-v { font-size: 1.02rem; }
.lg-root .rt-row.rt-strong { border-bottom: 2px solid #15181f; }
