:root {
  color-scheme: light;
  --auth-panel-width: 46%;
}

html,
body {
  min-height: 100%;
}

body {
  min-width: 320px;
  background: var(--zpd-bg-surface);
}

button,
input {
  font: inherit;
}

input.zpd-input {
  font-size: 16px;
}

.auth-skip {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 20;
  padding: 8px 12px;
  color: var(--zpd-text-on-inverse);
  background: var(--zpd-bg-inverse);
  border-radius: var(--zpd-radius-md);
  transform: translateY(-150%);
}

.auth-skip:focus {
  transform: translateY(0);
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(340px, var(--auth-panel-width)) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-aside {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 100dvh;
  padding: clamp(28px, 5vw, 64px);
  color: var(--zpd-text-on-inverse);
  background: var(--zpd-bg-inverse) url("../images/auth-bg--54xnXN.jpg") center / cover;
}

.auth-aside::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--zpd-bg-inverse) 94%, transparent), color-mix(in srgb, var(--zpd-bg-inverse) 66%, transparent));
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.auth-brand img {
  width: 150px;
  filter: invert(1);
}

.auth-brand:hover {
  color: inherit;
}

.auth-brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--zpd-color-forest-800);
  background: var(--zpd-color-leaf-100);
  border-radius: var(--zpd-radius-lg);
}

.auth-brand__mark .lucide {
  width: 23px;
  height: 23px;
}

.auth-brand__name,
.auth-brand__product {
  display: block;
}

.auth-brand__name {
  font-family: var(--zpd-font-display);
  font-size: 19px;
  font-weight: var(--zpd-font-weight-extrabold);
  letter-spacing: -.02em;
}

.auth-brand__product {
  margin-top: 1px;
  font-size: 11px;
  font-weight: var(--zpd-font-weight-semibold);
  letter-spacing: .08em;
  opacity: .72;
  text-transform: uppercase;
}

.auth-aside__content {
  max-width: 510px;
  padding-block: 60px;
}

.auth-aside__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: var(--zpd-font-weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-aside__eyebrow .lucide {
  width: 16px;
  height: 16px;
}

.auth-aside h2 {
  max-width: 480px;
  color: #FFF;
  font-family: var(--zpd-font-display);
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.auth-aside__text {
  max-width: 460px;
  margin-top: 22px;
  color: color-mix(in srgb, var(--zpd-text-on-inverse) 78%, transparent);
  font-size: 16px;
  line-height: 1.7;
}

.auth-aside__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  opacity: .72;
}

.auth-aside__footer .lucide {
  width: 15px;
  height: 15px;
}

.auth-main {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  padding: clamp(28px, 5vw, 72px);
  background: var(--zpd-bg-surface); /* var(--zpd-bg-page); */
}

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

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

.auth-mobile-brand {
  display: none;
  margin-bottom: 40px;
  color: var(--zpd-text-heading);
}

.auth-mobile-brand:hover {
  color: var(--zpd-text-heading);
}

.auth-mobile-brand img {
  filter: none;
}

.auth-eyebrow {
  margin-bottom: 10px;
  color: var(--zpd-text-accent);
  font-size: 12px;
  font-weight: var(--zpd-font-weight-bold);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.auth-title {
  color: var(--zpd-text-heading);
  font-family: var(--zpd-font-display);
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.14;
  letter-spacing: -.035em;
}

.auth-lead {
  margin-top: 12px;
  color: var(--zpd-text-secondary);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.auth-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-field--full {
  grid-column: 1 / -1;
}

.auth-password-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--zpd-text-muted);
  border-radius: var(--zpd-radius-sm);
}

.auth-password-toggle:hover {
  color: var(--zpd-text-heading);
  background: var(--zpd-bg-surface);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--zpd-action-accent);
  outline-offset: 1px;
}

.auth-password-toggle .lucide {
  width: 18px;
  height: 18px;
}

.auth-form-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-link {
  color: var(--zpd-text-accent);
  font-size: 14px;
  font-weight: var(--zpd-font-weight-semibold);
  text-underline-offset: 3px;
  display: flex;
  justify-content: start;
  gap: 10px;
  align-items: end;
  text-decoration: none;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  min-height: 46px;
}

.auth-forgot {
  margin-top: 4px;
  text-align: center;
}

.auth-forgot .auth-link {
  justify-content: center;
}

.auth-switch {
  margin-top: 28px;
  color: var(--zpd-text-secondary);
  font-size: 14px;
  text-align: center;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
}

.auth-legal {
  margin-top: 34px;
  color: var(--zpd-text-muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.auth-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 10px;
}

.auth-otp .zpd-input {
  height: 56px;
  padding: 0;
  color: var(--zpd-text-heading);
  font-family: var(--zpd-font-display);
  font-size: 24px;
  font-weight: var(--zpd-font-weight-bold);
  text-align: center;
}

.auth-code-hint {
  color: var(--zpd-text-secondary);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.auth-sr-status:not(:empty) {
  display: block;
  margin-top: 8px;
  color: var(--zpd-text-muted);
}

.auth-resend {
  color: var(--zpd-text-accent);
  font-weight: var(--zpd-font-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-resend:disabled {
  color: var(--zpd-text-muted);
  cursor: wait;
}

.auth-alert {
  margin-top: 26px;
}

.auth-status {
  text-align: center;
}


.auth-status__code {
  display: block;
  margin-bottom: 8px;
  color: var(--zpd-text-accent);
  font-family: var(--zpd-font-display);
  font-size: 14px;
  font-weight: var(--zpd-font-weight-bold);
  letter-spacing: .12em;
}

.auth-status .auth-lead {
  max-width: 440px;
  margin-inline: auto;
}

.auth-status__actions {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.auth-status__actions .zpd-btn {
  justify-content: center;
  min-height: 44px;
}

.auth-status__actions--row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.auth-status__actions--row form {
  flex: 1 1 0;
}

.auth-alert.zpd-alert--note {
  align-items: center;
}

.auth-support {
  margin-top: 28px;
  color: var(--zpd-text-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 860px) {
  .auth-page {
    display: flex;
    flex-direction: column;
  }

  /*
   * Na wąskim ekranie kolumna boczna zamienia się w hero na górze: pas ze
   * zdjęciem, w nim logo i zajawka. Wysokość trzymamy w `svh`, żeby pasek
   * adresu przeglądarki nie zjadał hero przy starcie.
   */
  .auth-aside {
    align-items: center;
    justify-content: flex-end;
    min-height: 0;
    height: clamp(210px, 34svh, 300px);
    padding: 24px 20px 30px;
    text-align: center;
  }

  .auth-aside::before {
    /* pionowy gradient: ciemniej u dołu, żeby tekst odcinał się od karty */
    background: linear-gradient(180deg, color-mix(in srgb, var(--zpd-bg-inverse) 62%, transparent), color-mix(in srgb, var(--zpd-bg-inverse) 90%, transparent));
  }

  .auth-aside .auth-brand {
    position: absolute;
    top: 24px;
    left: 50%;
    translate: -50% 0;
  }

  .auth-aside .auth-brand img {
    width: 124px;
  }

  /* treść hero trzyma się środka i nie rozjeżdża się na szerokość tabletu */
  .auth-aside__content {
    max-width: 30rem;
    margin-inline: auto;
    padding-block: 0;
  }

  .auth-aside__eyebrow {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .auth-aside h2 {
    max-width: none;
    font-size: clamp(24px, 6.4vw, 32px);
    line-height: 1.12;
  }

  /* opis i stopka nie mieszczą się w pasie hero — zostaje sam nagłówek */
  .auth-aside__text,
  .auth-aside__footer {
    display: none;
  }

  /* karta nachodzi na hero zaokrąglonym rogiem */
  .auth-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    /* `align-items` zamiast `justify-items` — w flexie karta inaczej rozciąga się na całą szerokość */
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    padding-block: 36px 48px;
    border-radius: var(--zpd-radius-xl, 22px) var(--zpd-radius-xl, 22px) 0 0;
  }

  /* logo jest już w hero, więc zapasowe z karty jest zbędne */
  .auth-mobile-brand {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-main {
    padding-inline: 20px;
  }

  .auth-form-grid {
    grid-template-columns: 1fr;
  }

  .auth-field--full {
    grid-column: auto;
  }

  .auth-form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .auth-status__actions--row {
    flex-direction: column;
  }

  .auth-otp {
    gap: 6px;
  }

  .auth-otp .zpd-input {
    height: 50px;
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
