:root {
  color-scheme: light;
  --ink: #122823;
  --muted: #536661;
  --line: #dce6e1;
  --surface: #f8fbf9;
  --accent: #126750;
  --accent-hover: #0c503e;
  --mint: #96ebbf;
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 32px;
  display: grid;
  place-items: center;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 12% 12%, #deeee4 0%, transparent 55%),
    #f0f5f2;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background-image:
    linear-gradient(#29654a0d 1px, transparent 1px),
    linear-gradient(90deg, #29654a0d 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(150deg, #000 12%, #0004 52%, #000 100%);
}

.ambient::before, .ambient::after {
  position: absolute;
  width: min(82vw, 920px);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
}

.ambient::before {
  top: -38%;
  left: -24%;
  background: radial-gradient(circle, #8bd7ab9c, transparent 68%);
  animation: drift 17s ease-in-out infinite alternate;
}

.ambient::after {
  right: -30%;
  bottom: -50%;
  background: radial-gradient(circle, #78b9b7a8, transparent 70%);
  animation: drift 21s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate3d(-4%, 0, 0) scale(.94); }
  to { transform: translate3d(23%, 18%, 0) scale(1.18); }
}

.card {
  display: grid;
  grid-template-columns: 1fr 1.04fr;
  width: min(1120px, 100%);
  min-height: 680px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe7e0;
  border-radius: 29px;
  box-shadow: 0 26px 70px #102f2120, 0 4px 14px #102f2109;
}

.account {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px clamp(26px, 5vw, 75px) 36px;
}

.form-side {
  flex: 1;
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
}

form {
  display: none;
  width: 100%;
  max-width: 386px;
}

form.active { display: block; }

h1, h2 {
  margin: 0 0 9px;
  font-family: "Bricolage Grotesque", Inter, "Segoe UI", sans-serif;
  font-size: clamp(31px, 3.4vw, 44px);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.1;
}

form h2 { font-size: clamp(27px, 2.8vw, 37px); }

.sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.step::before {
  width: 18px;
  height: 3px;
  border-radius: 4px;
  background: #54a680;
  content: "";
}

.field { min-width: 0; margin-bottom: 15px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 49px;
  padding: 11px 13px;
  border: 1px solid #cbdad2;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}

.field input::placeholder { color: #687a73; }
.field input:read-only { background: #edf3ef; color: #425951; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #12675024; outline: 0; }
.password-wrap { position: relative; }
.password-wrap input { padding-inline-end: 69px; }
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.password-toggle {
  position: absolute;
  inset-block: 4px;
  inset-inline-end: 5px;
  min-width: 54px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover { background: #e9f3ed; }
.otp input { font-variant-numeric: tabular-nums; letter-spacing: .3em; font-size: 21px; text-align: center; }

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 49px;
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn:hover { background: var(--accent-hover); }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cbdad2; }
.btn.ghost:hover { background: #edf6f0; border-color: #86af9b; }
.btn.ghost.face-option { background: #eef8f2; color: #164b3b; border-color: #cce2d5; }
.btn.ghost.face-option:hover { background: #e3f3e9; border-color: #8bb8a1; }
.btn:disabled, .text-button:disabled { opacity: .62; cursor: default; }
.btn[aria-busy="true"] { cursor: wait; }

.btn[aria-busy="true"]::after {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  content: "";
}

@keyframes spin { to { transform: rotate(1turn); } }

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.text-button:not(:disabled):hover { text-decoration: underline; text-underline-offset: 3px; }
:is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.form-side :is(h1, h2):focus { outline: none; }
.forgot-link { margin: -8px 0 0; text-align: right; font-size: 13px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0 11px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
[data-access="remote"] #v-login :is(.forgot-link, .divider, .face-option, .alt) { display: none; }
[hidden] { display: none !important; }
#session-email { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
#session-dashboard { text-decoration: none; }
[data-access="remote-camera"] #v-login .forgot-link,
[data-access="remote-camera"] #face-mode { display: none; }

.alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 5px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.msg {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #efd2cf;
  border-radius: 9px;
  background: #fdf0ef;
  color: #862e28;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.msg.ok { background: #ebf8ef; border-color: #c9e7d3; color: #155c38; }
.msg.face-warning { border-left: 4px solid #a8352d; font-weight: 650; }
.msg:empty { margin: 0; padding: 0; border: 0; }

.camera {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px dashed #b5cfc1;
  border-radius: 12px;
  background: #eef6f1;
  color: #315a4b;
}

.camera-placeholder {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 15px;
  font-size: 12px;
  font-weight: 600;
}

.camera[data-active="true"] { border-style: solid; background: #11251e; }
.camera[data-active="true"] .camera-placeholder { display: none; }
.face-preview { width: 100%; max-height: 245px; aspect-ratio: 4/3; object-fit: contain; transform: scaleX(-1); }
.camera-guide { display: none; position: absolute; inset: 11% 22%; pointer-events: none; }
.camera[data-active="true"] .camera-guide { display: block; }
.scan-status {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
}

.scan-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 0 0 9px;
  accent-color: var(--accent);
}
.corners { color: var(--mint); }
.corners::before, .corners::after, .corners span::before, .corners span::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  content: "";
}
.corners::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.corners::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.corners span::before { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.corners span::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

.hero {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100%;
  display: flex;
  align-items: flex-end;
  margin: 0;
  padding: clamp(26px, 3.5vw, 50px);
  overflow: hidden;
  border-radius: 20px;
  background: #153a30;
  color: #fff;
}

.hero img, .hero::after { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: 54% 48%; filter: saturate(.8) contrast(.96); }
.hero::after {
  background: linear-gradient(180deg, #153a301f, transparent 34%, #071a137a 69%, #071a13f0);
  content: "";
}

.hero-frame {
  position: absolute;
  inset: 25px;
  color: #d3ffe7ae;
  pointer-events: none;
}
.hero figcaption { position: relative; width: 100%; padding: 20px 0 3px; border-top: 1px solid #c8f1da65; }
.hero h2 { max-width: 15ch; margin: 0 0 9px; font-size: clamp(27px, 3.1vw, 42px); text-wrap: balance; }
.hero p { margin: 0; color: #d9eae1; font-size: 14px; line-height: 1.45; }

@media (max-width: 880px) {
  .account { padding-inline: 27px; }
  .hero-frame { inset: 18px; }
}

@media (max-width: 660px) {
  body { padding: 14px; place-items: start center; }
  .card { grid-template-columns: minmax(0, 1fr); max-width: 500px; min-height: 0; padding: 8px; border-radius: 21px; }
  .account { padding: 15px 17px 20px; }
  .form-side { padding-top: 10px; }
  .sub { margin-bottom: 18px; }
  .hero { min-height: 150px; padding: 20px; border-radius: 14px; }
  .hero img { object-position: 52% 63%; }
  .hero::after { background: linear-gradient(180deg, transparent 5%, #071a13b5 70%, #071a13ef); }
  .hero-frame { display: none; }
  .hero figcaption { padding: 0; border: 0; }
  .hero h2 { max-width: none; font-size: 23px; text-wrap: initial; }
  .hero p { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
