/*
 * Standalone pages: everything outside the shell. The middleware loads this
 * after tokens.css on login-adjacent, first-run, onboarding and public pages.
 *
 * Those pages come in two kinds, and this file only dresses the shared part of
 * them. Group C (password reset, two-factor, first run, the onboarding portal)
 * brings style.min.css, which is 16,000 lines of upstream's old look, so the
 * rules here repaint its auth card and controls. Group B (public recruitment,
 * survey) brings Tailwind and has its own templates.
 */

@import url("../../cdn/googleapi/css/inter-font-style.css");

html:not(#\#) {
  & body:has(.oh-auth),
  & body:has(.oh-onboarding) {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: var(--type-14);
    line-height: var(--leading-base);
  }

  /* The auth card on a quiet canvas. The hero is for signing in, nowhere else. */
  .oh-auth,
  .oh-onboarding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
    background: var(--background);
  }

  .oh-auth > img {
    display: none;
  }

  .oh-auth-card,
  .oh-onboarding-card {
    width: 100%;
    max-width: 440px;
    max-height: none !important; /* inline on two-factor and first run */
    margin: 0;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: none;
    color: var(--card-foreground);
  }

  .oh-onboarding-card {
    max-width: 640px !important; /* inline on two-factor and first run */
  }

  .oh-onboarding-card--top-bar::before {
    display: none;
  }

  .oh-onboarding-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
    border: 0;
  }

  .oh-onboarding-card__company-name {
    color: var(--foreground);
    font-family: var(--font-display);
    font-size: var(--type-16);
    font-weight: 700;
    letter-spacing: -.01em;
  }

  /* Stepper: the dashed lane, per the design doc, with the current step solid. */
  .oh-onboarding-card__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .oh-onboarding-card__step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-foreground);
    font-size: var(--type-12);

    &:not(:last-child)::after {
      content: "";
      position: absolute;
      top: 50%;
      right: -14px;
      width: 10px;
      border-top: 2px dashed var(--border);
    }
  }

  .oh-onboarding-card__step--active {
    color: var(--foreground);
    font-weight: 500;
  }

  .oh-onboarding-card__count {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: var(--type-12);
    font-feature-settings: var(--numeric-features);
  }

  .oh-onboarding-card__step--active .oh-onboarding-card__count {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
  }

  .oh-onboarding-card__title,
  .oh-onboarding__title {
    color: var(--foreground);
    font-family: var(--font-display);
    font-size: var(--type-24);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 30px;
  }

  .oh-onboarding__content,
  .oh-auth-card .text-muted,
  .oh-onboarding-card .text-muted {
    color: var(--muted-foreground);
    font-size: var(--type-14);
  }

  .oh-onboarding__info-container {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    svg {
      flex: none;
      stroke: var(--go);
    }
  }

  .oh-label {
    color: var(--foreground);
    font-size: var(--type-13);
    font-weight: 500;
  }

  .oh-auth-card :is(.oh-input, input[type="password"], input[type="text"], input[type="email"]),
  .oh-onboarding-card :is(.oh-input, input[type="password"], input[type="text"], input[type="email"]) {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--input);
    border-radius: var(--radius-sm);
    background: var(--card);
    box-shadow: none;
    color: var(--foreground);
    font-size: var(--type-14);

    &:focus {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
  }

  .oh-auth-card .oh-btn,
  .oh-onboarding-card .oh-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    box-shadow: none;
    font-size: var(--type-14);
    font-weight: 500;
  }

  .oh-btn--secondary,
  .oh-btn--secondary-outline {
    border: 1px solid transparent;
    background: var(--primary);
    color: var(--primary-foreground);

    &:hover,
    &:focus-visible {
      background: var(--primary-700);
      color: var(--primary-foreground);
    }
  }

  .oh-password-input--toggle {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted-foreground);
  }

  /* Django's own password widget, which brings no width. */
  .oh-password-input-container input {
    width: 100%;
    padding-right: 40px;
  }

  /* The design bans arrows on buttons, and the word is the whole instruction. */
  :is(.oh-auth-card, .oh-onboarding-card) .oh-btn ion-icon[name="arrow-forward-outline"] {
    display: none;
  }

  ul.errorlist {
    margin: 6px 0 0;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--stop-soft);
    color: var(--stop);
    font-size: var(--type-13);
  }

  /* Toasts, which standalone pages render without components.css. */
  .oh-alert {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-float);
    color: var(--card-foreground);
    font-size: var(--type-13);
  }

  .oh-alert--danger {
    border-left: 3px solid var(--stop);
  }

  .oh-alert--warning {
    border-left: 3px solid var(--caution);
  }

  .oh-alert--info {
    border-left: 3px solid var(--route);
  }

  .oh-alert--success {
    border-left: 3px solid var(--go);
  }

  @media (max-width: 639.98px) {
    .oh-auth-card,
    .oh-onboarding-card {
      padding: 20px;
    }

    .oh-onboarding-card__header {
      flex-direction: column;
      align-items: flex-start;
    }
  }
}
