:root {
  --navy: #001750;
  --blue: #004AFF;
  --blue-hover: #1f63ff;
  --cyan: #00C2F2;
  --grey-bg: #EAEBEB;
  --grey-line: #ccd0d4;
  --grey-text: #55595C;
  --error: #c4122f;
  --error-bg: #fdecef;
  --warn-bg: #fff6df;
  --warn-line: #e6b94d;
  --info-bg: #eaf1ff;
  --ok: #1d7a3e;
}

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

html { background: var(--grey-bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "Brand Sans", "Segoe UI", Helvetica, Arial, sans-serif; font-size: 17px; line-height: 1.45; color: #1a1d21;
  -webkit-font-smoothing: antialiased;
}

main#card {
  width: calc(100% - 32px); max-width: 460px; margin: 24px auto; padding: 28px 22px 30px;
  background: #fff; text-align: center; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.logo { display: inline-block; margin: 0 auto 14px; }
.logo img { display: block; width: 200px; height: auto; }

h1 { margin: .45em 0 .55em; font-size: 1.6em; line-height: 1.2; color: var(--navy); font-weight: 700; text-align: center; }
.lead { margin: 0 0 1em; color: #33383d; }

hr { border: 0; border-top: 1px solid var(--grey-line); margin: 22px 0 16px; }

a, a:link, a:visited { color: var(--blue); }
a:hover, a:focus { color: var(--blue-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.step { text-align: center; }
form.step label, .policy { display: block; text-align: left; }
label { display: block; margin: 12px 0 2px; font-weight: 700; color: var(--navy); text-align: left; }

input[type="text"], input[type="password"], input[type="email"] {
  display: block; width: 100%; margin: 4px 0 6px; padding: 11px 12px; font: inherit; color: inherit;
  background: #fff; border: 1px solid #b7bbbf; border-radius: 4px;
}
input::placeholder { color: #9aa0a6; }
input:hover:not(:disabled) { border-color: #97999B; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 194, 242, .35); outline: none; }
input[aria-invalid="true"] { border-color: var(--error); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle {
  position: absolute; top: 4px; right: 4px; bottom: 10px; min-width: 56px; padding: 0 10px; font: inherit; font-size: .85em;
  color: var(--blue); background: transparent; border: 0; border-radius: 4px; cursor: pointer;
}
.pw-toggle:hover { background: var(--info-bg); }

.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 4px; text-align: left; }
.check.center { justify-content: center; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.check label { margin: 0; font-weight: 400; color: #33383d; font-size: .95em; }

.btn {
  display: inline-block; min-width: 150px; margin-top: 14px; padding: 12px 22px; font: inherit; font-weight: 700; line-height: 1.2;
  border-radius: 4px; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s;
}
form.step > .btn-primary { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #0a2a78; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: #f1f4fb; }
.btn:disabled { background: var(--grey-bg); color: var(--grey-text); border-color: transparent; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-row .btn { min-width: 130px; }

.links { margin: 0; font-size: 1em; }
.links .sep { display: inline-block; width: 0; height: 1em; margin: 0 12px; border-left: 2px solid #217CB8; vertical-align: -2px; }

.msg { margin: 0 0 14px; padding: 11px 14px; text-align: left; border-radius: 4px; border: 1px solid; font-size: .95em; }
.msg strong { display: block; margin-bottom: 2px; }
.msg-error { background: var(--error-bg); border-color: #f0b3bd; color: #7d0c1f; }
.msg-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #5b4300; }
.msg-info { background: var(--info-bg); border-color: #b9ceff; color: var(--navy); }
.msg-ok { background: #e9f7ee; border-color: #a7d9b8; color: #14532b; }
.field-err { margin: 2px 0 6px; color: var(--error); font-size: .92em; text-align: left; }

.policy { margin: 10px 0 4px; font-size: .9em; color: #33383d; }
.policy ul { margin: 4px 0 0; padding: 0; list-style: none; }
.policy li { position: relative; padding-left: 22px; color: var(--grey-text); }
.policy li::before { content: "\25CB"; position: absolute; left: 2px; top: 0; }
.policy li.ok { color: var(--ok); }
.policy li.ok::before { content: "\2713"; }

footer {
  margin-top: auto; padding: 14px 16px; background: var(--grey-text); color: #fff; font-size: .9em;
  display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; align-items: center;
}
footer a, footer a:link, footer a:visited { color: #fff; text-decoration: none; margin-right: 14px; display: inline-block; }
footer a:last-child { margin-right: 0; }
footer a:hover { text-decoration: underline; }

#loader { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .65); }
.spinner { width: 46px; height: 46px; border: 5px solid #cfd8ee; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .btn { transition: none; } }

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

@media (min-width: 768px) {
  main#card { max-width: 800px; margin: 40px auto; padding: 36px 24px 40px; }
  form.step, #step-username-sent, #step-reset-done, #step-redirect { max-width: 440px; margin: 0 auto; }
  h1 { font-size: 1.8em; }
}
@media (max-width: 380px) {
  main#card { padding: 22px 14px 26px; }
  .btn-row .btn { width: 100%; }
}
