/* Cropix sign-in pages (login.html, reset.html) — one stylesheet so the two
   can't drift apart. Modelled on the Cropix GIS Portal sign-in (dark brand
   backdrop, one white card) and built to the Apple-style rules used across
   Ops since Web 10.0: system font, soft-fill fields, one dark-green primary,
   instant press feedback, inline errors, reduced-motion / contrast aware.
   15 Oct 2026. */

:root {
  --auth-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --auth-ink: #17181a;
  --auth-ink-2: #5d5f63;
  --auth-ink-3: #8b8c90;
  --auth-brand: #21382f;        /* Ops primary (--cx-accent) */
  --auth-brand-hov: #2c4a3e;
  --auth-brand-2: #2f7a33;      /* lighter brand green — links, focus */
  --auth-fill: #f2f3f2;
  --auth-danger: #b3261e;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background-color: #0e1813;
  background-image: radial-gradient(120% 75% at 50% 0%, #2b4b38 0%, #17281e 48%, #0b130f 100%);
}

.auth-shell {
  margin: auto;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The original CropixSA lockup — its pale "SA" only reads on the dark
   backdrop, so it sits above the card rather than in it. */
.auth-logo {
  display: block;
  width: 232px;
  height: auto;
  margin: 0 0 28px;
  user-select: none;
  -webkit-user-drag: none;
}

.auth-card {
  width: 100%;
  background: #fff;
  border-radius: 22px;
  padding: 34px 32px 26px;
  box-shadow: 0 30px 80px rgb(0 0 0 / .42), 0 8px 24px rgb(0 0 0 / .16);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.022em;
}

.auth-lede {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--auth-ink-2);
  overflow-wrap: anywhere;
}
.auth-lede strong { color: var(--auth-ink); font-weight: 600; }

.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 7px; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-field label { font-size: 13px; font-weight: 600; color: #3b3c3f; }

.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: 400 16px/1.2 var(--auth-font);   /* 16px: iOS never zooms on focus */
  color: var(--auth-ink);
  background: var(--auth-fill);
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.auth-field input:hover { background: #eceeec; }
.auth-field input:focus {
  background: #fff;
  border-color: var(--auth-brand-2);
  box-shadow: 0 0 0 4px rgb(47 122 51 / .16);
}

.auth-pw { position: relative; }
.auth-pw input { padding-right: 76px; }
.auth-reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: 600 13.5px var(--auth-font);
  color: var(--auth-brand);
  cursor: pointer;
}
.auth-reveal:hover { background: rgb(33 56 47 / .07); }

.auth-link {
  border: 0;
  background: none;
  padding: 0;
  font: 500 13.5px var(--auth-font);
  color: var(--auth-brand-2);
  text-decoration: none;
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.auth-back { justify-self: center; margin-top: 2px; }
.auth-alt { margin: 18px 0 0; text-align: center; }

.auth-primary {
  margin-top: 6px;
  height: 50px;
  border: 0;
  border-radius: 13px;
  background: var(--auth-brand);
  color: #fff;
  font: 600 16px var(--auth-font);
  letter-spacing: -.005em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12);
  transition: background-color .15s ease, transform .1s ease-out;
}
.auth-primary:hover { background: var(--auth-brand-hov); }
.auth-primary:active { transform: scale(.98); }
.auth-primary:disabled { opacity: .6; cursor: default; transform: none; }
a.auth-primary { display: grid; place-items: center; text-decoration: none; }

.auth-reveal:focus-visible, .auth-link:focus-visible, .auth-primary:focus-visible {
  outline: 3px solid rgb(47 122 51 / .45);
  outline-offset: 2px;
}

.auth-msg { margin: 14px 0 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.auth-msg:empty { display: none; }
.auth-msg.is-error { color: var(--auth-danger); background: #fdeeed; border-radius: 11px; padding: 10px 12px; }
.auth-msg.is-info { color: var(--auth-ink-2); text-align: center; }

.auth-foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #efefef;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--auth-ink-3);
  text-align: center;
}
.auth-foot:empty { display: none; }

/* Arrival: the logo and card rise in once; switching between sign-in and
   reset cross-fades the form. Nothing loops, nothing bounces. */
.auth-logo, .auth-card { animation: auth-rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.auth-card { animation-delay: .04s; }
.auth-form:not([hidden]) { animation: auth-fade .2s ease-out; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 480px) {
  .auth-logo { width: 188px; margin-bottom: 22px; }
  .auth-card { border-radius: 20px; padding: 28px 22px 22px; }
  .auth-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo, .auth-card, .auth-form:not([hidden]) { animation: none; }
  .auth-primary { transition: background-color .15s ease; }
  .auth-primary:active { transform: none; }
}

@media (prefers-contrast: more) {
  .auth-field input { border-color: #8b8c90; }
  .auth-lede, .auth-foot { color: var(--auth-ink); }
}
