/* ==========================================================================
   WP-KORE CUBE CSS — AUTH GATE (guest-state messaging component)
   Inline card that replaces a member-only form/panel for unauthenticated
   visitors. Copy SSOT: generated/parts/auth-gates/COPY.md
   ========================================================================== */

.auth-gate {
  --local-gate-bg: var(--surface);
  --local-gate-border: var(--border-width) solid var(--surface-border);
  --local-gate-radius: var(--radius-card);
  --local-gate-pad: var(--space-lg);
  --local-gate-shadow: var(--shadow-sm);
  --local-gate-gap: var(--space-sm);
  --local-gate-title-color: var(--text-main);
  --local-gate-body-color: var(--text-muted);

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--local-gate-gap);
  box-sizing: border-box;
  width: 100%;
  padding: var(--local-gate-pad);
  background-color: var(--local-gate-bg);
  border: var(--local-gate-border);
  border-radius: var(--local-gate-radius);
  box-shadow: var(--local-gate-shadow);
}

.auth-gate__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: var(--space-3xs) var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--brand);
  background-color: var(--surface-elevated);
  border: var(--border-width) solid var(--surface-border);
  border-radius: calc(var(--radius-brand) * 0.5);
  line-height: 1;
}

.auth-gate__title {
  margin: 0;
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  color: var(--local-gate-title-color);
}

.auth-gate__body {
  margin: 0;
  font-size: var(--font-size-body);
  line-height: var(--leading-normal);
  color: var(--local-gate-body-color);
  max-width: 42rem;
}

.auth-gate__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-block-start: var(--space-3xs);
}

.auth-gate__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-sm);
  color: var(--local-gate-body-color);
}

.auth-gate__features li {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.auth-gate__features li::before {
  content: "✓";
  color: var(--brand);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}

/* Centered variant (dashboard guest hero, empty states) */
.auth-gate--center {
  align-items: center;
  text-align: center;
}

.auth-gate--center .auth-gate__body {
  margin-inline: auto;
}

.auth-gate--center .auth-gate__actions {
  justify-content: center;
}

.auth-gate--center .auth-gate__features {
  align-items: center;
}

/* Compact variant (inline replacing a small form area) */
.auth-gate--compact {
  --local-gate-pad: var(--space-md);
  --local-gate-gap: var(--space-xs);
}

.auth-gate--compact .auth-gate__title {
  font-size: var(--font-size-body);
}

/* Inverse variant (inside .bg-dark stages) */
:is(.bg-dark, [data-intent="inverse"], .stage-dark, .surface-inverse) .auth-gate,
.auth-gate.bg-dark,
.auth-gate--inverse {
  --local-gate-bg: var(--bg-dark-surface);
  --local-gate-border: var(--border-width) solid var(--bg-dark-border);
  --local-gate-title-color: var(--bg-dark-on);
  --local-gate-body-color: var(--bg-dark-on-muted);
  --local-gate-shadow: none;
}

:is(.bg-dark, [data-intent="inverse"], .stage-dark, .surface-inverse) .auth-gate__badge,
.auth-gate.bg-dark .auth-gate__badge,
.auth-gate--inverse .auth-gate__badge {
  /* --brand-accent (Forest Sage) sits at ~33% L and collapses to 1.83:1 on
     Deep Olive Night. The dark-stage badge law requires .badge-inverse: light
     text on the frosted capsule. */
  color: var(--bg-dark-on);
  background-color: oklch(100% 0 0 / 8%);
  border-color: var(--bg-dark-border);
}

:is(.bg-dark, [data-intent="inverse"], .stage-dark, .surface-inverse) .auth-gate__actions .btn-outline,
.auth-gate.bg-dark .auth-gate__actions .btn-outline,
.auth-gate--inverse .auth-gate__actions .btn-outline {
  color: var(--bg-dark-on);
  border-color: var(--bg-dark-border);
}

:is(.bg-dark, [data-intent="inverse"], .stage-dark, .surface-inverse) .auth-gate__actions .btn-outline:hover,
.auth-gate.bg-dark .auth-gate__actions .btn-outline:hover,
.auth-gate--inverse .auth-gate__actions .btn-outline:hover {
  background-color: oklch(100% 0 0 / 10%);
  color: var(--white);
  border-color: var(--white);
}

:is(.bg-dark, [data-intent="inverse"], .stage-dark, .surface-inverse) .auth-gate__features li::before,
.auth-gate.bg-dark .auth-gate__features li::before,
.auth-gate--inverse .auth-gate__features li::before {
  color: var(--bg-dark-on);
}

/* Guest-sync toast strip (favorites/compare local success + sign-in nudge) */
.auth-gate-toast {
  --local-toast-bg: var(--surface-elevated);
  --local-toast-border: var(--border-width) solid var(--surface-border);

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--local-toast-bg);
  border: var(--local-toast-border);
  border-radius: calc(var(--radius-brand) * 0.5);
  font-size: var(--font-size-sm);
  color: var(--text-main);
}

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

.auth-gate-toast__text {
  margin: 0;
  color: var(--text-muted);
}

.auth-gate-toast__link {
  color: var(--brand);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  white-space: nowrap;
}

.auth-gate-toast__link:hover {
  color: var(--brand-hover);
}

/* Gated control tooltip (aria + visual) */
.auth-gate-tip {
  position: relative;
}

.auth-gate-tip::after {
  content: attr(data-auth-tip);
  position: absolute;
  bottom: calc(100% + var(--space-3xs));
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-3xs) var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.3;
  white-space: nowrap;
  color: var(--canvas-on);
  background-color: var(--text-main);
  border-radius: calc(var(--radius-brand) * 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion, 150ms) var(--ease-standard, ease);
  z-index: 10;
}

.auth-gate-tip:hover::after,
.auth-gate-tip:focus-visible::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate-toast__link,
  .auth-gate-tip::after,
  .auth-gate-inline__link {
    transition: none;
  }
}

/* ==========================================================================
   Inline Micro-Gate variant (replacing small form areas in reviews, questions, comments)
   ========================================================================== */

.auth-gate-inline {
  --local-inline-bg: var(--surface-subtle);
  --local-inline-border: var(--border-width) solid var(--surface-border);
  --local-inline-radius: var(--radius-control);
  --local-inline-pad: var(--space-xs) var(--space-sm);
  --local-inline-color: var(--text-muted);
  --local-inline-badge-bg: var(--surface-elevated);
  --local-inline-badge-color: var(--brand);
  --local-inline-badge-border: var(--border-width) solid var(--surface-border);
  --local-inline-link-color: var(--brand);
  --local-inline-link-hover: var(--brand-hover);

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  box-sizing: border-box;
  width: 100%;
  padding: var(--local-inline-pad);
  background-color: var(--local-inline-bg);
  border: var(--local-inline-border);
  border-radius: var(--local-inline-radius);
  font-size: var(--font-size-sm);
  line-height: var(--leading-normal);
  color: var(--local-inline-color);
}

.auth-gate-inline__content {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  flex-wrap: wrap;
}

.auth-gate-inline__badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3xs) var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--local-inline-badge-color);
  background-color: var(--local-inline-badge-bg);
  border: var(--local-inline-badge-border);
  border-radius: var(--radius-control);
  line-height: 1;
}

.auth-gate-inline__text {
  color: var(--local-inline-color);
}

.auth-gate-inline__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-inline-start: auto;
  white-space: nowrap;
}

.auth-gate-inline__link {
  color: var(--local-inline-link-color);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color var(--motion);
}

.auth-gate-inline__link:hover {
  color: var(--local-inline-link-hover);
}

.auth-gate-inline__link:focus-visible {
  outline: var(--border-width) solid var(--brand);
  outline-offset: 2px;
}

.auth-gate-inline__sep {
  color: var(--local-inline-color);
  user-select: none;
}

/* Dark-stage cadence for inline gate */
.bg-dark .auth-gate-inline,
.auth-gate-inline.bg-dark {
  --local-inline-bg: var(--bg-dark-surface);
  --local-inline-border: var(--border-width) solid var(--bg-dark-border);
  --local-inline-color: var(--bg-dark-on-muted);
  --local-inline-badge-bg: oklch(100% 0 0 / 8%);
  --local-inline-badge-color: var(--bg-dark-on);
  --local-inline-badge-border: var(--border-width) solid var(--bg-dark-border);
  --local-inline-link-color: var(--brand-on-dark);
  --local-inline-link-hover: var(--brand-accent-on-dark);
}

