.pd-auth-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  background: var(--pd-cream);
}

.pd-auth-page [hidden] {
  display: none !important;
}

.pd-auth-page .pd-site-header {
  min-height: 82px;
  border-bottom: 1px solid var(--pd-line);
}

.pd-auth-page .pd-brand {
  gap: 11px;
  text-decoration: none;
}

.pd-auth-page .pd-brand img {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  object-fit: cover;
}

.pd-brand-copy strong {
  display: block;
  color: var(--pd-petrol);
  font: 400 25px/1.05 'PT Serif', Georgia, serif;
}

.pd-brand-copy small {
  display: block;
  margin-top: 5px;
  color: var(--pd-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
}

.pd-auth-page .pd-site-actions a {
  color: var(--pd-petrol);
  text-decoration: none;
}

.pd-auth-layout {
  display: grid;
  width: min(1160px, calc(100% - 48px));
  min-height: min(680px, calc(100dvh - 150px));
  margin: 30px auto 38px;
  grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  align-items: center;
  gap: clamp(28px, 4.5vw, 64px);
}

.pd-auth-panel {
  width: 100%;
  max-width: 530px;
  min-width: 0;
  justify-self: center;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(6, 56, 60, .14);
  border-radius: 18px;
  background: var(--pd-paper);
  box-shadow: 0 20px 48px rgba(20, 40, 43, .08);
}

.pd-auth-panel h1 {
  margin: 5px 0 0;
  color: var(--pd-petrol);
  font: 400 clamp(34px, 4vw, 46px)/1.08 'PT Serif', Georgia, serif;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.pd-auth-lead {
  margin: 14px 0 18px;
  color: var(--pd-muted);
  font-size: 15px;
  line-height: 1.65;
}

.pd-auth-status {
  min-height: 22px;
  margin: 0 0 6px;
  color: var(--pd-muted);
  font-size: 13px;
}
.pd-auth-status:empty { display: none; }

.pd-auth-page .pd-alert {
  margin: 10px 0 14px;
  border-left-color: var(--pd-error);
  background: #f6e4e3;
  color: #70212b;
}

.pd-auth-providers {
  margin: 18px 0 0;
}

.pd-auth-provider-buttons {
  display: grid;
  gap: 8px;
}

.pd-auth-provider-buttons .pd-button {
  justify-content: center;
  min-height: 48px;
  border-radius: 6px;
  font-size: 14px;
}

.pd-auth-providers p {
  margin: 10px 0 14px;
  color: var(--pd-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pd-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--pd-muted);
  font-size: 12px;
}

.pd-auth-divider::before,
.pd-auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--pd-line);
}

.pd-auth-form {
  display: grid;
  gap: 15px;
  margin-top: 16px;
}

.pd-auth-form .pd-field,
.pd-auth-key-view,
.pd-auth-key-issued {
  min-width: 0;
}

.pd-auth-form .pd-field {
  min-width: 0;
  gap: 7px;
}

.pd-auth-form .pd-field label {
  color: var(--pd-ink);
  font-size: 14px;
  font-weight: 700;
}

.pd-auth-form .pd-field input {
  min-width: 0;
  min-height: 50px;
  border: 1px solid #a6b2aa;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--pd-ink);
}

.pd-auth-form .pd-field input[aria-invalid='true'] {
  border-color: var(--pd-error);
  box-shadow: 0 0 0 1px var(--pd-error);
}

.pd-auth-form .pd-field small {
  margin: 0;
  color: var(--pd-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pd-auth-form .pd-field .pd-auth-field-error {
  color: #70212b;
  font-weight: 700;
}

.pd-auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 3px;
  border-radius: 6px;
  font-size: 15px;
}

.pd-auth-form-note {
  margin: -4px 0 0;
  color: var(--pd-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pd-auth-switch {
  margin: 18px 0 0;
  color: var(--pd-muted);
  font-size: 14px;
  text-align: center;
}

.pd-auth-switch a {
  color: var(--pd-petrol);
  font-weight: 800;
  text-underline-offset: 3px;
}

.pd-auth-recover-link,
.pd-auth-return {
  margin: 14px 0 0;
  color: var(--pd-muted);
  font-size: 14px;
  text-align: center;
}

.pd-auth-recover-link a,
.pd-auth-return a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: var(--pd-petrol);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pd-auth-key-view h1 {
  margin: 4px 0 0;
  color: var(--pd-petrol);
  font: 400 clamp(28px, 4vw, 38px)/1.12 'PT Serif', Georgia, serif;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.pd-auth-key-status {
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--pd-muted);
  font-size: 14px;
  line-height: 1.55;
}

.pd-auth-key-warning,
.pd-auth-key-skip-note {
  margin: 10px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--pd-brass);
  background: #f7f0df;
  color: var(--pd-ink);
  font-size: 13px;
  line-height: 1.55;
}

.pd-auth-key-issued {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--pd-line);
  border-radius: 8px;
  background: #f8f4e9;
  color: var(--pd-ink);
}

.pd-auth-key-issued h3,
.pd-auth-key-issued p {
  margin: 0;
}

.pd-auth-key-issued h3 {
  color: var(--pd-petrol);
  font: 400 22px/1.2 'PT Serif', Georgia, serif;
}

.pd-auth-key-issued p {
  color: var(--pd-muted);
  font-size: 13px;
  line-height: 1.55;
}

.pd-auth-key-login strong {
  color: var(--pd-ink);
  overflow-wrap: anywhere;
}

.pd-auth-key-code {
  display: block;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--pd-line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--pd-ink);
  font: 700 15px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.pd-auth-copy-helper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.pd-auth-key-issued .pd-button,
.pd-auth-key-actions .pd-button {
  width: 100%;
  min-height: 48px;
  white-space: normal;
}

.pd-auth-key-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pd-auth-page .pd-auth-panel :focus-visible {
  outline: 3px solid var(--pd-petrol);
  outline-offset: 3px;
}

.pd-auth-art {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 590px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 34px clamp(22px, 4vw, 48px) 30px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 28%, rgba(198, 166, 101, .16), transparent 38%), linear-gradient(152deg, #10494d 0%, var(--pd-petrol) 52%, #032d31 100%);
  color: var(--pd-cream);
  isolation: isolate;
}

.pd-auth-art::before {
  position: absolute;
  z-index: -1;
  right: 12%;
  bottom: -4px;
  left: 12%;
  height: 79%;
  border: 1px solid rgba(198, 166, 101, .48);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 32% 32% 0 0;
  content: '';
}

.pd-auth-art::after {
  position: absolute;
  top: 19%;
  left: 9%;
  color: var(--pd-brass);
  content: '✦';
  font-size: 24px;
}

.pd-auth-art-eyebrow {
  z-index: 1;
  margin: 0;
  color: #e0c88f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
}

.pd-auth-art img {
  z-index: 1;
  display: block;
  width: min(100%, 500px);
  max-height: 470px;
  margin: 6px auto -2px;
  object-fit: contain;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, .23));
}

.pd-auth-art figcaption {
  z-index: 1;
  display: grid;
  max-width: 360px;
  gap: 7px;
  color: var(--pd-cream);
  text-align: center;
}

.pd-auth-art figcaption strong {
  font: 400 27px/1.2 'PT Serif', Georgia, serif;
}

.pd-auth-art figcaption span {
  color: #e1e7df;
  font-size: 13px;
  line-height: 1.6;
}

.pd-auth-page .pd-public-footer {
  margin-top: auto;
  border-top: 1px solid var(--pd-line);
  color: var(--pd-muted);
}

.pd-auth-page .pd-public-footer a {
  color: var(--pd-petrol);
  text-decoration: none;
}

.pd-auth-noscript {
  position: fixed;
  z-index: 100;
  right: 12px;
  bottom: 12px;
  left: 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: auto;
  padding: 12px 16px;
  border: 1px solid var(--pd-line);
  border-radius: 8px;
  background: var(--pd-paper);
  color: var(--pd-ink);
  box-shadow: 0 8px 24px rgba(20, 40, 43, .16);
  text-align: center;
}

@media (max-width: 860px) {
  .pd-auth-layout {
    width: min(640px, calc(100% - 32px));
    min-height: 0;
    margin: 22px auto 30px;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .pd-auth-panel {
    max-width: none;
    padding: clamp(24px, 6vw, 38px);
  }

  .pd-auth-art {
    min-height: 350px;
    padding: 24px 22px 20px;
  }

  .pd-auth-art img {
    width: min(80%, 360px);
    max-height: 290px;
    margin: 8px auto -2px;
  }

  .pd-auth-art::before {
    right: 19%;
    left: 19%;
    height: 76%;
  }
}

@media (max-width: 540px) {
  .pd-auth-page .pd-site-header,
  .pd-auth-page .pd-public-footer {
    width: calc(100% - 32px);
  }

  .pd-auth-page .pd-site-header {
    min-height: 68px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .pd-auth-page .pd-brand img {
    width: 40px;
    height: 40px;
  }

  .pd-brand-copy strong {
    font-size: 22px;
  }

  .pd-brand-copy small {
    font-size: 8px;
  }

  .pd-auth-layout {
    width: calc(100% - 32px);
    margin-top: 16px;
    gap: 14px;
  }

  .pd-auth-panel {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .pd-auth-panel h1 {
    font-size: clamp(34px, 9vw, 40px);
  }

  .pd-auth-lead {
    font-size: 14px;
  }

  .pd-auth-art {
    min-height: 310px;
    border-radius: 14px;
  }

  .pd-auth-art img {
    width: min(82%, 300px);
    max-height: 240px;
  }

  .pd-auth-art figcaption strong {
    font-size: 24px;
  }

  .pd-auth-page .pd-public-footer {
    min-height: 60px;
    gap: 10px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .pd-auth-page .pd-site-actions a {
    padding-inline: 7px;
    font-size: 11px;
  }

  .pd-brand-copy small {
    letter-spacing: .1em;
  }

  .pd-auth-panel {
    padding-inline: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-auth-page *,
  .pd-auth-page *::before,
  .pd-auth-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body[data-auth-surface="admin"] .pd-auth-page .pd-site-actions,
body[data-auth-surface="timer"] .pd-auth-page .pd-site-actions,
body[data-auth-surface="admin"] .pd-auth-page .pd-auth-art,
body[data-auth-surface="timer"] .pd-auth-page .pd-auth-art,
body[data-auth-surface="admin"] .pd-auth-page .pd-public-footer,
body[data-auth-surface="timer"] .pd-auth-page .pd-public-footer {
  display: none !important;
}

body[data-auth-surface="admin"] .pd-auth-layout,
body[data-auth-surface="timer"] .pd-auth-layout {
  width: min(560px, calc(100% - 32px));
  min-height: auto;
  margin: clamp(28px, 8vh, 72px) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

body[data-auth-surface="admin"] .pd-auth-panel,
body[data-auth-surface="timer"] .pd-auth-panel {
  max-width: 560px;
}
