@import url('nm-system.css');

/* Staff sign-in: full-window split. Photo half and form half, no outer card. */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--nm-text);
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }
.skip-link { position: absolute; z-index: 10; left: 12px; top: -60px; padding: 10px 14px; background: #fff; color: var(--nm-primary-900); }
.skip-link:focus { top: 12px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--nm-primary-700); outline-offset: 3px; }

.sign-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; }

/* Photo half */
.visual { position: relative; min-height: 100svh; overflow: hidden; background: var(--nm-primary-900); }
.visual__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 60%; }
/* Text sits over the soft top of the photo so the seedlings stay visible below. */
.visual__overlay {
  position: absolute;
  inset: 0 0 auto 0;
  padding: clamp(24px, 3.5vw, 44px) clamp(24px, 4vw, 56px) 140px;
  color: #fff;
  background: linear-gradient(180deg, rgba(8, 56, 39, 0.94) 0%, rgba(10, 82, 56, 0.8) 55%, rgba(10, 82, 56, 0) 100%);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 750; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand small { display: block; color: rgba(255, 255, 255, 0.75); font-size: 11px; font-weight: 650; letter-spacing: 0.08em; }
.brand:focus-visible { outline-color: #fff; }
.visual__copy { margin-top: clamp(28px, 6vh, 64px); }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 13px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 12.5px; font-weight: 700; }
.pill__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #8fd6a6; }
.pill__dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: #8fd6a6; opacity: 0.3; }
.visual__title { margin: 16px 0 20px; font-size: clamp(32px, 3.4vw, 48px); font-weight: 700; line-height: 1.08; letter-spacing: -0.035em; }
.chain { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: stage; }
.chain li { counter-increment: stage; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 12.5px; font-weight: 650; }
.chain li::before { content: counter(stage); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--nm-primary-900); font-size: 11px; font-weight: 800; }

/* Form half */
.form-panel {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(20px, 3vw, 36px) clamp(24px, 5vw, 72px);
  background:
    radial-gradient(rgba(15, 110, 74, 0.07) 1.2px, transparent 1.2px) 0 0 / 26px 26px,
    #fff;
}
.form-panel__top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #cfe4d6; border-radius: 10px; background: #fff; color: var(--nm-primary-900); font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { background: var(--nm-primary-50); }
.form-card { width: min(100%, 440px); margin: auto; padding: 24px 0; }
.eyebrow { display: inline-block; color: var(--nm-primary-700); font-size: 12px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.form-card h1 { margin: 8px 0; color: #16231c; font-size: clamp(30px, 2.6vw, 38px); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.lead { margin: 0 0 26px; color: var(--nm-text-soft); font-size: 15.5px; }
.message-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #b9e7c9; border-left-width: 4px; border-radius: 10px; background: #edfbf1; color: #12663c; font-size: 14.5px; line-height: 1.45; }
.message-stack .alert { margin-bottom: 0; }
.alert--error, .alert--danger { border-color: #f1c9c3; border-left-color: var(--nm-danger); background: #fff4f2; color: var(--nm-danger); }

form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { color: #1f2d25; font-size: 14px; font-weight: 700; }
.field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid #cddbd2;
  border-radius: 10px;
  outline: none;
  color: var(--nm-text);
  background: #fbfdfb;
  font-size: 15.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.field input::placeholder { color: #7a8a80; }
.field input:hover { border-color: #a9c4b3; }
.field input:focus { border-color: var(--nm-primary-800); background: #fff; box-shadow: 0 0 0 4px rgba(15, 110, 74, 0.13); }
.field input[aria-invalid='true'] { border-color: var(--nm-danger); }
.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--nm-primary-800); font-size: 13px; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: var(--nm-primary-50); }
.remember-option { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 32px; color: var(--nm-text-soft); font-size: 14px; cursor: pointer; }
.remember-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--nm-primary-800); }
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--nm-primary-900);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.submit-button:hover { background: var(--nm-primary-800); box-shadow: 0 10px 20px -10px rgba(10, 82, 56, 0.55); transform: translateY(-1px); }
.help { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--nm-border); color: var(--nm-muted); font-size: 13.5px; }
.form-panel__footer { color: var(--nm-muted); font-size: 12.5px; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .form-card { animation: rise 0.45s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Short windows (high browser zoom): tighten spacing so the form still fits. */
@media (min-width: 861px) and (max-height: 760px) {
  .form-card { padding: 8px 0; }
  .lead { margin-bottom: 18px; }
  form { gap: 14px; }
  .field input, .submit-button { height: 46px; }
  .help { margin-top: 14px; padding-top: 12px; }
}

/* Tablet and phone: photo becomes a banner above the form. */
@media (max-width: 860px) {
  .sign-in { grid-template-columns: 1fr; }
  .visual { min-height: 260px; }
  .visual__overlay { padding: 20px 24px 80px; }
  .visual__copy { margin-top: 22px; }
  .visual__title { font-size: 28px; margin: 12px 0 14px; }
  .form-panel { min-height: 0; padding: 20px 24px 24px; }
  .form-panel__top { display: none; }
  .form-card { margin: 0 auto; padding: 8px 0 28px; }
  .form-panel__footer { margin-top: 8px; }
}
@media (max-width: 520px) {
  .visual { min-height: 250px; }
  .visual__overlay { padding: 16px 18px 60px; }
  .brand { font-size: 16px; }
  .brand img { width: 38px; height: 38px; }
  .visual__title { font-size: 23px; }
  .chain li { font-size: 11.5px; padding: 4px 8px 4px 5px; }
  .chain li::before { width: 18px; height: 18px; font-size: 10px; }
  .form-panel { padding: 18px 20px 22px; }
}
