/* Student account recovery flows, the recovery help form, and the policy
   pages. Builds on ui.css tokens. */
body {
  background:
    radial-gradient(ellipse at 12% 10%, var(--glow), transparent 42%), var(--bg);
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
:focus-visible {
  outline-offset: 4px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4.3vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
}
h2 {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}
h2:focus {
  outline: none;
}

/* Simple header shared by recovery and policy pages. */
.sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(24px, calc((100vw - 1120px) / 2));
  border-top: 5px solid var(--brand);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.sr-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}
.sr-brand img {
  flex-shrink: 0;
}
.sr-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.header-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}
.header-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.sr-main {
  width: min(1080px, calc(100% - 48px));
  margin: 40px auto 56px;
}
.page-heading {
  margin-bottom: 32px;
}
.eyebrow,
.step-eyebrow,
.journey-label {
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow,
.step-eyebrow {
  margin-bottom: 12px;
  color: var(--brand-text);
}
.sr-lead {
  max-width: 670px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.recovery-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.journey {
  padding-top: 8px;
}
.journey-label {
  margin-bottom: 22px;
  color: var(--muted);
}
.progress-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.progress-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding-bottom: 28px;
  color: var(--muted);
}
.progress-list li:not(:last-child)::after {
  position: absolute;
  top: 37px;
  bottom: 5px;
  left: 17px;
  width: 2px;
  background: var(--line);
  content: "";
}
.step-number {
  display: grid;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--field-border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 800;
}
.progress-list strong {
  display: block;
  padding-top: 3px;
  font-size: 0.92rem;
}
.progress-list small {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
}
.progress-list [aria-current="step"] {
  color: var(--ink);
}
.progress-list [aria-current="step"] .step-number {
  border-color: var(--brand-border);
  color: var(--brand-ink);
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(245, 196, 0, 0.14);
}
.progress-list .is-complete .step-number {
  border-color: var(--success);
  color: var(--surface);
  background: var(--success);
}
.progress-list .is-complete::after {
  background: var(--success-line) !important;
}
.journey-note {
  display: flex;
  gap: 12px;
  margin-top: 3px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.journey-note svg {
  width: 23px;
  height: 25px;
  flex-shrink: 0;
  color: var(--success);
}
.journey-note p {
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 700;
}
.journey-note span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}
.email-alternative {
  font-size: 0.84rem !important;
}
.flow-column {
  min-width: 0;
}
.flow-card {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.section-intro {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.96rem;
}
.section-intro strong {
  color: var(--ink-2);
  font-weight: 650;
}
.method-list {
  display: grid;
  gap: 12px;
}
.method-card {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    transform var(--motion-fast) var(--ease-out);
}
.method-card:active {
  transform: scale(0.985);
}
.method-card:hover {
  border-color: var(--brand-border);
  background: var(--brand-tint-2);
}
.method-icon {
  display: grid;
  width: 42px;
  height: 44px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-text);
  background: var(--brand-tint);
}
.method-icon svg {
  width: 23px;
  height: 25px;
}
.method-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
  font-weight: 800;
}
.method-card > span:nth-child(2) {
  flex: 1;
}
.method-card > span > span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
}
.method-card small {
  display: block;
  margin-top: 10px;
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 650;
}
.method-arrow {
  padding-top: 7px;
  color: var(--muted);
  font-size: 1.2rem;
}
.help-disclosure {
  margin-top: 25px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 0.9rem;
}
.help-disclosure summary {
  padding: 10px 0;
  color: var(--ink-2);
  font-weight: 700;
  cursor: pointer;
}
.help-disclosure p {
  margin: 12px 0 0;
}
.help-route {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 21px;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}
.help-route:hover {
  text-decoration: underline;
}
.support-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 10px;
  padding: 20px 8px 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.support-strip a {
  font-weight: 650;
}
.field {
  min-width: 0;
  margin-bottom: 20px;
}
label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 750;
}
input,
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--control-h);
  padding: 12px 15px;
  border: 1px solid var(--field-border);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
}
input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand-border);
  box-shadow: var(--ring);
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
textarea {
  resize: vertical;
}
.field small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.chosen-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 25px;
  padding: 13px 16px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-tint-2);
}
.chosen-method small {
  display: block;
  color: var(--brand-text);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}
.chosen-method strong {
  display: block;
  margin-top: 3px;
  font-size: 0.92rem;
}
.text-button {
  padding: 10px 6px;
  border: 0;
  border-radius: 6px;
  color: var(--brand-text);
  background: none;
  font-size: 0.88rem;
  font-weight: 750;
}
.text-button:hover {
  text-decoration: underline;
}
.quiet-note {
  margin-bottom: 22px;
  padding: 15px 17px;
  border-radius: 11px;
  color: var(--ink-2);
  background: var(--surface-3);
  font-size: 0.86rem;
  line-height: 1.6;
}
.quiet-note > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: var(--control-h);
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--brand-border);
  border-radius: 11px;
  color: var(--brand-ink);
  background: var(--brand);
  font-size: 0.96rem;
  font-weight: 800;
  text-decoration: none;
}
.primary-button:hover:not(:disabled) {
  color: var(--brand-ink);
  background: var(--brand-hover);
}
.secondary-button {
  border-color: var(--field-border);
  color: var(--ink);
  background: var(--surface);
}
.secondary-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--hover);
}
.secondary-button {
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast);
}
.secondary-button:active:not(:disabled) {
  transform: scale(0.97);
}

/* Motion: each step eases in as it appears, finished steps pop to a tick and
   their connector fills, and success screens land with a small pop. */
.sr-main [data-view]:not([hidden]),
#help-success:not([hidden]) {
  animation: ui-rise-in var(--motion) var(--ease-out) backwards;
}
#sr-message:not([hidden]),
#flow-error:not([hidden]) {
  animation: ui-rise-in var(--motion) var(--ease-out);
}
.state-icon.success {
  animation: ui-pop-in 0.45s var(--ease-spring) 0.12s backwards;
}
.success-summary p {
  animation: ui-rise-in var(--motion) var(--ease-out) 0.24s backwards;
}
.success-summary p:nth-child(2) {
  animation-delay: 0.3s;
}
.progress-list .step-number {
  transition:
    background-color var(--motion),
    border-color var(--motion),
    color var(--motion);
}
.progress-list .is-complete .step-number {
  animation: ui-pop-in var(--motion-slow) var(--ease-spring);
}
.progress-list .is-complete::after {
  transform-origin: top center;
  animation: progress-fill 0.45s var(--ease-out);
}
@keyframes progress-fill {
  from {
    transform: scaleY(0);
  }
}
.full {
  width: 100%;
}
.centered {
  display: block;
  margin-top: 20px;
  text-align: center;
}
.subtle-link {
  display: inline-block;
  padding: 10px 0;
  font-size: 0.88rem;
}
.subtle-link.centered {
  display: block;
}
.form-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.verification-instructions {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 14px 12px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 12px;
  background: var(--surface-3);
}
.verification-instructions p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
}
.instruction-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--field-border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 800;
}
.otp-input {
  max-width: 100%;
  height: 64px;
  padding-left: calc(15px + 0.36em);
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.36em;
  text-align: center;
}
.otp-input::placeholder {
  color: var(--field-border);
}
.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 17px;
  color: var(--muted);
  font-size: 0.84rem;
}
.countdown {
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--brand-text);
  background: var(--brand-tint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.countdown.is-low {
  color: var(--danger);
  background: var(--danger-tint);
}
.verified-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--success-line);
  border-radius: 12px;
  color: var(--ink-2);
  background: var(--success-tint);
  font-size: 0.86rem;
}
.verified-note > span:first-child {
  color: var(--success);
  font-weight: 900;
}
.verified-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--success);
  font-size: 0.9rem;
}
.password-rules {
  margin: -5px 0 22px;
}
.field small.is-valid {
  color: var(--success);
}
.flow-message {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-tint);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.state-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 19px;
  font-size: 1.65rem;
  font-weight: 800;
}
.state-icon.success {
  color: var(--success);
  background: var(--success-tint);
}
.state-icon.warning {
  color: var(--warning);
  background: var(--warning-tint);
}
.success-summary {
  padding: 0 0 10px;
}
.success-summary p {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.success-summary span {
  color: var(--success);
}
.restart-button {
  margin-top: 12px;
}
.restart-dialog {
  width: min(460px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: 90vh;
  padding: 28px;
  border: 0;
  border-top: 5px solid var(--brand);
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.restart-dialog::backdrop {
  background: var(--backdrop);
}
.restart-dialog h2 {
  font-size: 1.4rem;
}
.restart-dialog p {
  color: var(--muted);
  font-size: 0.92rem;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.dialog-actions button {
  flex: 1;
  font-size: 0.88rem;
}
.help-timeline {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.help-timeline li {
  position: relative;
  padding: 0 0 22px 40px;
}
.timeline-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--field-border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 800;
}
.help-timeline strong {
  font-size: 0.92rem;
}
.help-timeline p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Terms of use and privacy notice. */
.policy-document {
  width: min(760px, calc(100% - 32px));
  margin: 40px auto 24px;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.policy-document h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}
.policy-document h2 {
  margin: 30px 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.policy-document p,
.policy-document li {
  color: var(--ink-2);
}
.policy-meta {
  margin-bottom: 8px;
  color: var(--brand-text);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.policy-name-note {
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  background: var(--brand-tint-2);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .recovery-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .journey {
    padding: 0;
  }
  .journey-label,
  .journey-note,
  .email-alternative {
    display: none;
  }
  .progress-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .progress-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-align: center;
  }
  .progress-list li:not(:last-child)::after {
    top: 17px;
    bottom: auto;
    left: calc(50% + 23px);
    width: calc(100% - 39px);
    height: 2px;
  }
  .progress-list strong {
    font-size: 0.8rem;
    line-height: 1.3;
  }
  .progress-list small {
    display: none;
  }
  .help-sidebar {
    grid-row: 2;
  }
  .help-sidebar .journey-label {
    display: block;
  }
  .help-timeline {
    margin-bottom: 6px;
  }
  .sr-main {
    width: min(630px, calc(100% - 32px));
    margin-top: 28px;
  }
  .page-heading {
    margin-bottom: 26px;
  }
}
@media (max-width: 450px) {
  .sr-header {
    gap: 12px;
    padding: 12px 14px;
  }
  .sr-brand {
    gap: 9px;
    font-size: 0.95rem;
  }
  .sr-brand small {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }
  .sr-brand img {
    width: 27px;
    height: 34px;
  }
  .header-link {
    font-size: 0.84rem;
    white-space: nowrap;
  }
  .header-link span {
    display: none;
  }
  .sr-main {
    width: calc(100% - 24px);
    margin-top: 24px;
  }
  h1 {
    font-size: 2rem;
  }
  .sr-lead {
    font-size: 0.95rem;
  }
  .flow-card {
    padding: 22px 18px;
    border-radius: 17px;
  }
  .method-card {
    gap: 12px;
    padding: 16px 13px;
  }
  .method-icon {
    width: 34px;
    height: 36px;
    border-radius: 9px;
  }
  .method-icon svg {
    width: 19px;
    height: 21px;
  }
  .method-arrow {
    display: none;
  }
  .method-card strong {
    font-size: 0.95rem;
  }
  .method-card > span > span {
    font-size: 0.86rem;
  }
  .progress-list strong {
    font-size: 0.75rem;
  }
  .step-number {
    width: 32px;
    height: 32px;
  }
  .progress-list li:not(:last-child)::after {
    top: 15px;
    left: calc(50% + 20px);
    width: calc(100% - 33px);
  }
  .chosen-method {
    padding: 12px;
  }
  .verification-instructions {
    gap: 12px 8px;
    padding: 14px;
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .restart-dialog {
    padding: 23px;
  }
}
@media (max-width: 360px) {
  .sr-brand small {
    display: none;
  }
}
