:root {
  --blue: #1557a0;
  --blue-dark: #10467f;
  --blue-pale: #eef5fb;
  --text: #1f2933;
  --muted: #5f6b76;
  --border: #d7dde3;
  --background: #f5f7f9;
  --white: #ffffff;
  --danger: #a4262c;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.site-header {
  height: 72px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: block; width: 126px; height: auto; }
.header-label { color: var(--muted); font-size: 14px; }

.page {
  flex: 1;
  width: min(600px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 48px;
}

.page-heading { margin-bottom: 28px; text-align: center; }
.page-heading h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.page-heading p { margin: 0 auto; max-width: 500px; color: var(--muted); font-size: 16px; }

.recovery-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(31, 41, 51, .06);
}

.card-header {
  min-height: 52px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.secure-label { display: flex; align-items: center; gap: 7px; }
.secure-label span { color: #268744; font-size: 10px; }
.card-content { min-height: 400px; padding: 34px 36px 36px; }

h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
.card-content > div > p:not(.status-kicker, .warning, .help-desk) { color: var(--muted); }

form { margin-top: 28px; }
label, .field-label { display: block; margin-bottom: 7px; color: var(--text); font-size: 14px; font-weight: 600; }

input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #aeb7c0;
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  outline: none;
}

input::placeholder { color: #87929d; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21, 87, 160, .14); }

button, .button-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--blue);
  color: var(--white);
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

form button, #reset-button, .button-link { width: 100%; }
button:hover, .button-link:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
button:focus-visible, .button-link:focus-visible { outline: 3px solid rgba(21, 87, 160, .24); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: wait; }

.status-icon { width: 42px; height: 42px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-size: 20px; font-weight: 700; }
.status-icon--attention { background: #fdf2f2; color: var(--danger); }
.status-icon--loading { position: relative; color: transparent; font-size: 0; }
.status-icon--loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -11px 0 0 -11px; border: 2px solid #b9d0e8; border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
.status-kicker { margin-bottom: 7px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#status-message { color: var(--muted); }

.progress-meter { margin-top: 27px; }
.progress-meta { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e7ebef; }
.progress-track span { position: relative; display: block; width: 5%; height: 100%; border-radius: inherit; background: var(--blue); transition: width 500ms ease; }
.progress-track span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-100%); animation: progress-sheen 1.8s ease-in-out infinite; }

.steps { margin: 28px 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.steps li[hidden] { display: none; }
.steps li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-size: 12px; font-weight: 700; }
.steps li.is-complete > span { background: var(--blue); color: var(--white); }
.steps li.is-current strong { color: var(--blue); }
.steps strong, .steps small { display: block; }
.steps strong { margin-bottom: 2px; font-size: 14px; font-weight: 600; }
.steps small { color: var(--muted); font-size: 12px; }

.password-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 13px; border: 1px solid var(--border); border-radius: 4px; background: #fafbfc; }
.password-row code { min-width: 0; flex: 1; overflow-wrap: anywhere; font: 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.password-row button { min-height: 34px; margin: 0; padding: 0 13px; font-size: 13px; }
.warning { margin-top: 9px; color: var(--danger); font-size: 12px; }
.help-desk { margin-top: 24px; padding: 13px 14px; border-left: 3px solid var(--blue); background: var(--blue-pale); color: var(--text); font-size: 13px; }
.support { margin-top: 22px; color: var(--muted); text-align: center; font-size: 13px; }

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 24px;
  display: flex;
  justify-content: space-between;
  color: #74808b;
  font-size: 12px;
}

@media (max-width: 600px) {
  .site-header { height: 64px; }
  .logo { width: 112px; }
  .page { padding: 38px 0; }
  .page-heading h1 { font-size: 27px; }
  .card-content { min-height: 390px; padding: 28px 22px 30px; }
  .card-header { padding: 0 20px; }
  footer { flex-direction: column; gap: 4px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  button, .button-link { transition: none; }
  .status-icon--loading::after, .progress-track span::after { animation: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress-sheen { 55%, 100% { transform: translateX(100%); } }
