/* ==========================================================
   Account sign-in / sign-up – styles
   Loaded after css/styles.css, which supplies the UDOT
   tokens, header, footer, buttons and base field styling.
   Class names match the shared auth scripts, so the markup
   and the JS wiring stay interchangeable between pages.
   ========================================================== */

/* ---------- Page shell ---------- */
.wrapper {
  display: grid;
  /* minmax(0, …) so a fixed-width card can't push the track past the viewport */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  gap: 20px;
  width: 100%;
  padding: 36px 20px 64px;
}

.auth-band .app-band-inner { gap: 16px; }
.app-band-back {
  appearance: none;
  min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--udot-dark-blue);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background-color .15s;
}
.app-band-back:hover { background: rgba(255, 255, 255, .4); }

.card {
  width: 640px; max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(11, 36, 68, .06);
}
.card-inner { padding: 32px 32px 28px; }
.card-inner-center { padding: 36px 32px 34px; text-align: center; }
@media (max-width: 559px) {
  .card-inner, .card-inner-center { padding: 24px 20px; }
}

.headline {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.625rem, 3.4vw, 2rem);
  line-height: 1.15;
  color: var(--udot-dark-blue);
}
.section-divider { height: 1px; margin: 18px 0 24px; background: var(--line); }

.illus { display: block; width: 168px; max-width: 55%; height: auto; margin: 2px auto 20px; }
.title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.625rem, 3.4vw, 2rem);
  line-height: 1.15;
  color: var(--udot-dark-blue);
}
.desc { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 1.0625rem; }
.signin-context { margin: 0 0 20px; color: var(--udot-gray-dark); line-height: 1.5; }

/* Cross-fade between the phone step and the code step */
.step { opacity: 1; transition: opacity .28s ease; }
.step.is-fading { opacity: 0; }

/* ---------- Fields ---------- */
.form { margin-top: 28px; text-align: left; }
.field { margin: 0 0 18px; }
.label-top { display: block; margin: 0 0 6px; font-weight: 700; color: var(--udot-dark-blue); }

.input {
  position: relative;
  display: flex; align-items: center;
  width: 100%; min-height: 48px; padding: 0 12px;
  background: #fff;
  border: 1px solid var(--udot-gray);
  border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--udot-gray-dark); }
.input:focus-within {
  border-color: var(--udot-medium-blue);
  box-shadow: 0 0 0 1px var(--udot-medium-blue), 0 0 0 4px rgba(9, 84, 156, .22);
}
.input input {
  flex: 1 1 auto;
  width: 100%; min-width: 0; min-height: 0;
  padding: 12px 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--udot-gray-dark);
}
/* The .input wrapper draws the border and focus ring; keep the inner input bare. */
.input input:hover,
.input input:focus,
.input input:focus-visible { border: 0; outline: 0; box-shadow: none; }
.input input::placeholder { color: var(--muted); }
.input.has-toggle input, .input:has(.show-btn) input { padding-right: 86px; }

.show-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--udot-medium-blue);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.show-btn:hover { background: var(--blue-tint); color: var(--udot-dark-blue); }
.show-btn-icon { display: block; width: 22px; height: auto; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.legal { margin: 2px 0 18px; font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.legal .link { color: var(--udot-medium-blue); }

/* Grey callout that introduces a step (password reset, phone verification) */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 22px; padding: 14px 16px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-line); border-left: 5px solid var(--udot-light-blue);
  border-radius: var(--r-md);
}
.note svg { flex: none; width: 24px; height: 24px; margin-top: 1px; }
.note-title { font-weight: 700; color: var(--udot-dark-blue); }
.note-desc { margin-top: 2px; font-size: .9375rem; color: var(--udot-gray-dark); }

/* ---------- Remember me / forgot password row ---------- */
.options-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; margin: 2px 0 6px;
}
.remember { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.remember input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--udot-dark-blue); }
.remember .switch-label { color: var(--udot-gray-dark); }
.quiet-link {
  color: var(--udot-medium-blue); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.quiet-link:hover { color: var(--udot-dark-blue); }

/* ---------- Primary action inside a card ---------- */
.primary {
  position: relative;
  display: grid; place-items: center;
  width: 100%; min-height: 52px; margin-top: 8px; padding: 12px 26px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--udot-dark-blue); color: #fff;
  font: inherit; font-weight: 700; font-size: 1.0625rem; line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s;
}
.primary:hover { background: var(--udot-medium-blue); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-label { grid-area: 1 / 1; }
.btn-spinner {
  grid-area: 1 / 1;
  width: 18px; height: 18px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.primary.is-loading .btn-label, .primary.loading .btn-label { visibility: hidden; }
.primary.is-loading .btn-spinner, .primary.loading .btn-spinner { display: inline-block; }

/* A lone primary button on a centred card shouldn't run the full width */
.card-inner-center .primary { max-width: 280px; margin: 26px auto 0; }

.inline-cta { margin: 14px 0 0; text-align: center; color: var(--muted); }
.inline-cta a { font-weight: 700; color: var(--udot-medium-blue); text-underline-offset: 3px; }

/* ---------- "or" divider + social buttons ---------- */
.hr {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin: 22px 0 16px;
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.hr::before, .hr::after { content: ""; height: 1px; background: var(--line); }

.oauth-list { display: grid; gap: 10px; }
.oauth-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 10px 52px;
  background: #fff; color: var(--udot-dark-blue);
  border: 1px solid var(--udot-gray); border-radius: var(--r-sm);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.oauth-btn:hover { background: var(--blue-tint); border-color: var(--udot-medium-blue); }
.oauth-btn:disabled { opacity: .5; cursor: not-allowed; }
.oauth-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 22px; height: 22px;
}
.oauth-icon img, .oauth-icon svg { max-width: 22px; max-height: 22px; }
.oauth-btn.is-loading { pointer-events: none; }
.oauth-btn.is-loading .oauth-icon, .oauth-btn.is-loading .oauth-label { visibility: hidden; }
.oauth-btn .spinner { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.oauth-btn.is-loading .spinner { display: flex; }
.oauth-btn .spinner::before {
  content: "";
  width: 20px; height: 20px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- One-time code ---------- */
.otp { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 0; }
.otp input[type="text"] {
  width: 52px; height: 60px; min-height: 0; padding: 0;
  text-align: center; font-size: 1.5rem; font-weight: 700;
  color: var(--udot-dark-blue); background: #fff;
  border: 1px solid var(--udot-gray); border-radius: var(--r-sm);
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.otp input[type="text"]:focus {
  border-color: var(--udot-medium-blue);
  box-shadow: 0 0 0 1px var(--udot-medium-blue), 0 0 0 4px rgba(9, 84, 156, .22);
}
.otp input[type="text"][data-filled="true"] { background: var(--blue-tint); border-color: var(--udot-light-blue); }
.otp-loader { display: none; align-items: center; justify-content: center; width: 100%; height: 60px; }
.otp.is-loading .otp-loader { display: flex; }
.otp.is-loading input[type="text"] { display: none; }
.otp-spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--udot-light-blue); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@media (max-width: 440px) {
  .otp { gap: 8px; }
  .otp input[type="text"] { width: 44px; height: 54px; font-size: 1.25rem; }
}

/* ---------- Password requirements ---------- */
.requirements { list-style: none; margin: 4px 0 20px; padding-left: 28px; }
.requirements li {
  position: relative; margin: 8px 0;
  font-size: .9375rem; color: var(--muted);
  transition: color .18s ease;
}
.requirements li::before {
  content: "";
  position: absolute; left: -28px; top: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--udot-gray); background: #fff;
  transition: background-color .18s ease, border-color .18s ease;
}
.requirements li::after {
  content: "";
  position: absolute; left: -24px; top: 7px;
  width: 8px; height: 4px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  opacity: 0;
  transition: opacity .18s ease;
}
.requirements li.ok { color: var(--udot-dark-green); font-weight: 700; }
.requirements li.ok::before { background: var(--udot-dark-green); border-color: var(--udot-dark-green); }
.requirements li.ok::after { opacity: 1; }

/* ---------- Back / Next bar under the card ---------- */
.bottombar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 640px; max-width: 100%;
  padding-top: 20px;
  border-top: 1px solid var(--udot-gray);
}
.back-btn, .next-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-weight: 700; font-size: 1.0625rem; line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.back-btn { background: #fff; color: var(--udot-medium-blue); border-color: var(--udot-gray); text-decoration: none; }
.back-btn:hover { background: var(--blue-tint); border-color: var(--udot-medium-blue); }
.next-btn { background: var(--udot-dark-blue); color: #fff; }
.next-btn:hover { background: var(--udot-medium-blue); }
.next-btn:disabled { opacity: .5; cursor: not-allowed; }
.next-btn .btn-label { grid-area: auto; transition: opacity .16s ease; }
.next-btn { position: relative; }
.next-btn .btn-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  grid-area: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-right-color: rgba(255, 255, 255, .4);
  border-radius: 50%;
  animation: spin .85s linear infinite;
  display: none;
}
.next-btn.is-loading .btn-label { opacity: 0; }
.next-btn.is-loading .btn-spinner { display: inline-block; }
@media (max-width: 559px) {
  .bottombar { flex-direction: column-reverse; align-items: stretch; }
  .bottombar .back-btn, .bottombar .next-btn { width: 100%; }
  /* Narrow cards can't centre a long label around the icon, so line them up */
  .oauth-btn { justify-content: flex-start; padding: 10px 16px 10px 46px; }
}

/* ---------- Success ---------- */
.check-img { display: block; width: 76px; height: 76px; margin: 2px auto 20px; }

/* ---------- Toast ---------- */
.bk-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 8px);
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--udot-dark-blue); color: #fff;
  font-size: .9375rem; font-weight: 700; line-height: 1.3;
  box-shadow: 0 10px 30px rgba(11, 36, 68, .3);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.bk-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .step, .primary, .oauth-btn, .back-btn, .next-btn, .bk-toast { transition: none; }
}

/* ---------- Email action handler (authhandler.html) ---------- */
.handler-lead { margin: 8px 0 0; color: var(--muted); font-size: 1.0625rem; }
.status-note { margin: 0; color: var(--udot-gray-dark); font-size: 1.0625rem; line-height: 1.5; }
.status-note strong { color: var(--udot-dark-blue); overflow-wrap: anywhere; }
.status-note a { font-weight: 700; color: var(--udot-medium-blue); text-underline-offset: 3px; }
.handler-form .status-note { margin-bottom: 22px; }
