/* Authentication pages */
:root {
  color-scheme: light;
  --brand: #fa3c59;
  --brand-dark: #db2440;
  --ink: #191b1d;
  --muted: #687076;
  --line: #e1e4e6;
  --paper: #f7f7f8;
  --white: #fff;
  --success: #157347;
  --auth-form-control-height: 46px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.eyebrow { color: var(--brand); font-size: .69rem; font-weight: 850; letter-spacing: .18em; }
.eyebrow.light { color: #ff9dac; }
.muted { color: var(--muted); }
h2 { margin: .35rem 0; font-size: clamp(2rem, 2.8vw, 2.45rem); line-height: 1.1; letter-spacing: -.045em; }
a { color: var(--brand-dark); font-weight: 750; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(250,60,89,.25); outline-offset: 3px; }

/* Login */
.login-page {
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100svh;
  padding: clamp(1.25rem, 4vw, 4rem);
  place-items: center;
  overflow: hidden;
  background: #fff url("/static/assets/backgrounds/auth-corners.svg") center / cover no-repeat;
}

.login-frame {
  display: grid;
  grid-template-columns: minmax(360px, .93fr) minmax(470px, 1.07fr);
  width: min(1280px, 100%);
  height: min(730px, 100%);
  min-height: 590px;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(224,226,228,.75);
  border-radius: 24px;
  box-shadow: 0 30px 85px rgba(31,35,38,.16), 0 5px 18px rgba(31,35,38,.06);
  animation: frame-enter .7s cubic-bezier(.22,.8,.25,1) both;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  color: white;
  background-image:
    linear-gradient(180deg, rgba(20,20,21,.38), rgba(20,20,21,.2) 35%, rgba(20,20,21,.92)),
    url("/static/assets/images/debris-truck-yard.jpg");
  background-position: 56% center;
  background-size: cover;
}

.login-visual::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(135deg, rgba(250,60,89,.2), transparent 52%);
}

.login-visual::after {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 54px;
  height: 54px;
  content: "";
  border-top: 2px solid rgba(255,255,255,.65);
  border-right: 2px solid rgba(255,255,255,.65);
}

.visual-copy, .scan-flow { position: relative; z-index: 1; }
.visual-copy { margin-top: auto; margin-bottom: clamp(2.5rem, 7vh, 4.5rem); animation: content-rise .75s .2s cubic-bezier(.22,.8,.25,1) both; }
.visual-copy h1 { margin: .65rem 0 1rem; font-size: clamp(2.9rem, 4.15vw, 4.65rem); line-height: .96; letter-spacing: -.06em; }
.visual-copy h1 span { display: block; white-space: nowrap; }
.visual-copy p { max-width: 540px; margin: 0; color: rgba(255,255,255,.82); font-size: clamp(.95rem, 1.2vw, 1.1rem); }

.scan-flow { display: flex; align-items: center; color: rgba(255,255,255,.76); font-size: .71rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; animation: content-rise .75s .34s cubic-bezier(.22,.8,.25,1) both; }
.scan-flow span { display: flex; gap: .45rem; align-items: center; white-space: nowrap; }
.scan-flow b { display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 1px solid rgba(255,255,255,.48); border-radius: 50%; color: white; font-size: .58rem; }
.scan-flow span:nth-of-type(1) b { animation: scan-pulse 3.2s .8s ease-in-out infinite; }
.scan-flow span:nth-of-type(2) b { animation: scan-pulse 3.2s 1.35s ease-in-out infinite; }
.scan-flow span:nth-of-type(3) b { animation: scan-pulse 3.2s 1.9s ease-in-out infinite; }
.scan-flow i { flex: 1; min-width: .7rem; height: 1px; margin: 0 .55rem; background: rgba(255,255,255,.3); }

.login-form-panel {
  position: relative;
  display: grid;
  min-width: 0;
  padding: clamp(2rem, 4vw, 4rem);
  place-items: center;
  background:
    radial-gradient(circle at 100% 100%, rgba(250,60,89,.08), transparent 32%),
    linear-gradient(145deg, #fff, #fbfbfc);
}

.login-form-panel::after {
  position: absolute;
  right: -85px;
  bottom: -85px;
  width: 220px;
  height: 220px;
  content: "";
  border: 42px solid rgba(250,60,89,.045);
  border-radius: 50%;
  pointer-events: none;
}

.login-logo { position: absolute; z-index: 1; top: clamp(1.8rem, 3vw, 3rem); right: clamp(2rem, 4vw, 4rem); width: clamp(155px, 13vw, 195px); height: auto; animation: logo-enter .65s .25s cubic-bezier(.22,.8,.25,1) both; }
.login-form { position: relative; z-index: 1; width: min(100%, 410px); animation: content-rise .7s .32s cubic-bezier(.22,.8,.25,1) both; }
.login-symbol { display: grid; width: 46px; height: 46px; margin-bottom: 1.1rem; place-items: center; border: 1px solid rgba(250,60,89,.2); border-radius: 13px; background: #fff3f5; box-shadow: 0 8px 22px rgba(250,60,89,.1); }
.login-symbol img { width: 23px; height: 23px; }
.login-form > .muted { max-width: 380px; margin: .75rem 0 1.5rem; }

label { display: grid; gap: .45rem; margin: 1rem 0; font-size: .84rem; font-weight: 750; }
input { width: 100%; min-width: 0; min-height: var(--auth-form-control-height); border: 1px solid #d3d6d8; border-radius: 9px; padding: .7rem .9rem; color: var(--ink); background: #fafafb; font: inherit; outline: none; transition: border-color .18s, background .18s, box-shadow .18s; }
input::placeholder { color: #a1a6aa; }
input:hover { background: white; border-color: #b9bdc0; }
input:focus { background: white; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(250,60,89,.13); }
input.field-invalid { border-color: #c92a3f !important; box-shadow: none !important; }
.field-validation-error { display: block; min-width: 0; margin: -.1rem 0 0; overflow: hidden; color: #c1263d; font-size: .7rem; font-weight: 650; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.field-validation-error[hidden] { display: none !important; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 3.25rem; }
.password-toggle { position: absolute; top: 50%; right: .55rem; display: grid; width: 38px; height: 38px; min-height: 0; padding: 0; place-items: center; transform: translateY(-50%); border: 0; border-radius: 8px; background: transparent; box-shadow: none; cursor: pointer; }
.password-toggle:hover { background: #f0f1f2; box-shadow: none; transform: translateY(-50%); }
.password-toggle img { width: 20px; height: 20px; opacity: .65; }
.password-toggle.visible img { opacity: 1; }
.form-row { margin: -.1rem 0 .65rem; text-align: right; font-size: .84rem; }
.message { min-height: 1.35rem; margin: .3rem 0; color: #a62424; font-size: .84rem; }
.message.success { color: var(--success); }

button { display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 50px; border: 0; border-radius: 10px; font: inherit; font-weight: 780; cursor: pointer; transition: box-shadow .18s, transform .18s; }
.login-submit { color: white; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 10px 25px rgba(219,36,64,.25); }
.login-submit:hover { box-shadow: 0 13px 30px rgba(219,36,64,.34); transform: translateY(-1px); }
.login-submit span { transition: transform .18s ease; }
.login-submit:hover span { transform: translateX(4px); }
.login-submit:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: wait; }
.security-note { display: flex; gap: .45rem; align-items: center; justify-content: center; margin: .85rem 0 0; color: #7b8185; font-size: .7rem; }
.security-note span { color: var(--success); font-size: .46rem; }

/* Forgot/reset password */
.center-shell { display: grid; min-height: 100vh; min-height: 100svh; padding: 1.25rem; place-items: center; background: #fff url("/static/assets/backgrounds/auth-corners.svg") center / cover no-repeat; }
.auth-card { width: min(100%, 440px); padding: 2.5rem; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(29,31,33,.12); }
.form-brand { width: 210px; margin: 0 0 2rem; }
.form-brand img { display: block; width: 100%; height: auto; }
.auth-card button[type="submit"] { color: white; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 10px 25px rgba(219,36,64,.22); }
.back { display: block; margin-bottom: 1.4rem; font-size: .84rem; }

@media (max-width: 960px) {
  .login-page { padding: 1.25rem; }
  .login-frame { grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr); }
  .login-visual { padding: 2.25rem; }
  .visual-copy h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
  .login-form-panel { padding: 2.25rem; }
  .scan-flow i { margin: 0 .35rem; }
}

@media (max-width: 740px) {
  .login-page { padding: .75rem; }
  .login-frame { grid-template-columns: 1fr; grid-template-rows: 155px 1fr; width: min(100%, 520px); min-height: 0; border-radius: 20px; }
  .login-visual { padding: 1.4rem 1.6rem; background-position: center 45%; }
  .login-visual::after, .scan-flow { display: none; }
  .visual-copy { margin: auto 0 0; }
  .visual-copy h1 { margin: .3rem 0 0; font-size: 2rem; }
  .visual-copy p { display: none; }
  .login-form-panel { padding: 1.5rem; place-items: center; }
  .login-logo { top: 1.25rem; right: 1.5rem; width: 155px; }
  .login-form { margin-top: 2.25rem; }
  .login-symbol { display: none; }
  .login-form > .muted { margin-bottom: 1rem; }
}

@media (max-width: 440px) {
  .login-page { padding: 0; background: #fff; }
  .login-frame { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .login-form-panel { padding: 1.25rem; }
  .login-form { width: 100%; }
}

@media (max-height: 680px) and (min-width: 741px) {
  .login-page { padding: 1rem; }
  .login-frame { min-height: 0; }
  .login-logo { top: 1.3rem; }
  .login-symbol, .security-note { display: none; }
  .login-form > .muted { margin: .35rem 0 .7rem; font-size: .85rem; }
  .login-form label { margin: .55rem 0; }
  .message { min-height: 1rem; margin: .1rem 0; }
  .visual-copy { margin-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .login-frame, .visual-copy, .scan-flow, .scan-flow b, .login-logo, .login-form { animation: none !important; }
}

@keyframes frame-enter {
  from { opacity: 0; transform: translateY(14px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes content-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-enter {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scan-pulse {
  0%, 42%, 100% { color: white; background: transparent; border-color: rgba(255,255,255,.48); box-shadow: none; }
  14% { color: white; background: rgba(250,60,89,.9); border-color: #ff8b9d; box-shadow: 0 0 0 5px rgba(250,60,89,.14); }
}
