/* =========================================================================
   Polly v3 auth screens — login, SSO handoff, password reset / change / set,
   logout, and the terminal status pages.

   Everything is scoped under `.pauth`. These pages render inside `base.html`,
   which loads the Bootstrap-derived theme bundle (`app-v3.min.css`); the scope
   keeps the two from colliding in either direction.

   The theme sets `html { font-size: 13px }`, so `rem` here would not mean what
   the design says it means. All sizing is in `px` deliberately — do not convert.
   ========================================================================= */

@font-face {
  font-family: 'InterVariable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/InterVariable.woff2') format('woff2');
}

.pauth {
  /* Type */
  --pauth-font-sans: 'InterVariable', 'Inter', -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;

  /* Greys — primary text and neutrals */
  --pauth-grey-50: #f4f4f4;
  --pauth-grey-100: #eaeaea;
  --pauth-grey-200: #d5d5d5;
  --pauth-grey-300: #bfbfbf;
  --pauth-grey-500: #959595;
  --pauth-grey-600: #777777;
  --pauth-grey-700: #595959;
  --pauth-grey-900: #1e1e1e;
  --pauth-white: #ffffff;

  /* Accents */
  --pauth-turquoise-500: #239a9a; /* eyebrow on the light column */
  --pauth-teal-500: #01fff0; /* eyebrow on the dark brand panel */
  --pauth-yellow-500: #ffd601; /* focus ring */
  --pauth-blue-500: #0d41e1;
  --pauth-green-500: #6fcf97;
  --pauth-red-500: #f45846;
  --pauth-status-error: #62231c;
  --pauth-status-success: #2c533c;

  --pauth-radius-pill: 99px;
  --pauth-transition: 200ms ease-in-out;

  font-family: var(--pauth-font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--pauth-grey-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--pauth-white);
}

/* The theme's `.mai-wrapper` is the immediate parent and only sets height. */
.pauth *,
.pauth *::before,
.pauth *::after {
  box-sizing: border-box;
}

.pauth :focus-visible {
  outline: 2px solid var(--pauth-yellow-500);
  outline-offset: 2px;
}

/* ---------- Form column (light) ---------- */

.pauth__form-column {
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
}

.pauth__logo-link {
  align-self: flex-start;
}

.pauth__logo {
  width: 110px;
  height: 28px;
  display: block;
}

.pauth__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Keeps a long error stack from pushing the logo and footer off-screen. */
  padding: 40px 0;
}

.pauth__panel {
  width: 420px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.pauth__heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pauth__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pauth-turquoise-500);
}

.pauth__title {
  font-size: 44px;
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--pauth-grey-900);
  margin: 0;
}

.pauth__subtitle {
  font-size: 16px;
  line-height: 1.5;
  color: var(--pauth-grey-700);
  text-wrap: pretty;
}

.pauth__footer {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pauth-grey-500);
}

.pauth__footer p {
  margin: 0;
}

/* ---------- Brand panel (dark) ---------- */

.pauth__brand-panel {
  background: var(--pauth-grey-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 80px;
}

.pauth__brand-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 520px;
}

.pauth__brand-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pauth-teal-500);
}

.pauth__brand-title {
  font-size: 52px;
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--pauth-white);
  text-wrap: pretty;
  margin: 0;
}

.pauth__brand-body {
  font-size: 17px;
  line-height: 1.55;
  color: var(--pauth-grey-300);
  text-wrap: pretty;
}

/* The mobile header band; hidden until the panel collapses. */
.pauth__mobile-header {
  display: none;
}

/* ---------- Form controls ---------- */

.pauth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.pauth__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pauth__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pauth-grey-600);
}

/* Django renders these inputs; the selector has to beat the theme's
   `.form-control`, hence the element + class pairing. */
.pauth input.pauth__input,
.pauth input[type='text'].pauth__input,
.pauth input[type='email'].pauth__input,
.pauth input[type='password'].pauth__input {
  width: 100%;
  height: 56px;
  background: var(--pauth-grey-50);
  border: 1px solid var(--pauth-grey-50);
  border-radius: var(--pauth-radius-pill);
  padding: 0 26px;
  font-family: var(--pauth-font-sans);
  font-size: 15px;
  line-height: normal;
  color: var(--pauth-grey-900);
  outline: none;
  box-shadow: none;
  transition: border-color var(--pauth-transition),
    background-color var(--pauth-transition);
}

.pauth input.pauth__input::placeholder {
  color: var(--pauth-grey-500);
}

.pauth input.pauth__input:hover {
  border-color: var(--pauth-grey-200);
}

.pauth input.pauth__input:focus {
  background: var(--pauth-white);
  border-color: var(--pauth-grey-900);
}

.pauth input.pauth__input.is-invalid,
.pauth input.pauth__input[aria-invalid='true'] {
  border-color: var(--pauth-red-500);
}

.pauth__button {
  width: 100%;
  height: 56px;
  background: var(--pauth-grey-900);
  color: var(--pauth-white);
  border: 2px solid var(--pauth-grey-900);
  border-radius: var(--pauth-radius-pill);
  font-family: var(--pauth-font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color var(--pauth-transition),
    color var(--pauth-transition);
}

.pauth__button:hover {
  background: var(--pauth-grey-700);
  border-color: var(--pauth-grey-700);
  color: var(--pauth-white);
  text-decoration: none;
}

.pauth__button:disabled {
  background: var(--pauth-grey-300);
  border-color: var(--pauth-grey-300);
  cursor: not-allowed;
}

.pauth__button--secondary {
  background: transparent;
  color: var(--pauth-grey-900);
  border-color: var(--pauth-grey-200);
}

.pauth__button--secondary:hover {
  background: var(--pauth-grey-50);
  border-color: var(--pauth-grey-900);
  color: var(--pauth-grey-900);
}

/* ---------- Links ---------- */

.pauth__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--pauth-grey-700);
}

.pauth__links--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.pauth__link {
  align-self: flex-start;
  font-size: 14px;
  color: var(--pauth-grey-700);
  border-bottom: 1px solid var(--pauth-grey-200);
  text-decoration: none;
  transition: color var(--pauth-transition),
    border-color var(--pauth-transition);
}

.pauth__link:hover,
.pauth__link:focus {
  color: var(--pauth-blue-500);
  border-color: var(--pauth-blue-500);
  text-decoration: none;
}

/* ---------- Alerts ---------- */

.pauth__alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pauth__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  background: #fdeceb;
  color: var(--pauth-status-error);
}

.pauth__alert::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--pauth-red-500);
}

.pauth__alert--success {
  background: #eaf6ef;
  color: var(--pauth-status-success);
}

.pauth__alert--success::before {
  background: var(--pauth-green-500);
}

.pauth__alert strong {
  font-weight: 500;
}

/* ---------- Password requirement hints ---------- */

.pauth__hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pauth__hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pauth-grey-700);
}

.pauth__hint::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--pauth-grey-300);
}

/* ---------- Identity chip (signing in as ...) ---------- */

.pauth__identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  background: var(--pauth-grey-50);
  border-radius: var(--pauth-radius-pill);
  padding: 0 10px 0 26px;
}

.pauth__identity-value {
  font-size: 15px;
  color: var(--pauth-grey-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pauth__identity-action {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pauth-grey-700);
  background: var(--pauth-white);
  border-radius: var(--pauth-radius-pill);
  padding: 11px 18px;
  text-decoration: none;
}

.pauth__identity-action:hover {
  color: var(--pauth-grey-900);
  text-decoration: none;
}

/* ---------- Status pages (no form; centred single column) ---------- */

.pauth--status .pauth__panel {
  width: 520px;
}

/* =========================================================================
   Responsive — the brand panel collapses into a header band, matching
   artboard 2C. 900px is where the 420px form column plus its 64px gutters
   stops fitting beside a legible brand panel.
   ========================================================================= */

@media (max-width: 900px) {
  .pauth {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .pauth__brand-panel {
    display: none;
  }

  .pauth__mobile-header {
    display: flex;
    align-items: center;
    height: 84px;
    padding: 0 24px;
    background: var(--pauth-grey-900);
  }

  .pauth__mobile-header .pauth__logo {
    width: 104px;
    height: 26px;
  }

  .pauth__form-column {
    flex: 1;
    padding: 30px 24px 24px;
    gap: 24px;
  }

  /* The logo lives in the header band on mobile. */
  .pauth__form-column > .pauth__logo-link {
    display: none;
  }

  .pauth__body {
    justify-content: flex-start;
    padding: 0;
  }

  .pauth__panel {
    width: 100%;
    gap: 24px;
  }

  .pauth--status .pauth__panel {
    width: 100%;
  }

  .pauth__title {
    font-size: 30px;
    line-height: 1.08;
  }

  .pauth__subtitle {
    font-size: 15px;
  }

  /* 16px avoids iOS Safari's zoom-on-focus. */
  .pauth input.pauth__input {
    font-size: 16px;
  }

  .pauth__links--inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pauth * {
    transition: none !important;
  }
}
