/* ECOVSME v2 — base stylesheet (Phase 2.1).
   Minimal styling for the landing + methodology pages. Form / dashboard
   styles land alongside Phases 2.2 and 3. */

:root {
  --color-bg: #fafaf7;
  --color-fg: #1a1a1a;
  --color-muted: #5a5a55;
  --color-accent: #1e6f3a;
  --color-accent-bg: #f0f8f3;
  --color-pending: #b66700;
  --color-pending-bg: #fff4e1;
  --color-border: #d8d8d2;
  --color-link: #195ba8;
  --max-width: 920px;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-fg);
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.lang-switch a {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-fg);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
}

footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-muted);
  margin: 3rem auto 0;
  max-width: var(--max-width);
}

/* ---------------------------------------------------------------------------
   Methodology disclosure block — binding constraint #11.
   Above-the-fold, contrasting background, not collapsible. Do not relocate
   below the signup CTA without first updating PLAN.md anchor item 11 and
   GOVERNANCE.md §4 in the same PR.
   --------------------------------------------------------------------------- */
.methodology-disclosure {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.methodology-disclosure h2 {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.methodology-disclosure ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.methodology-disclosure li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.methodology-disclosure .cta-link {
  font-weight: 600;
}

.badge-pending {
  background: var(--color-pending-bg);
  color: var(--color-pending);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
}

/* Larger pending badge used as the primary affordance for empty-state
   sections (B4, B7 pre-MUD, B9, B10, B11, C3-C8). */
.badge-pending.pending-large {
  font-size: 1rem;
  padding: 0.4rem 1rem;
}

/* Per-section description (rendered above the form). Slightly larger
   than ``.muted`` because it carries the VSME standard reference and
   should be readable at a glance. */
.section-description {
  color: var(--color-muted);
  font-size: 0.95rem;
  max-width: 60ch;
  margin: 0.5rem 0 1rem;
  line-height: 1.55;
}

/* Empty-state placeholder for sections without pre-populated data. */
.empty-section-pending {
  text-align: center;
  padding: 2rem 1.5rem;
}
.empty-section-pending .pending-explainer {
  max-width: 50ch;
  margin: 1rem auto;
}
.empty-section-note {
  margin-top: 1.5rem;
  text-align: left;
}
.empty-section-note summary {
  cursor: pointer;
  color: var(--color-link);
  font-size: 0.95rem;
}
.empty-section-note summary:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Phase 3.4b — per-claim review UI
   --------------------------------------------------------------------------- */

/* Inline highlight on each numeric claim in the rendered narrative. */
.generated-section { line-height: 1.7; }
.generated-section p { margin: 0.7em 0; }

mark.claim {
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
  font-weight: 600;
  cursor: pointer;
}
mark.claim-pending      { background: var(--color-pending-bg); color: var(--color-pending); }
mark.claim-acknowledged { background: #e6ffec; color: #1f6f3a; }
mark.claim-overridden   { background: #fff4e1; color: #b66700; }
mark.claim-untraced     { background: #fdecea; color: #842029; }
mark.claim:focus { outline: 2px solid var(--color-link); outline-offset: 1px; }

/* Hover affordance — soft underline; click-handling is left to the
   per-claim table below the narrative for now. */
mark.claim:hover { text-decoration: underline; text-decoration-style: dotted; }

/* Per-claim table */
.claims-table td { vertical-align: top; }
.claim-row-pending td { background: var(--color-pending-bg); }
.claim-row-acknowledged td { background: #f4fff7; }
.claim-row-overridden td { background: #fff8ee; }

/* Override-details inline form */
.claim-override-details {
  display: inline-block;
}
.claim-override-details summary {
  cursor: pointer;
  color: var(--color-link);
  font-size: 0.9rem;
}
.claim-override-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.6rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 22rem;
}
.claim-override-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
.claim-override-form input[type="text"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.hero h1 { font-size: 1.85rem; margin: 0.5rem 0 0.75rem; }
.hero p { max-width: 60ch; color: var(--color-muted); }

.methodology-page section { margin: 2rem 0; }
.methodology-page dl dt { font-weight: 600; margin-top: 0.75rem; }
.methodology-page dl dd { margin-left: 0; word-break: break-all; }

/* ---------------------------------------------------------------------------
   Auth (signup / login)
   --------------------------------------------------------------------------- */
.auth-card {
  max-width: 28rem;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-card h1 { margin: 0 0 0.5rem; }
.auth-card .muted { color: var(--color-muted); margin-top: 0; }

/* Wider variant for the report-creation form (5 fieldsets vs. signup's 3 inputs). */
.auth-card.form-card-wide { max-width: 44rem; }

/* Side-by-side row for short decisions (tier + language). Stacks on narrow. */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 30rem) {
  .form-row-2col { grid-template-columns: 1fr; }
}

/* Collapsed-by-default explainer (MUD policy text, prior-year notes). */
.form-explainer {
  margin: 0.4rem 0 0.6rem;
}
.form-explainer summary {
  cursor: pointer;
  color: var(--color-link);
  font-size: 0.9rem;
  font-weight: 500;
}
.form-explainer summary:hover { text-decoration: underline; }
.form-explainer p {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

/* Pricing hint inline next to a radio label. */
.price-hint {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.85rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; font-size: 0.9rem; }
.auth-form input {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
}
.auth-form input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.auth-form small.muted { color: var(--color-muted); font-weight: 400; }

.auth-footer { margin-top: 1.25rem; font-size: 0.9rem; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { filter: brightness(0.95); }

.btn-primary-sm {
  background: var(--color-accent);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
}
.btn-primary-sm:hover { color: #fff; text-decoration: none; filter: brightness(0.95); }

.btn-link {
  background: none; border: 0; padding: 0;
  color: var(--color-link); cursor: pointer; font-size: inherit;
  font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }

.inline-form { display: inline; margin: 0; }

.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin: 1rem 0;
}
.alert-error {
  background: #fdecea;
  border: 1px solid #d62c1a;
  color: #842029;
}

/* ---------------------------------------------------------------------------
   Site nav extras (logged-in state)
   --------------------------------------------------------------------------- */
.nav-user {
  font-size: 0.85rem;
  color: var(--color-muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Dashboard / reports list
   --------------------------------------------------------------------------- */
.dashboard-greeting { margin: 1.5rem 0; }
.dashboard-greeting h1 { margin: 0 0 0.4rem; }

.reports-section { margin: 2rem 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-header h1, .section-header h2 { margin: 0; }

.reports-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.reports-table th, .reports-table td {
  padding: 0.55rem 0.8rem; text-align: left;
  border-bottom: 1px solid var(--color-border); font-size: 0.92rem;
}
.reports-table th { background: #f4f4ef; font-weight: 600; }
.reports-table tr:last-child td { border-bottom: 0; }

.empty-state {
  border: 1px dashed var(--color-border);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  color: var(--color-muted);
}
