/**
 * auth.css — protected-preview splash + sign-in gate.
 *
 * Loaded render-blocking from <head> (index.html) so #auth-gate is fully
 * styled the instant scripts/auth-gate-shell-inline.js reveals it. If this
 * file is empty the gate paints as raw, unstyled HTML for a frame (FOUC) —
 * which is unacceptable locally AND when published. Keep it populated.
 *
 * All colors/fonts come from the preboot token layer (pf-semantic-tokens.css
 * + the active pack tokens), which are also loaded render-blocking, so the
 * gate matches the site theme without waiting on JS-injected theme CSS.
 */

/* === OVERLAY === */
#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--color-overlay-scrim, rgba(13, 15, 24, 0.92));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  overflow-y: auto;
}

#auth-gate:has(.auth-template--vogue) {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: #0a0a0a;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate-stage {
  width: 100%;
  min-height: 100%;
}

/* Native [hidden] must win even though the id selector sets display:flex. */
#auth-gate[hidden] {
  display: none !important;
}

/* === SPLASH LAYOUT === */
.auth-splash {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  width: 100%;
  max-width: 1040px;
}

/* --- left: about --- */
.auth-splash__main {
  min-width: 0;
}

.auth-splash__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.auth-splash__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  color: var(--color-text-primary);
  margin: 0 0 1rem;
}

.auth-splash__lede {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

.auth-splash__highlights {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.auth-splash__highlights li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.auth-splash__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-accent);
}

.auth-splash__note {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 44ch;
}

/* --- right: sign-in card --- */
.auth-splash__aside {
  min-width: 0;
}

.auth-card {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--color-elevation-shadow, 0 24px 60px rgba(0, 0, 0, 0.45));
}

/* Squared password block — Vogue / editorial templates */
.auth-card--square {
  border-radius: 0;
  width: min(92vw, 300px);
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem 1.35rem 1.25rem;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  color: #111;
}

.auth-card--square .auth-card__heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: #111;
}

.auth-panel--square {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-panel--square .auth-input {
  margin-bottom: 0.65rem;
  min-height: 2.75rem;
  font-size: 1rem;
}

.auth-panel--square .auth-error {
  margin: 0 0 0.65rem;
  min-height: 1em;
}

.auth-card--square .auth-actions {
  margin-top: 0;
}

.auth-card--square .auth-btn--lead {
  min-height: 2.75rem;
}

.auth-template--vogue .auth-card--square {
  --color-text-primary: #111;
  --color-text-muted: #555;
  --color-text-secondary: #333;
  --color-bg: #f7f7f7;
  --color-border: #ccc;
  --color-border-hover: #999;
  --color-accent: #111;
  --color-accent-hover: #333;
  --color-accent-muted: rgba(0, 0, 0, 0.08);
  --color-on-accent: #fff;
  --color-nav-hover-bg: rgba(0, 0, 0, 0.05);
}

.auth-card--square .auth-input,
.auth-card--square .auth-btn {
  border-radius: 0;
}

.auth-card--square .auth-input:focus {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.auth-titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-titlebar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-accent-muted);
  color: var(--color-accent);
  font-size: 1.1rem;
}

.auth-titlebar__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0;
  color: var(--color-text-primary);
}

.auth-titlebar__rule {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.1rem 0 1.25rem;
}

/* === PANELS (login / contact) === */
.auth-panel {
  display: block;
}

.auth-panel[hidden] {
  display: none;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.auth-card label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.4rem;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  margin: 0 0 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border-hover);
  border-radius: 9px;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:last-of-type {
  margin-bottom: 0;
}

.auth-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.auth-input--area {
  resize: vertical;
  min-height: 5.5rem;
}

.auth-error {
  font-size: 0.82rem;
  color: var(--color-danger);
  min-height: 1.1em;
  margin: 0.5rem 0 0;
}

/* === ACTIONS === */
.auth-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.auth-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 9px;
  border: 1px solid var(--color-border-hover);
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.auth-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-nav-hover-bg);
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn--lead {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.auth-btn--lead:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Protected page content stays hidden until authenticated. */
#protected-content.hidden {
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 760px) {
  .auth-splash {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    max-width: 460px;
  }
}

.auth-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* === VOGUE EDITORIAL TEMPLATE === */
.auth-template--vogue .auth-vogue {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.auth-vogue__figure {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-vogue__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.auth-vogue__photo--clear {
  position: relative;
  z-index: 0;
}

.auth-vogue__figure--pending {
  opacity: 0;
}

.auth-vogue__figure--ready {
  opacity: 1;
  transition: opacity 0.12s ease;
}

.auth-vogue__figure--swapping .auth-vogue__photo--clear {
  opacity: 0;
}

/* Legacy blur layer — removed from markup; hide if stale HTML still has it */
.auth-vogue__photo--blurred {
  display: none !important;
}

.auth-vogue__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.12) 38%, rgba(0, 0, 0, 0.2) 62%, rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, transparent 62%);
  pointer-events: none;
}

.auth-vogue__editorial {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: clamp(1.5rem, 5vw, 3.25rem);
  padding-bottom: 1rem;
  max-width: min(54ch, 92vw);
  color: #fff;
}

.auth-vogue__editorial.auth-vogue__editorial--free-position {
  position: absolute;
  inset: 0;
  flex: 1 1 auto;
  align-self: stretch;
  max-width: none;
  padding: 0;
  pointer-events: none;
}

.auth-vogue__editorial--free-position .auth-vogue__name,
.auth-vogue__editorial--free-position .auth-vogue__title,
.auth-vogue__editorial--free-position .auth-vogue__education {
  position: absolute;
  margin: 0;
  pointer-events: auto;
  max-width: min(54ch, 92vw);
}

.auth-vogue__editorial--stacked {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0;
  max-width: min(54ch, 92vw);
  color: #fff;
  pointer-events: none;
}

.auth-vogue__editorial--stacked .auth-vogue__name,
.auth-vogue__editorial--stacked .auth-vogue__title,
.auth-vogue__editorial--stacked .auth-vogue__education {
  position: static;
  transform: none;
  margin: 0;
  pointer-events: auto;
  max-width: min(54ch, 92vw);
}

html:not([data-pf-harness-auth-gallery='1']) .auth-vogue__figure--shielded,
html:not([data-pf-harness-auth-gallery='1']) .auth-vogue__figure--shielded .auth-vogue__photo--clear {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.auth-vogue__name,
.auth-vogue__title,
.auth-vogue__education {
  transition: transform 0.12s ease;
}

html[data-pf-harness-auth-gallery='1'] .auth-vogue__name,
html[data-pf-harness-auth-gallery='1'] .auth-vogue__title,
html[data-pf-harness-auth-gallery='1'] .auth-vogue__education {
  cursor: pointer;
}

.auth-vogue__name.is-auth-text-selected,
.auth-vogue__title.is-auth-text-selected,
.auth-vogue__education.is-auth-text-selected,
.auth-vogue__name.is-auth-layout-selected,
.auth-vogue__title.is-auth-layout-selected,
.auth-vogue__education.is-auth-layout-selected {
  outline: 2px solid rgba(110, 168, 254, 0.95);
  outline-offset: 4px;
}

.auth-vogue__name {
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.auth-vogue__title {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  opacity: 0.96;
}

.auth-vogue__education {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  opacity: 0.9;
}

/* Typography sizes/fonts: SSOT content/auth-gate-editorial-layout.json → bake #pf-auth-gate-typography */

.auth-vogue__deck {
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
  line-height: 1.55;
  margin: 0 0 0.75rem;
  max-width: 42ch;
  opacity: 0.92;
}

.auth-vogue__note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.75;
}

.auth-vogue__gate {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: auto;
  align-self: flex-start;
  padding: clamp(1rem, 3vw, 2.5rem);
  padding-top: 0;
}

.auth-vogue--free-layout .auth-vogue__gate--positioned {
  position: absolute;
  margin-top: 0;
  align-self: auto;
  flex: none;
  z-index: 2;
  pointer-events: auto;
  padding: 0;
}

html[data-pf-harness-auth-gallery='1'] .auth-vogue__gate {
  cursor: pointer;
}

.auth-vogue__gate.is-auth-layout-selected {
  outline: 2px solid rgba(110, 168, 254, 0.95);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .auth-vogue__editorial {
    padding-bottom: 0.75rem;
  }

  .auth-vogue__gate {
    padding-top: 0;
    padding-bottom: clamp(1.25rem, 4vw, 2rem);
  }
}

#auth-gate.auth-vogue--local-preview .auth-vogue__photo--blurred,
html[data-pf-harness-auth-gallery='1'] .auth-vogue__photo--blurred {
  display: none !important;
}

html[data-pf-harness-auth-gallery='1'] #protected-content,
html[data-pf-harness-auth-gallery='1'] #pf-site-chrome,
html[data-pf-harness-auth-gallery='1'] #pf-app,
html[data-pf-harness-auth-gallery='1'] #rs-app {
  visibility: hidden !important;
  pointer-events: none !important;
}

#auth-gate.auth-vogue--local-preview .auth-vogue__photo--clear,
html[data-pf-harness-auth-gallery='1'] .auth-vogue__photo--clear {
  clip-path: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

#auth-gate-stage[data-pf-auth-baked='1'] .auth-vogue__name,
#auth-gate-stage[data-pf-auth-baked='1'] .auth-vogue__title,
#auth-gate-stage[data-pf-auth-baked='1'] .auth-vogue__education,
#auth-gate-stage[data-pf-auth-baked='1'] .auth-vogue__gate--positioned {
  transition: none;
}

#auth-gate-stage[data-pf-auth-baked='1'] .auth-vogue__photo--clear {
  transition: none;
}

.auth-gate-local-editor,
.auth-gate-gallery-picker {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  width: min(360px, 42vw);
  display: flex;
  flex-direction: column;
  background: rgba(8, 8, 10, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #f2f2f2;
}

.auth-gate-local-editor__header,
.auth-gate-gallery-picker__header {
  flex: 0 0 auto;
  padding: 0.85rem 0.9rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-gate-local-editor__title,
.auth-gate-gallery-picker__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-gate-local-editor__hint,
.auth-gate-gallery-picker__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.72;
}

.auth-gate-local-editor__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.auth-gate-local-editor__tab {
  flex: 1 1 auto;
  min-width: 4.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-gate-local-editor__tab.is-active {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.auth-gate-local-editor__fit-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-gate-fit-control {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
}

.auth-gate-fit-control select,
.auth-gate-fit-control input[type='range'] {
  width: 100%;
}

.auth-gate-fit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.auth-gate-local-editor__status {
  margin: 0.45rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  opacity: 0.85;
}

.auth-gate-local-editor__status[data-state='error'] {
  color: #ffb4b4;
}

.auth-gate-local-editor__index,
.auth-gate-gallery-picker__index {
  margin: 0.45rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
  word-break: break-all;
}

.auth-gate-local-editor__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-gate-local-editor__panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-gate-gallery-picker__list,
.auth-gate-local-editor .auth-gate-gallery-picker__list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.auth-gate-text-form,
.auth-gate-import-form,
.auth-gate-framing-help {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
}

.auth-gate-text-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.auth-gate-text-field input {
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
}

.auth-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-gate-btn--apply {
  border-color: rgba(180, 220, 255, 0.55);
  background: rgba(120, 170, 255, 0.22);
}

.auth-gate-btn--secondary {
  opacity: 0.9;
}

.auth-gate-import-label {
  width: fit-content;
  cursor: pointer;
}

.auth-gate-import-note {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.75;
  line-height: 1.4;
}

.auth-gate-gallery-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  width: 100%;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.auth-gate-gallery-item:hover,
.auth-gate-gallery-item.is-active {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.auth-gate-gallery-item__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.auth-gate-gallery-item__meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.auth-gate-gallery-item__name {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.35;
  word-break: break-all;
}

.auth-gate-gallery-item.is-applied {
  border-color: rgba(140, 190, 255, 0.65);
  box-shadow: inset 0 0 0 1px rgba(140, 190, 255, 0.35);
}

.auth-gate-gallery-item__check {
  display: none;
}

@media (max-width: 900px) {
  #auth-gate.auth-vogue--local-preview {
    padding-right: 0;
    padding-bottom: 48vh;
  }

  .auth-gate-local-editor,
  .auth-gate-gallery-picker {
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 46vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .auth-gate-gallery-picker__list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .auth-gate-gallery-item {
    flex: 0 0 220px;
    grid-template-columns: 64px minmax(0, 1fr);
  }
}
