/* The Lochs Estate — misty modern */
:root {
  --bg: #fbfaf7;
  --mist: #eef2ec;
  --pine: #2f5d4e;
  --pine-deep: #22443a;
  --moss: #5f8272;
  --sage: #a5bcae;
  --water: #8fb0bd;
  --ink: #24332c;
  --muted: #5c6b62;
  --line: #e0e4dc;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
a { color: var(--pine); }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.container { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }

/* nav */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}
.site-nav .container {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.site-nav .brand {
  font-family: var(--serif); font-size: 1.3rem; letter-spacing: 0.02em;
  color: var(--pine-deep); text-decoration: none;
}
.site-nav a { color: var(--muted); text-decoration: none; margin-left: 1.4rem; font-size: 0.93rem; }
.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover { color: var(--pine); }
.site-nav a[aria-current="page"] { color: var(--pine-deep); border-bottom: 2px solid var(--moss); padding-bottom: 2px; }

/* hero (landing) */
.hero {
  background: linear-gradient(180deg, #e3ece5 0%, var(--bg) 100%);
  color: var(--pine-deep); text-align: center; padding-top: 5.5rem;
}
.hero .eyebrow { color: var(--moss); }
.hero h1 { font-size: clamp(2.8rem, 7vw, 4.4rem); margin: 0.4rem 0 0.9rem; letter-spacing: -0.01em; }
.hero .tagline {
  color: var(--muted); font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  max-width: 34rem; margin: 0 auto 1.7rem; padding: 0 1.5rem;
}
.hero-cta { margin: 0 0 3.4rem; }
.hero svg { display: block; width: 100%; height: auto; margin-bottom: -1px; }

/* page header (subpages) */
.page-header {
  background: linear-gradient(180deg, #e3ece5 0%, var(--bg) 100%);
  color: var(--pine-deep); padding: 3.8rem 0 2.6rem;
  text-align: center;
}
.page-header h1 { font-size: clamp(2rem, 4.5vw, 2.7rem); margin: 0.3rem 0 0; }
.page-header .eyebrow { color: var(--moss); }

/* facts strip */
.facts ul {
  list-style: none; margin: 0 auto; padding: 1.4rem 1.5rem 0.4rem;
  max-width: 62rem;
  display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap;
}
.facts li {
  background: var(--mist); color: var(--pine-deep);
  border-radius: 999px; padding: 0.35rem 1.1rem;
  font-size: 0.88rem; letter-spacing: 0.02em;
}

/* sections */
.eyebrow {
  display: block; font-size: 0.8rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--moss); margin-bottom: 0.3rem;
}
.section { padding: 4.5rem 0; }
.section--alt { background: var(--mist); }
.section--center { text-align: center; }
.section--center .lead, .section--center .form-grid { margin-left: auto; margin-right: auto; }
.section--center .form-grid, .section--center .card { text-align: left; }
@media (min-width: 600px) {
  .lead { text-align: justify; hyphens: auto; }
}
.section h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0 0 1rem; color: var(--pine-deep); }
.section .lead { max-width: 42rem; margin-top: 0; color: var(--ink); }

/* cards */
.cards {
  display: grid; gap: 1.3rem; margin: 2rem 0 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(36, 51, 44, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(36, 51, 44, 0.1); }
.card h3 { margin: 0 0 0.45rem; font-size: 1.12rem; color: var(--pine); }
.card p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* CTA band */
.cta-band {
  background: var(--pine-deep); color: #f2f5f1;
  text-align: center; padding: 3.8rem 1.5rem;
}
.cta-band h2 { color: #fff; margin: 0 0 0.5rem; }
.cta-band p { color: var(--sage); margin: 0 auto 1.7rem; max-width: 32rem; }

/* buttons + forms */
.btn {
  display: inline-block; background: var(--pine); color: #fff;
  border: none; border-radius: 999px; padding: 0.75rem 1.9rem;
  font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--pine-deep); transform: translateY(-1px); }
.btn--light { background: #fff; color: var(--pine-deep); }
.btn--light:hover { background: var(--mist); color: var(--pine-deep); }
.form-grid { display: grid; gap: 1.1rem; max-width: 28rem; }
.form-grid label { display: block; font-size: 0.88rem; margin-bottom: 0.3rem; color: var(--muted); }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: #fff;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(95, 130, 114, 0.18);
}
.hidden { display: none !important; }

/* spinners */
.spinner {
  display: inline-block; width: 1em; height: 1em;
  border: 2px solid var(--sage); border-top-color: var(--pine);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: -0.15em; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--muted); font-size: 0.92rem; padding: 0.45rem 0;
}

/* notices */
.notice { padding: 0.75rem 1rem; border-radius: 10px; margin: 1rem 0; font-size: 0.95rem; }
.notice--ok { background: #e2eddc; color: #2c4a22; }
.link-button {
  display: block; margin-top: 0.5rem; padding: 0; border: none; background: none;
  font: inherit; color: inherit; text-decoration: underline; cursor: pointer;
}
/* focused by script so screen readers announce it; no ring needed */
#contact-thanks:focus { outline: none; }
.notice--error { background: #f4e0da; color: #6b2b1d; }

/* portal: logged out */
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 2.2rem 2rem; max-width: 26rem; margin: 1rem auto 0;
  box-shadow: 0 1px 2px rgba(36, 51, 44, 0.04);
}
.auth-card h2 { margin: 0 0 0.4rem; color: var(--pine-deep); }
.auth-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.4rem; }
.auth-card .form-grid { max-width: none; }
.auth-card .form-grid .auth-note { margin: 0.2rem 0 0; }

/* portal: logged in */
.portal-bar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
  border-bottom: 1px solid var(--line); padding-bottom: 1.2rem;
}
.portal-title {
  margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); color: var(--pine-deep);
}
.portal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
#readings-chart { margin: 1rem 0 0.4rem; }

/* portal hub: menu on the left, cards on the right */
.portal-layout {
  display: grid; grid-template-columns: 16rem 1fr;
  gap: 1.5rem; align-items: start;
}
.portal-menu {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.4rem 0.6rem;
  box-shadow: 0 1px 2px rgba(36, 51, 44, 0.04);
}
.portal-menu h3 {
  margin: 0 0 0.4rem; font-size: 1rem; color: var(--pine-deep);
  border-bottom: 1px solid var(--line); padding-bottom: 0.4rem;
}
.portal-menu ul { list-style: none; margin: 0 0 1.3rem; padding: 0; font-size: 0.9rem; }
.portal-menu li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.6rem; flex-wrap: wrap; padding: 0.3rem 0;
}
.portal-menu a { text-decoration: none; font-weight: 500; }
.portal-menu a:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .portal-layout { grid-template-columns: 1fr; }
  .portal-menu { order: 2; }
}

/* back link above page content */
.back-row { margin: 0 0 1.3rem; }
.doc-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  align-items: start;
}
.doc-count {
  display: inline-block; background: var(--mist); color: var(--pine);
  border-radius: 999px; font-size: 0.75rem; font-family: var(--sans);
  padding: 0.05rem 0.6rem; margin-left: 0.5rem; vertical-align: 2px;
}
.doc-list li { transition: background 0.1s ease; border-radius: 6px; padding: 0.6rem 0.4rem; }
.doc-list li:hover { background: var(--mist); }
.btn--ghost {
  background: transparent; color: var(--pine);
  border: 1px solid var(--line); padding: 0.4rem 1.2rem; font-size: 0.9rem;
}
.btn--ghost:hover { background: var(--mist); color: var(--pine-deep); transform: none; }
.doc-group {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.3rem 1.6rem; margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(36, 51, 44, 0.04);
}
.doc-group h3 {
  margin: 0 0 0.4rem; color: var(--pine-deep);
  border-bottom: 1px solid var(--line); padding-bottom: 0.5rem;
}
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px dotted var(--line); flex-wrap: wrap;
}
.doc-list li:last-child { border-bottom: none; }
.doc-list a { text-decoration: none; font-weight: 500; }
.doc-list a:hover { text-decoration: underline; }
.doc-list a::after { content: " ↓"; color: var(--moss); }
.doc-meta { color: var(--muted); font-size: 0.85rem; }
.req-detail {
  width: 100%; white-space: pre-line; color: var(--muted);
  font-size: 0.88rem; padding: 0.25rem 0 0.15rem;
}

/* manager readings form */
.meter-row--head span {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.meter-row--head { border-bottom: 1px solid var(--line); }
.tool-link { font-weight: 500; }
.meter-row {
  display: grid; grid-template-columns: minmax(9rem, 1fr) repeat(3, minmax(4.5rem, 6.5rem));
  gap: 0.5rem; align-items: center;
  padding: 0.35rem 0; border-bottom: 1px dotted var(--line);
}
.meter-row:last-child { border-bottom: none; }
.meter-row label { font-size: 0.9rem; color: var(--ink); }
.meter-row input, .eskom-row input {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fffdf8;
}
.meter-row input:focus, .eskom-row input:focus {
  outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(95, 130, 114, 0.18);
}
.eskom-row {
  display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(6rem, 10rem);
  gap: 0.5rem; align-items: center;
  padding: 0.35rem 0; border-bottom: 1px dotted var(--line);
}
.eskom-row:last-child { border-bottom: none; }
.eskom-row label span { display: block; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 540px) {
  .meter-row { grid-template-columns: 1fr repeat(3, minmax(3.2rem, 1fr)); }
}

/* services: catch return rows (Fish | No. | Size | Dam | Spot | Kept | remove) */
.catch-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 1.2fr) 3.6rem 4.8rem minmax(5.5rem, 1fr) minmax(5rem, 1fr) minmax(6rem, 0.8fr) 2.2rem;
  gap: 0.5rem; align-items: center;
  padding: 0.35rem 0; border-bottom: 1px dotted var(--line);
}
/* grid items default to min-width:auto, so long option text pushed the row
   (and the remove button) past the card edge */
.catch-row > * { min-width: 0; }
/* spinner arrows ate the narrow number boxes ("size cm" got cut off) */
.catch-row input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.catch-row input[type="number"]::-webkit-inner-spin-button,
.catch-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.catch-row:last-child { border-bottom: none; }
.catch-row--head { border-bottom: 1px solid var(--line); }
.catch-row--head span {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.catch-row select, .catch-row input {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fffdf8;
}
.catch-row select:focus, .catch-row input:focus {
  outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(95, 130, 114, 0.18);
}
.catch-remove {
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; font: inherit; padding: 0.3rem 0;
}
.catch-remove:hover { background: var(--mist); color: var(--pine-deep); }
@media (max-width: 640px) {
  /* fields self-label via placeholders/options; header hidden, rows wrap */
  .catch-row { grid-template-columns: 1fr 1fr 1fr; padding: 0.7rem 0; }
  .catch-row--head { display: none; }
}

/* footer */
.site-footer {
  margin-top: auto;
  background: var(--pine-deep); color: var(--sage);
  text-align: center; padding: 2.5rem 1.5rem; font-size: 0.9rem;
}
.site-footer .rule { width: 3rem; height: 2px; background: var(--moss); margin: 0 auto 1.2rem; border: none; }
.site-footer a { color: #d7e3da; }
.footer-links { margin-bottom: 1.1rem; }
.footer-links a { text-decoration: none; margin: 0 0.7rem; font-size: 0.9rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-place { color: var(--sage); margin: 0 0 0.6rem; }

/* dialogs (LochsUI.confirm / LochsUI.alert) */
.lochs-dialog {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 1.6rem 1.8rem; max-width: 24rem; background: #fff;
  box-shadow: 0 18px 48px rgba(31, 51, 43, 0.18); font: inherit; color: inherit;
}
.lochs-dialog::backdrop { background: rgba(31, 51, 43, 0.35); }
.lochs-dialog p { margin: 0; line-height: 1.5; }
.dialog-actions {
  display: flex; gap: 0.7rem; justify-content: flex-end; margin-top: 1.3rem;
}
