:root {
  --green: #12583c;
  --green-dark: #0d4530;
  --green-tint: #e7f0ec;
  --slate: #335056;
  --slate-dark: #263f44;
  --bg: #f4f6f5;
  --card: #ffffff;
  --fg: #22333a;
  --fg-muted: #5c6f68;
  --border: #d8e2de;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Keep the hidden attribute authoritative; layout rules below set display,
   which would otherwise override the user-agent `[hidden] { display: none }`. */
[hidden] {
  display: none !important;
}

html {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  /* Inner pages are as tall as their content and scroll normally. */
  min-height: 100%;
}

/* Only the home page is a fixed single viewport. */
body.page-home {
  height: 100%;
  overflow: hidden;
}

/* Single viewport, no scroll. Two columns on wide screens, stacked on narrow. */
.page {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: 3rem 4rem;
  background: var(--card);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--green);
}

.headline {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
  color: var(--slate-dark);
}

.lede {
  max-width: 52ch;
  line-height: 1.6;
  color: var(--fg-muted);
}

.services {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.services li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--slate);
  max-width: 42ch;
}

.services li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.login-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--green-tint);
}

.login-form {
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 10px 30px rgba(18, 88, 60, 0.08);
}

.login-form h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--slate-dark);
}

.hint {
  margin-top: -0.5rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.error {
  background: #fdecea;
  border: 1px solid #f5c6c0;
  color: var(--danger);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.login-form input {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
}

.login-form input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

.login-form button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--green-dark);
}

.login-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.inventory-link {
  display: block;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}

.inventory-link:hover {
  background: var(--green-dark);
}

.sign-out {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg-muted);
  cursor: pointer;
}

.sign-out:hover {
  background: var(--green-tint);
  color: var(--fg);
}

@media (max-width: 900px) {
  body.page-home {
    overflow: auto;
  }
  .page {
    grid-template-columns: 1fr;
    flex: 0 0 auto;
  }
  .intro {
    padding: 2rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ── Inner pages ─────────────────────────────────────────────── */

.prose {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  line-height: 1.65;
  color: var(--fg);
  margin-bottom: 2.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat strong {
  font-size: 1.6rem;
  color: var(--green);
}

.stat span {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.gallery-item picture {
  display: block;
}

.gallery-item img {
  display: block;
  width: 100%;
  /* `height: auto` keeps width/height attributes from collapsing this to
     their own ratio — the tile aspect ratio must win. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-note {
  margin-top: 1.25rem;
  max-width: 68ch;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.gallery-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--slate);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-details h2 {
  font-size: 1.1rem;
  color: var(--slate-dark);
  margin-bottom: 1rem;
}

.contact-details dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1.25rem;
  margin-bottom: 1rem;
}

.contact-details dt {
  font-weight: 600;
  color: var(--green);
  font-size: 0.9rem;
}

.contact-details dd {
  color: var(--fg);
  font-size: 0.9rem;
}

.contact-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

.contact-form button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.contact-form button:hover {
  background: var(--green-dark);
}

.form-note {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

@media (max-width: 700px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}
