/* ============================================================
   Authentication — PRT public shell
   Landing identity translated into an accessible, lightweight UI.
   ============================================================ */

.auth-page {
  --auth-night: #080a0e;
  --auth-night-raised: #101722;
  --auth-night-soft: #151e2b;
  --auth-silver: #c6cfd6;
  --auth-on-night: #f1f5f7;
  --auth-muted-night: #9ca8b4;
  --auth-signal: oklch(0.7 0.09 220);
  --auth-signal-soft: oklch(0.7 0.09 220 / .11);
  --auth-line: rgba(198, 207, 214, .16);
  --auth-line-strong: rgba(198, 207, 214, .28);
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 14% 12%, var(--auth-signal-soft), transparent 30rem),
    linear-gradient(rgba(198, 207, 214, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 207, 214, .035) 1px, transparent 1px),
    var(--auth-night);
  background-size: auto, 72px 72px, 72px 72px, auto;
  color: var(--ink-default);
}

.auth-page a,
.auth-page button,
.auth-page input {
  -webkit-tap-highlight-color: transparent;
}

.auth-page .skip-link {
  z-index: 1000;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(420px, 42vw, 720px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

/* ---- Brand context --------------------------------------------------- */

.auth-context {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: max(clamp(var(--space-xl), 4vw, var(--space-3xl)), env(safe-area-inset-top, 0px));
  padding-right: max(clamp(var(--space-xl), 4vw, var(--space-3xl)), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(var(--space-xl), 4vw, var(--space-3xl)), env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(var(--space-xl), 4vw, var(--space-3xl)), env(safe-area-inset-left, 0px));
  overflow: hidden;
  color: var(--auth-on-night);
  background:
    radial-gradient(circle at 76% 50%, var(--auth-signal-soft), transparent 17rem),
    radial-gradient(circle at 68% 56%, oklch(0.7 0.09 220 / .04), transparent 26rem),
    linear-gradient(145deg, var(--auth-night-raised), var(--auth-night) 72%);
}

.auth-context::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(198, 207, 214, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 207, 214, .025) 1px, transparent 1px);
  background-size: 72px 72px;
}

.auth-context::after {
  content: "";
  position: absolute;
  right: -12rem;
  bottom: -13rem;
  z-index: -2;
  width: 32rem;
  height: 32rem;
  border: 1px solid color-mix(in oklch, var(--auth-signal) 14%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem color-mix(in oklch, var(--auth-signal) 3%, transparent), 0 0 0 10rem color-mix(in oklch, var(--auth-signal) 1.5%, transparent);
}

/* Le theme sombre reprend exclusivement la gamme graphite du logo. */
[data-layout-mode="dark"].auth-page,
[data-layout-mode="dark"] .auth-page {
  --auth-night: #181818;
  --auth-night-raised: #1e1e1e;
  --auth-night-soft: #222222;
  --auth-silver: #d0d0d0;
  --auth-on-night: #f2f2f2;
  --auth-muted-night: #9c9c9c;
  --auth-signal: var(--signal-azure);
  --auth-signal-soft: rgba(69, 69, 69, .34);
  background:
    radial-gradient(circle at 14% 12%, rgba(69, 69, 69, .34), transparent 30rem),
    linear-gradient(rgba(208, 208, 208, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 208, 208, .035) 1px, transparent 1px),
    var(--auth-night);
  background-size: auto, 72px 72px, 72px 72px, auto;
}

[data-layout-mode="dark"] .auth-context {
  background:
    radial-gradient(circle at 76% 50%, rgba(69, 69, 69, .56), transparent 17rem),
    radial-gradient(circle at 68% 56%, rgba(184, 184, 184, .06), transparent 26rem),
    linear-gradient(145deg, var(--auth-night-raised), var(--auth-night) 72%);
}

[data-layout-mode="dark"] .auth-context::after {
  border-color: rgba(184, 184, 184, .12);
  box-shadow: 0 0 0 5rem rgba(69, 69, 69, .12), 0 0 0 10rem rgba(69, 69, 69, .08);
}

[data-layout-mode="dark"] .lp .globe-callout--commercial {
  --callout-accent: var(--signal-azure);
  --callout-glow: rgba(69, 69, 69, .55);
}

[data-layout-mode="dark"] .lp .globe-callout--consultant {
  --callout-accent: var(--ink-strong);
  --callout-glow: rgba(69, 69, 69, .44);
}

[data-layout-mode="dark"] .lp .globe-callout__title,
[data-layout-mode="dark"] .lp .lp-globe-status b {
  color: var(--ink-strong);
}

[data-layout-mode="dark"] .lp .globe-callout__subtitle {
  color: var(--ink-muted);
}

[data-layout-mode="dark"] .lp .globe-callout__surface,
[data-layout-mode="dark"] .lp .globe-callout--consultant .globe-callout__surface {
  border-color: rgba(184, 184, 184, .24);
}

[data-layout-mode="dark"] .lp .lp-globe-status i {
  background: var(--signal-azure);
  box-shadow: 0 0 0 4px rgba(69, 69, 69, .2), 0 0 15px rgba(69, 69, 69, .55);
  animation-name: auth-globe-pulse-graphite;
}

@keyframes auth-globe-pulse-graphite {
  50% {
    opacity: .65;
    box-shadow: 0 0 0 7px rgba(69, 69, 69, 0), 0 0 20px rgba(69, 69, 69, .36);
  }
}

.auth-context__brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: var(--auth-on-night);
  line-height: 1;
  text-decoration: none;
}

.auth-context__logo {
  display: block;
  width: auto;
  height: 44px;
  border-radius: var(--r-sm);
  transition: transform .32s var(--ease);
}

.auth-context__brand:hover .auth-context__logo {
  transform: translateY(-1px);
}

.auth-brand__product {
  padding-left: 14px;
  border-left: 1px solid var(--auth-line-strong);
  color: var(--auth-muted-night);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-style: normal;
  font-weight: 600;
  letter-spacing: .15em;
}

.auth-context__copy {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  margin-top: clamp(70px, 13vh, 130px);
}

.auth-head__kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: var(--signal-azure-deep);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-head__kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  margin-right: 9px;
  background: currentColor;
}

.auth-context h1 {
  max-width: 11ch;
  margin: 16px 0 18px;
  color: var(--auth-on-night);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.8vw, 4.6rem);
  font-weight: var(--weight-bold);
  letter-spacing: -.045em;
  line-height: .96;
}

.auth-context__copy p {
  max-width: 39ch;
  margin: 0;
  color: var(--auth-muted-night);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  letter-spacing: .005em;
  line-height: var(--leading-reading);
}

/* ---- Functional panel ------------------------------------------------ */

.auth-panel {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 1px solid var(--border-hairline);
  background: var(--surface);
}

.auth-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-right: max(clamp(var(--space-lg), 4vw, var(--space-2xl)), env(safe-area-inset-right, 0px));
  padding-left: max(clamp(var(--space-lg), 4vw, var(--space-2xl)), env(safe-area-inset-left, 0px));
}

.auth-panel__top {
  min-height: 72px;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border-hairline);
  background: color-mix(in oklch, var(--signal-azure-soft) 18%, var(--surface));
}

.auth-panel__product {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: var(--text-caption);
  font-weight: 600;
}

.auth-panel__product > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.auth-theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

/* Une seule icone visible, pilotee par l'etat deja porte par le bouton.
   `hidden` serait sans effet ici : l'attribut ne s'applique pas au SVG. */
.auth-theme-toggle[aria-pressed="false"] [data-theme-icon="sun"],
.auth-theme-toggle[aria-pressed="true"] [data-theme-icon="moon"] {
  display: none;
}

.auth-theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink-strong);
  transform: translateY(-1px);
}

.auth-panel__body {
  width: 100%;
  display: grid;
  place-items: center;
  padding: clamp(var(--space-xl), 6vw, 70px) clamp(var(--space-lg), 6vw, var(--space-3xl));
  padding-right: max(clamp(var(--space-lg), 6vw, var(--space-3xl)), env(safe-area-inset-right, 0px));
  padding-left: max(clamp(var(--space-lg), 6vw, var(--space-3xl)), env(safe-area-inset-left, 0px));
}

/* ---- Form content ----------------------------------------------------- */

.auth-card {
  width: min(100%, 480px);
}

.auth-head {
  margin-bottom: var(--space-xl);
}

.auth-head__icon,
.auth-result {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--signal-azure) 22%, var(--border-hairline));
  border-radius: var(--r-lg);
  background: var(--signal-azure-soft);
  color: var(--signal-azure-deep);
  font-size: var(--text-heading);
}

.auth-title {
  margin: 8px 0 9px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: var(--weight-bold);
  letter-spacing: -.035em;
  line-height: 1.08;
}

.auth-head > .auth-title:first-child {
  margin-top: 0;
}

.auth-sub,
.auth-message-note {
  color: var(--ink-muted);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.auth-sub {
  max-width: 44ch;
  margin: 0;
}

.auth-sub strong {
  color: var(--ink-default);
  overflow-wrap: anywhere;
}

.auth-card--message {
  text-align: center;
}

.auth-card--message .auth-result {
  margin-inline: auto;
}

.auth-result {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: var(--text-data);
}

.auth-result--success {
  border-color: color-mix(in srgb, var(--green) 28%, var(--border-hairline));
  background: var(--green-soft);
  color: var(--green-text);
}

.auth-message-note {
  max-width: 40ch;
  margin: -8px auto 28px;
}

.auth-action-form {
  margin: 0;
}

.auth-secondary {
  max-width: 42ch;
  margin: 18px auto 0;
  color: var(--ink-muted);
  font-size: var(--text-meta);
  line-height: var(--leading-ui);
}

/* ---- Fields ----------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}

.field-label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--ink-default);
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
}

.field-input {
  position: relative;
}

.field-input input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 43px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  outline: none;
  background: var(--surface);
  color: var(--ink-strong);
  font: inherit;
  font-size: var(--text-body);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.field-input input:hover {
  border-color: color-mix(in srgb, var(--signal-azure) 38%, var(--border-strong));
}

.field-input input:focus {
  border-color: var(--signal-azure);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--signal-azure-soft);
}

.auth-page .field-input input:-webkit-autofill,
.auth-page .field-input input:-webkit-autofill:hover,
.auth-page .field-input input:-webkit-autofill:focus,
.auth-page .field-input input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink-strong);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink-strong);
}

.auth-page .field-input input:-webkit-autofill:focus {
  border-color: var(--signal-azure);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 3px var(--signal-azure-soft);
  box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 3px var(--signal-azure-soft);
}

.field-input input::placeholder {
  color: color-mix(in srgb, var(--ink-muted) 78%, transparent);
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--ink-muted);
  font-size: var(--text-section);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color var(--dur-fast) var(--ease);
}

.field-input input:focus ~ .field-icon {
  color: var(--signal-azure);
}

.pwd-toggle,
.password-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.pwd-toggle:hover,
.password-toggle:hover {
  background: var(--surface-sunken);
  color: var(--ink-strong);
}

.field-foot,
.forgot-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 20px;
}

.forgot-actions {
  justify-content: center;
  margin: 18px 0 0;
}

.auth-link-button,
.link-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--signal-azure-deep);
  font: inherit;
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
}

.auth-link-button:hover,
.link-back:hover {
  color: var(--signal-azure);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-back {
  width: fit-content;
  margin: 20px auto 0;
}

.btn-submit {
  position: relative;
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid var(--action-fill);
  border-radius: var(--r-md);
  background: var(--action-fill);
  color: var(--on-action);
  box-shadow: 0 5px 12px color-mix(in oklch, var(--action-fill) 12%, transparent);
  font: inherit;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.btn-submit:hover {
  border-color: var(--action-fill-hover);
  background: var(--action-fill-hover);
  color: var(--on-action);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--action-fill) 25%, transparent);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: .58;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.spin {
  position: absolute;
  width: 18px;
  height: 18px;
  display: none;
  border: 2px solid color-mix(in srgb, var(--on-azure) 32%, transparent);
  border-top-color: var(--on-azure);
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

.btn-submit.loading .btn-label,
.btn-submit.loading .btn-ic {
  opacity: 0;
}

.btn-submit.loading .spin {
  display: block;
}

.btn-submit.is-success {
  border-color: var(--green-text);
  background: var(--green-text);
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ---- Feedback --------------------------------------------------------- */

.auth-alerts:has(> .alert) {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-card .alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--text-control);
  line-height: var(--leading-ui);
}

.auth-card .alert i {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: var(--text-body);
}

.auth-card .alert-error,
.auth-card .alert-danger {
  border-color: color-mix(in srgb, var(--red) 24%, var(--border-hairline));
  background: var(--red-soft);
  color: var(--red-text);
}

.auth-card .alert-success {
  border-color: color-mix(in srgb, var(--green) 24%, var(--border-hairline));
  background: var(--green-soft);
  color: var(--green-text);
}

.auth-card.shake {
  animation: auth-invalid 220ms ease-out 1;
}

@keyframes auth-invalid {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

.auth-is-hidden {
  display: none !important;
}

.auth-switch {
  animation: auth-switch-in var(--dur-base) var(--ease) both;
}

@keyframes auth-switch-in {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

/* ---- Password guidance ------------------------------------------------ */

.password-rules {
  margin: 2px 0 22px;
  padding: 13px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

.password-rules__track {
  height: 3px;
  margin-bottom: 11px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--border-strong);
}

.password-rules__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--signal-azure);
  transition: width var(--dur-base) var(--ease), background var(--dur-fast) var(--ease);
}

.password-rules__track span.is-complete {
  background: var(--green);
}

.password-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: var(--text-caption);
}

.password-rules li.is-valid {
  color: var(--green-text);
}

.password-rules li.is-valid i::before {
  content: "\F012C";
}

/* ---- OTP -------------------------------------------------------------- */

.auth-card--otp .auth-head {
  text-align: left;
}

.otp-timer {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -8px 0 18px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
}

.otp-timer__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.otp-timer.is-critical {
  color: var(--red-text);
}

.otp-timer.is-critical .otp-timer__dot {
  background: var(--red);
}

.otp-fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 12px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.otp-box {
  min-width: 0;
  width: 100%;
  height: 58px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  outline: none;
  background: var(--surface-sunken);
  color: var(--ink-strong);
  font-family: var(--font-mono);
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  text-align: center;
  caret-color: var(--signal-azure);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.otp-box:hover {
  border-color: color-mix(in srgb, var(--signal-azure) 38%, var(--border-strong));
}

.otp-box:focus {
  border-color: var(--signal-azure);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--signal-azure-soft);
  transform: translateY(-1px);
}

.otp-box.filled {
  border-color: color-mix(in srgb, var(--signal-azure) 55%, var(--border-strong));
  background: var(--signal-azure-soft);
}

.otp-separator {
  width: 8px;
  height: 1px;
  justify-self: center;
  background: var(--border-strong);
}

/* ---- Keyboard focus --------------------------------------------------- */

.auth-page :is(a, button):focus-visible {
  outline: 2px solid var(--signal-azure);
  outline-offset: 3px;
  box-shadow: none;
}

.auth-page .btn-submit:focus-visible {
  outline-color: color-mix(in srgb, var(--signal-azure) 50%, white);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--signal-azure);
}

/* ---- Responsive ------------------------------------------------------- */

@media (max-width: 960px) {
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .auth-context {
    min-height: clamp(340px, 42vh, 460px);
    min-height: clamp(340px, 42dvh, 460px);
    padding: var(--space-xl);
  }

  .auth-context__copy {
    max-width: 26rem;
    margin-top: 50px;
  }

  .auth-context h1 {
    max-width: 13ch;
    font-size: clamp(2.3rem, 8vw, 3.3rem);
  }

  .auth-context__copy p {
    max-width: 34ch;
  }

  .auth-panel__body {
    min-height: auto;
  }

  .auth-panel {
    min-height: 58vh;
    min-height: 58dvh;
    border-top: 1px solid var(--border-hairline);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .auth-context {
    min-height: clamp(300px, 43vh, 380px);
    min-height: clamp(300px, 43dvh, 380px);
    padding-top: max(var(--space-lg), env(safe-area-inset-top, 0px));
    padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
  }

  .auth-context::before {
    inset: 0;
  }

  .auth-context__copy {
    margin-top: 36px;
  }

  .auth-context h1 {
    max-width: 15ch;
    margin-block: 10px 0;
    font-size: clamp(2rem, 10vw, 2.7rem);
  }

  .auth-context__copy p {
    display: none;
  }

  .auth-panel__top {
    padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
    padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
  }

  .auth-panel__body {
    min-height: auto;
    place-items: start stretch;
    padding-top: var(--space-2xl);
    padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
    padding-bottom: var(--space-2xl);
    padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
  }

  .auth-card {
    width: 100%;
    max-width: 500px;
    margin-inline: auto;
  }

}

@media (max-width: 430px) {
  .auth-context {
    min-height: 300px;
  }

  .auth-context__copy {
    margin-top: 30px;
  }

  .auth-context h1 {
    font-size: 2rem;
  }

  .auth-brand__product {
    display: none;
  }

  .password-rules ul {
    grid-template-columns: 1fr;
  }

  .auth-panel__body {
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
  }

  .otp-boxes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }

  .otp-separator {
    display: none;
  }

  .otp-box {
    height: 52px;
    border-radius: var(--r-sm);
    font-size: var(--text-section);
  }
}

/* Landscape rules follow the width rules so short viewports win the cascade. */
@media (min-width: 560px) and (max-width: 960px) and (max-height: 600px) and (orientation: landscape) {
  .auth-shell {
    grid-template-columns: minmax(200px, .65fr) minmax(340px, 1.35fr);
    overflow: hidden;
  }

  .auth-context,
  .auth-panel {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-context {
    padding-top: max(18px, env(safe-area-inset-top, 0px));
    padding-right: 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px));
  }

  .auth-context__copy {
    margin-top: clamp(24px, 8vh, 46px);
  }

  .auth-context h1 {
    max-width: 10ch;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
  }

  .auth-context__copy p {
    display: none;
  }

  .auth-panel {
    border-top: 0;
    border-left: 1px solid var(--border-hairline);
  }

  .auth-panel__top {
    min-height: 60px;
  }

  .auth-panel__body {
    min-height: 0;
    place-items: center;
    padding-top: 18px;
    padding-right: max(24px, env(safe-area-inset-right, 0px));
    padding-bottom: 18px;
    padding-left: 24px;
    overflow-y: auto;
  }

}

@media (max-width: 559px) and (max-height: 480px) and (orientation: landscape) {
  .auth-context {
    min-height: 104px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: 14px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }

  .auth-context__copy,
  .auth-sub {
    display: none;
  }

  .auth-panel {
    min-height: calc(100vh - 104px);
    min-height: calc(100dvh - 104px);
  }

  .auth-panel__top {
    min-height: 52px;
  }

  .auth-panel__body {
    min-height: 0;
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-switch,
  .auth-card.shake,
  .spin {
    animation: none !important;
  }

  .auth-page :is(a, button, input),
  .password-rules__track span {
    transition: none !important;
  }

  .auth-context__logo {
    transform: none !important;
    transition: none !important;
  }
}
