:root {
  --ink: #23251f;
  --muted: #6e7068;
  --line: #dedfd8;
  --paper: #f8f7f2;
  --surface: #ffffff;
  --sage: #5d6d52;
  --sage-dark: #46543e;
  --sage-soft: #e8ece4;
  --danger: #ad3e36;
  --shadow: 0 18px 55px rgba(39, 44, 33, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(470px, 0.88fr) minmax(520px, 1.12fr);
}

.form-panel {
  display: flex;
  justify-content: center;
  padding: 44px clamp(40px, 5vw, 84px) 28px;
  background: var(--paper);
}

.form-inner {
  width: min(100%, 430px);
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--sage);
  box-shadow: 0 8px 18px rgba(70, 84, 62, 0.23);
}

.brand-mark svg { width: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.brand-mark svg path:last-child { opacity: .48; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 17px; line-height: 1.1; letter-spacing: -.2px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.4px; text-transform: uppercase; }

.welcome-copy { margin-top: clamp(64px, 10vh, 112px); }
.eyebrow { margin: 0 0 10px; color: var(--sage); font-size: 11px; font-weight: 750; letter-spacing: 1.7px; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4.1vw, 52px); font-weight: 500; line-height: 1.05; letter-spacing: -1.7px; }
.welcome-copy > p:last-child { max-width: 390px; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

.biometric-button, .primary-button {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.biometric-button {
  margin-top: 31px;
  border: 1px solid #c7cdc1;
  color: var(--sage-dark);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(39, 44, 33, .045);
}

.biometric-button:hover { border-color: var(--sage); background: #fbfcfa; box-shadow: 0 7px 20px rgba(39, 44, 33, .08); transform: translateY(-1px); }
.button-icon { display: grid; place-items: center; }
.button-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.biometric-note { margin: 9px 0 0; color: #85877f; font-size: 11.5px; text-align: center; }

.divider { display: flex; align-items: center; gap: 13px; margin: 28px 0 23px; color: #8b8d85; font-size: 11px; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }

.field-group { margin-bottom: 18px; }
.field-group label, .label-row { font-size: 12.5px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row a { color: var(--sage); font-size: 11.5px; text-decoration: none; }
.label-row a:hover, .support-copy a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.field-wrap { position: relative; margin-top: 8px; }
.field-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 44px;
  border: 1px solid #d6d7d0;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: rgba(255,255,255,.74);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field-wrap input::placeholder { color: #a0a19a; }
.field-wrap input:focus { border-color: var(--sage); background: #fff; box-shadow: 0 0 0 3px rgba(93, 109, 82, .12); }
.field-wrap input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(173, 62, 54, .08); }
.field-icon { position: absolute; top: 50%; left: 15px; width: 18px; transform: translateY(-50%); fill: none; stroke: #85877f; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; pointer-events: none; }
.password-toggle { position: absolute; top: 50%; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #7c7e76; background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--ink); background: var(--sage-soft); }
.password-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.field-error { min-height: 0; margin: 5px 0 0; color: var(--danger); font-size: 11px; }
.field-error:empty { display: none; }

.remember-row { width: fit-content; display: flex; align-items: center; gap: 9px; margin: 1px 0 22px; color: #62645d; font-size: 12px; cursor: pointer; user-select: none; }
.remember-row input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #c6c8c0; border-radius: 5px; background: white; transition: all .16s ease; }
.custom-check svg { width: 12px; fill: none; stroke: white; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; opacity: 0; transform: scale(.7); transition: all .16s ease; }
.remember-row input:checked + .custom-check { border-color: var(--sage); background: var(--sage); }
.remember-row input:checked + .custom-check svg { opacity: 1; transform: scale(1); }
.remember-row input:focus-visible + .custom-check { box-shadow: 0 0 0 3px rgba(93, 109, 82, .18); }

.primary-button { border: 0; color: white; background: var(--sage); box-shadow: 0 8px 18px rgba(70, 84, 62, .2); }
.primary-button:hover { background: var(--sage-dark); box-shadow: 0 10px 24px rgba(70, 84, 62, .26); transform: translateY(-1px); }
.primary-button:active, .biometric-button:active { transform: translateY(0); }
.primary-button:focus-visible, .biometric-button:focus-visible, a:focus-visible, .password-toggle:focus-visible { outline: 3px solid rgba(93, 109, 82, .25); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .72; transform: none !important; }
.button-spinner { width: 17px; height: 17px; display: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-label, .is-loading .button-icon { display: none; }
.is-loading .button-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.signed-in-panel { margin-top: clamp(62px, 10vh, 108px); text-align: center; }
.signed-in-panel[hidden] { display: none; }
.success-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 18px; color: white; background: var(--sage); box-shadow: 0 12px 26px rgba(70, 84, 62, .24); }
.success-mark svg { width: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.signed-in-panel h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-weight: 500; letter-spacing: -1px; }
.signed-in-panel > p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.enrollment-card { margin-top: 31px; padding: 20px; border: 1px solid #d8dcd3; border-radius: 14px; text-align: left; background: rgba(255,255,255,.72); box-shadow: 0 8px 25px rgba(39,44,33,.055); }
.enrollment-card strong, .enrollment-card span { display: block; }
.enrollment-card strong { font-size: 13px; }
.enrollment-card div > span { margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.secondary-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 17px; border: 1px solid var(--sage); border-radius: 10px; color: var(--sage-dark); background: var(--surface); font-size: 12.5px; font-weight: 750; cursor: pointer; transition: background .18s ease, color .18s ease, transform .18s ease; }
.secondary-button:hover { color: white; background: var(--sage); transform: translateY(-1px); }
.text-button { margin-top: 23px; padding: 8px 12px; border: 0; color: var(--muted); background: transparent; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.secondary-button:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(93, 109, 82, .25); outline-offset: 2px; }

.support-copy { margin: 25px 0 0; color: var(--muted); font-size: 11.5px; text-align: center; }
.support-copy a { color: var(--sage-dark); font-weight: 700; text-decoration: none; }
.form-inner > footer { margin-top: auto; padding-top: 46px; display: flex; justify-content: space-between; color: #92948d; font-size: 10.5px; }
.form-inner > footer nav { display: flex; gap: 18px; }
.form-inner > footer a { text-decoration: none; }
.company-link { width: fit-content; }

.image-panel { position: relative; min-height: 100vh; overflow: hidden; background: #394033; }
.image-panel > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% center; }
.image-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24,27,21,.08) 36%, rgba(19,22,17,.68) 100%); }
.image-badge { position: absolute; top: 42px; right: 42px; display: flex; align-items: center; gap: 11px; padding: 12px 15px 12px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; color: white; background: rgba(34, 40, 30, .45); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.badge-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #eaf2e4; background: rgba(212, 230, 198, .2); }
.badge-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.image-badge strong, .image-badge span { display: block; }
.image-badge strong { font-size: 12px; }
.image-badge span { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 10px; }
.image-panel blockquote { position: absolute; right: clamp(40px, 6vw, 88px); bottom: clamp(46px, 8vh, 88px); left: clamp(40px, 6vw, 88px); margin: 0; color: white; }
.image-panel blockquote p { max-width: 600px; margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 58px); font-weight: 400; line-height: 1.08; letter-spacing: -1.3px; }
.image-panel blockquote footer { margin-top: 17px; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 650; letter-spacing: 1.4px; text-transform: uppercase; }

.toast { position: fixed; right: 26px; bottom: 26px; z-index: 5; max-width: min(380px, calc(100vw - 32px)); display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; color: white; background: #30342c; box-shadow: 0 18px 45px rgba(25,28,22,.25); font-size: 12.5px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-icon { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #b9d0a8; box-shadow: 0 0 0 4px rgba(185,208,168,.14); }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .form-panel { order: 2; padding: 30px 24px 24px; }
  .form-inner { width: min(100%, 480px); min-height: auto; }
  .image-panel { min-height: 260px; max-height: 34vh; }
  .image-panel > img { object-position: 60% 42%; }
  .image-badge { top: 20px; right: 20px; }
  .image-panel blockquote { right: 24px; bottom: 24px; left: 24px; }
  .image-panel blockquote p { max-width: 440px; font-size: clamp(27px, 7vw, 38px); }
  .image-panel blockquote footer { display: none; }
  .welcome-copy { margin-top: 48px; }
  .signed-in-panel { margin-top: 48px; }
  .form-inner > footer { margin-top: 42px; }
}

@media (max-width: 540px) {
  .image-panel { min-height: 210px; }
  .image-badge { display: none; }
  .image-panel blockquote p { font-size: 27px; }
  .form-panel { padding: 25px 20px 22px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .welcome-copy { margin-top: 42px; }
  h1 { font-size: 39px; }
  .form-inner > footer { align-items: center; }
  .toast { right: 16px; bottom: 16px; left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
