/* Sign-in, forgot-password and reset-password pages. Served before sign-in (server.js),
   so it can't rely on styles.css — tokens are repeated from there, per DESIGN.md. */
:root {
  --primary: #ccfc7e;
  --primary-h: #b8f45a;
  --primary-dark: #3e6b00;
  --primary-text: #182700;
  --primary-ring: rgba(204, 252, 126, .38);
  --bg: #f0f1f3;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e6e8ec;
  --text: #111318;
  --text-2: #3d424d;
  --muted: #717785;
  --muted-2: #9da3ae;
  --danger: #d93636;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 14px/1.5 "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 480px) 1fr;
}

/* ---------- Form column ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 32px 48px;
  background: var(--surface);
}

.auth-brand { display: block; width: 124px; height: auto; }

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}

.auth-form { width: 100%; max-width: 340px; }
.auth-form[hidden] { display: none; }

.auth-form h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.auth-lede { margin: 0 0 32px; color: var(--muted); font-size: 14px; }

.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.auth-field input:hover { border-color: #d6d9df; }

.auth-field input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }

.auth-submit {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--ease);
}

.auth-submit:hover { background: var(--primary-h); }
.auth-submit:disabled { cursor: default; opacity: .6; }

.auth-submit:focus-visible,
.auth-link:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 3px;
}

.auth-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.auth-back { margin-top: 20px; font-size: 13px; }

.auth-message { min-height: 20px; margin: 4px 0 0; font-size: 13px; }
.auth-message.is-error { color: var(--danger); }
.auth-message.is-note { color: var(--primary-dark); }
.auth-message a { color: inherit; font-weight: 600; }

.auth-foot { margin: 0; color: var(--muted-2); font-size: 12px; }

/* ---------- The photo ---------- */

.auth-field-art {
  position: relative;
  overflow: hidden;
  margin: 0;
  background: #2a2c30 url(/brand/login-wide.jpg) 30% center / cover no-repeat;
}

/* Darkens only the lower edge so the caption reads; the facade stays untouched above. */
.auth-field-art::after {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .55));
}

.auth-caption {
  position: absolute;
  left: 48px;
  bottom: 40px;
  z-index: 1;
  margin: 0;
  max-width: 24ch;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- Phones: the photo fills the screen, the form is a sheet over it ---------- */

@media (max-width: 820px) {
  body { background: #2a2c30; }
  .auth { grid-template-columns: 1fr; grid-template-rows: minmax(150px, 30vh) 1fr; min-height: 100dvh; }
  .auth-field-art { order: -1; background-image: url(/brand/login-narrow.jpg); background-position: center 40%; }
  .auth-field-art::after { display: none; }
  .auth-caption { display: none; }
  .auth-main {
    margin-top: -20px;
    position: relative;
    z-index: 1;
    border-radius: 20px 20px 0 0;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  }
  .auth-brand { width: 112px; }
  .auth-body { justify-content: flex-start; padding: 32px 0 28px; }
  .auth-form { max-width: none; }
  .auth-form h1 { font-size: 26px; }
  .auth-lede { margin-bottom: 24px; }
  .auth-field input { height: 48px; font-size: 16px; }
  .auth-submit { height: 48px; font-size: 15px; }
  .auth-link { font-size: 13px; padding: 4px 0; }
}
