/* One-shot auth demo pages (header / minimal / large) */
:root {
  --demo-header-h: 4.5rem;
  --demo-menu-h: 4.5rem;
  --kie-blue: #0050d7;
  --bg: #f4f6fb;
  --card: #fff;
  --text: #1a1f36;
  --muted: #5c6378;
  --border: #d8deea;
  --ok: #0a6b36;
}

body.auth-demo {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.auth-demo.shell-has-header {
  padding-top: calc(var(--site-header-h) + var(--demo-header-h));
}

body.auth-demo.auth-demo--large.shell-has-header,
body.auth-demo.auth-demo--rounded.shell-has-header {
  padding-top: var(--site-header-h);
}

body.auth-demo.auth-demo--minimal.shell-has-header {
  padding-top: calc(var(--site-header-h) + var(--demo-menu-h));
}

[hidden] { display: none !important; }

.demo-site-header {
  position: fixed;
  top: var(--site-header-h);
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--demo-header-h);
  box-sizing: border-box;
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.demo-brand img {
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.demo-brand .demo-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.demo-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: visible;
}

.demo-auth-slot {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 4.5rem;
  min-height: 2.25rem;
  overflow: visible;
}

/* Demo only: show integrators where their empty mount div goes */
body.auth-demo .demo-mount-hint {
  box-sizing: border-box;
  border: 1px dashed #c52828;
  border-radius: 4px;
}

.demo-auth .status {
  font-size: 0.875rem;
  color: var(--muted);
}

.demo-auth .entry-link,
.demo-auth .logout {
  font-size: 0.875rem;
  color: var(--kie-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.demo-session {
  position: fixed;
  top: calc(var(--site-header-h) + 0.75rem);
  right: 1.5rem;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.demo-session .status,
.demo-session .entry-link,
.demo-session .logout {
  font-size: 0.875rem;
  color: var(--kie-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.demo-session .status {
  color: var(--muted);
}

.demo-minimal-slot {
  position: relative;
  overflow: visible;
}

.demo-menu-example {
  position: fixed;
  top: var(--site-header-h);
  left: 0;
  right: 0;
  z-index: 999;
  min-height: var(--demo-menu-h);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.35rem;
  background: var(--bg);
  box-sizing: border-box;
}

.demo-large-slot {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.demo-large-slot.kie-la-auth-off { display: none !important; }

.demo-main {
  min-height: calc(100vh - var(--site-header-h));
}

body.auth-demo--header .demo-main {
  min-height: calc(100vh - var(--site-header-h) - var(--demo-header-h));
}

#splash,
#home {
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.demo-intro {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.demo-intro--private {
  color: var(--ok);
  white-space: normal;
  font-size: 1.25rem;
}

.demo-hint {
  margin: 1rem 0 0;
  max-width: 32rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

.demo-back {
  margin: 0;
  font-size: 0.9375rem;
}

.demo-site-header .demo-back {
  margin-left: 0.5rem;
}

.demo-back a {
  color: var(--kie-blue);
  text-decoration: none;
}

.demo-back a:hover {
  text-decoration: underline;
}

.demo-back--footer {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.profile-card {
  width: min(100%, 24rem);
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.profile-card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.profile-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.profile-row:first-of-type { border-top: none; }

.profile-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.profile-row dd {
  margin: 0;
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

.demo-error {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #b42318;
  z-index: 999;
}

.demo-rounded-slot {
  width: min(100%, 28rem);
  margin: 0 auto 1.5rem;
  overflow: visible;
}

.demo-rounded-label {
  margin: 0 auto 0.65rem;
  max-width: 28rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.demo-rounded-slot .kie-la-auth-iframe-wrap,
.demo-rounded-slot .kie-la-auth-iframe {
  width: 100% !important;
  overflow: visible !important;
}
