/* Full-page sign-in screen shared by Studio and the Dashboard (built by DavixH2IUI.ensureApiKey).
   While it is up, nothing else on the page is shown. */

html.pl-signed-out body > *:not(.pl-login):not(.toast-stack):not(.pl-go):not(.pwa-titlebar):not(script):not(style):not(link) { display: none !important; }
/* The glow is on the page canvas as well as on the sign-in layer: if a phone's browser ever leaves a strip below the fixed layer
   (iOS home-bar area), the strip has the same background instead of flat dark. */
html.pl-signed-out, html.pl-signed-out body {
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(255, 100, 180, .22), transparent 70%),
    radial-gradient(55% 45% at 88% 92%, rgba(77, 163, 255, .18), transparent 70%),
    var(--bg, #12151b);
  background-repeat: no-repeat; background-size: 100% 100%; background-attachment: fixed;
}

.pl-login {
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  padding: max(24px, var(--sat, 0px)) max(16px, var(--sar, 0px)) max(24px, var(--sab, 0px)) max(16px, var(--sal, 0px));
  /* The glow is this element's OWN background (not an absolutely positioned child), so it always fills the whole
     screen -- on any height, with the card scrolled or not, and under the notch and home bar -- instead of ending
     where a child's box ended and leaving flat dark below it. */
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(255, 100, 180, .22), transparent 70%),
    radial-gradient(55% 45% at 88% 92%, rgba(77, 163, 255, .18), transparent 70%),
    var(--bg, #12151b);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--text, #f5f6f8);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.pl-login-glow { display: none; }
.pl-login-card {
  position: relative; margin: auto; width: 100%; max-width: 420px; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(33, 38, 50, .92), rgba(26, 30, 39, .92));
  border: 1px solid var(--border, #2a3140); border-radius: 20px;
  padding: 34px 30px 28px; box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
}
.pl-login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; text-align: center; }
.pl-login-logo { height: 68px; flex: none; display: block; filter: drop-shadow(0 6px 22px rgba(120, 90, 255, .38)); }
.pl-login-logo img { height: 100%; width: auto; display: block; }
.pl-login-word { font-size: 24px; font-weight: 800; letter-spacing: .2px; }
.pl-login h1 { font-size: 24px; line-height: 1.2; margin: 0 0 8px; font-weight: 800; text-align: center; }
.pl-login-sub { margin: 0 0 24px; text-align: center; color: var(--text-muted, rgba(245, 246, 248, .62)); font-size: 14.5px; line-height: 1.55; }

.pl-login-btn {
  width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit;
  background: linear-gradient(135deg, var(--pink, #ff64b4), var(--pink-dark, #fc0082)); color: var(--pink-on, #2a0619);
  box-shadow: 0 10px 28px rgba(252, 0, 130, .28); transition: transform .12s, box-shadow .12s, filter .12s;
}
.pl-login-btn svg { width: 20px; height: 20px; flex: none; }
.pl-login-btn:hover { filter: brightness(1.06); box-shadow: 0 12px 32px rgba(252, 0, 130, .38); }
.pl-login-btn:active { transform: translateY(1px); }
.pl-login-btn:focus-visible, .pl-login-key summary:focus-visible { outline: 2px solid var(--blue, #4da3ff); outline-offset: 2px; }
.pl-login-btn { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.pl-login-btn.pl-secondary { width: auto; min-height: 44px; padding: 0 18px; background: var(--surface-3, #2a3140); color: var(--text, #f5f6f8); box-shadow: none; }
.pl-login-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--text-faint, rgba(245, 246, 248, .4)); text-align: center; }

.pl-login-error {
  margin: 0 0 16px; padding: 11px 13px; font-size: 13px; line-height: 1.45; border-radius: 10px;
  color: #ffb3bb; background: var(--danger-soft, rgba(255, 77, 94, .16)); border: 1px solid rgba(255, 77, 94, .35);
}
.pl-login-busy { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; color: var(--text-muted, rgba(245, 246, 248, .62)); font-size: 14px; }
.pl-login-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--surface-3, #2a3140); border-top-color: var(--pink, #ff64b4); animation: pl-spin .8s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

.pl-login-key { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border, #2a3140); }
.pl-login-key summary { cursor: pointer; list-style: none; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted, rgba(245, 246, 248, .62)); border-radius: 6px; }
.pl-login-key summary::-webkit-details-marker { display: none; }
.pl-login-key summary:hover { color: var(--text, #f5f6f8); }
.pl-login-key label { display: block; margin: 16px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-muted, rgba(245, 246, 248, .62)); }
.pl-login-keyrow { display: flex; gap: 10px; }
.pl-login-keyrow input {
  flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong, #3a4257); background: var(--bg, #12151b); color: var(--text, #f5f6f8); font: 14px/1 ui-monospace, Menlo, monospace;
}
.pl-login-keyrow input:focus { outline: 2px solid var(--pink, #ff64b4); outline-offset: 0; border-color: transparent; }
.pl-login-foot { margin: 20px 0 0; font-size: 12px; color: var(--text-faint, rgba(245, 246, 248, .4)); text-align: center; }

@media (max-width: 480px) {
  .pl-login-card { padding: 26px 20px 22px; border-radius: 16px; }
  .pl-login h1 { font-size: 23px; }
  .pl-login-keyrow { flex-direction: column; }
  .pl-login-btn.pl-secondary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .pl-login-spin { animation-duration: 3s; } .pl-login-btn { transition: none; } }

/* Form pieces for the server-rendered admin sign-in and setup pages (same look as the app sign-in). */
.pl-form { display: block; }
.pl-form label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--text-muted, rgba(245, 246, 248, .62)); }
.pl-form label .pl-opt { font-weight: 500; color: var(--text-faint, rgba(245, 246, 248, .4)); }
.pl-field { position: relative; margin: 0 0 16px; }
.pl-form input[type=text], .pl-form input[type=password] {
  width: 100%; min-height: 46px; box-sizing: border-box; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong, #3a4257); background: var(--bg, #12151b); color: var(--text, #f5f6f8); font-size: 14px; font-family: inherit;
}
.pl-form input:focus { outline: 2px solid var(--pink, #ff64b4); outline-offset: 0; border-color: transparent; }
.pl-field.pl-has-reveal input { padding-right: 44px; }
.pl-reveal { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-faint, rgba(245, 246, 248, .4)); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pl-reveal:hover { background: var(--surface-3, #2a3140); color: var(--text, #f5f6f8); }
.pl-reveal svg { width: 18px; height: 18px; }
.pl-form .pl-login-btn, a.pl-login-btn { margin-top: 6px; text-decoration: none; box-sizing: border-box; }
.pl-qr { background: #fff; border-radius: 12px; padding: 10px; display: flex; justify-content: center; margin: 0 0 14px; }
.pl-qr svg { max-width: 100%; height: auto; }
.pl-secret { display: block; word-break: break-all; margin: 0 0 16px; padding: 10px; border-radius: 10px; font: 12px/1.4 ui-monospace, Menlo, monospace; background: var(--bg, #12151b); border: 1px solid var(--border, #2a3140); }
/* "Can't scan the code?": the manual 2FA key stays hidden until asked for (a native <details>: keyboard and screen-reader friendly, no script) */
.pl-keybox { margin: 0 0 16px; }
.pl-keybox > summary { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; cursor: pointer; list-style: none; color: var(--pink, #ff64b4); background: rgba(255, 100, 180, .10); border: 1px solid rgba(255, 100, 180, .28); font: 700 13px/1 inherit; transition: background .15s, border-color .15s; user-select: none; }
.pl-keybox > summary::-webkit-details-marker { display: none; }
.pl-keybox > summary:hover { background: rgba(255, 100, 180, .18); border-color: var(--pink, #ff64b4); }
.pl-keybox > summary:focus-visible { outline: 2px solid var(--pink, #ff64b4); outline-offset: 2px; }
.pl-keybox .pl-key-hide, .pl-keybox[open] .pl-key-show { display: none; }
.pl-keybox[open] .pl-key-hide { display: inline; }
.pl-keybox .pl-secret { margin: 10px 0 0; animation: pl-key-in .18s ease-out; }
@keyframes pl-key-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pl-keybox .pl-secret { animation: none; } }
.pl-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; padding: 14px; border-radius: 10px; font: 13px/1 ui-monospace, Menlo, monospace; background: var(--bg, #12151b); border: 1px solid var(--border, #2a3140); }
.pl-login-card.pl-wide { max-width: 460px; }

/* "Waiting for approval on WordPress": always offers a way forward (open WordPress again / start over). */
.pl-login-wait { padding: 16px; border-radius: 14px; background: rgba(77, 163, 255, .08); border: 1px solid rgba(77, 163, 255, .28); }
.pl-login-wait-head { display: flex; align-items: center; gap: 12px; }
.pl-login-wait-head > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.pl-login-wait-head strong { font-weight: 800; }
.pl-login-wait-head span:not(.pl-login-spin) { font-size: 12.5px; color: var(--text-muted, rgba(245, 246, 248, .62)); font-variant-numeric: tabular-nums; }
.pl-login-wait .pl-login-spin { flex: none; }
.pl-login-wait .pl-login-restart { width: 100%; margin-top: 10px; }

/* "Continue with the demo" under the sign-in card (shown when signing in from inside the demo). */
.pl-login-cancel { display: block; margin: 16px auto 0; padding: 8px 12px; background: none; border: 0; color: var(--text-muted, rgba(245, 246, 248, .62)); font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit; cursor: pointer; border-radius: 8px; }
.pl-login-cancel:hover { color: var(--text, #f5f6f8); background: var(--surface-2, #212632); }

/* While the page decides between the demo and the sign-in screen, show a quiet spinner instead of a blank page. */
html.pl-signed-out:not(:has(.pl-login))::before { content: ''; position: fixed; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid var(--surface-3, #2a3140); border-top-color: var(--pink, #ff64b4); animation: pl-spin .8s linear infinite; z-index: 5; }

/* Admin sign-in, step 2: who is signing in, six boxes for the code, a recovery-code field instead when asked */
.pl-who { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 18px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2, #232a36); border: 1px solid var(--border, #2a3140); font-size: 13px; color: var(--text-muted, rgba(245, 246, 248, .62)); }
.pl-who span { color: var(--text, #f5f6f8); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pl-who-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--success, #3ddc97); box-shadow: 0 0 0 3px rgba(61, 220, 151, .18); }
.pl-who a { flex: none; margin-left: auto; color: var(--pink, #ff64b4); font-weight: 700; text-decoration: none; }
.pl-who a:hover { text-decoration: underline; }
.pl-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.pl-otp[hidden], .pl-recovery[hidden] { display: none; }
.pl-otp input { width: 100%; min-width: 0; height: 54px; box-sizing: border-box; padding: 0; text-align: center; font: 700 22px/1 ui-monospace, Menlo, monospace; border-radius: 12px; border: 1px solid var(--border-strong, #3a4257); background: var(--bg, #12151b); color: var(--text, #f5f6f8); caret-color: var(--pink, #ff64b4); transition: border-color .12s, box-shadow .12s; }
.pl-otp input:focus { outline: none; border-color: var(--pink, #ff64b4); box-shadow: 0 0 0 3px rgba(255, 100, 180, .22); }
.pl-otp input:not(:placeholder-shown), .pl-otp input[value]:not([value=""]) { border-color: var(--border-strong, #3a4257); }
.pl-recovery { width: 100%; box-sizing: border-box; min-height: 52px; margin: 0 0 18px; padding: 0 14px; text-align: center; letter-spacing: .08em; font: 600 17px/1 ui-monospace, Menlo, monospace; border-radius: 12px; border: 1px solid var(--border-strong, #3a4257); background: var(--bg, #12151b); color: var(--text, #f5f6f8); }
.pl-recovery:focus { outline: 2px solid var(--pink, #ff64b4); outline-offset: 0; border-color: transparent; }
@media (max-width: 380px) { .pl-otp { gap: 6px; } .pl-otp input { height: 50px; font-size: 20px; } }

.pl-login-demo { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--text-muted, rgba(245, 246, 248, .62)); }
.pl-login-demo a { color: var(--pink, #ff64b4); font-weight: 700; text-decoration: none; }
.pl-login-demo a:hover { text-decoration: underline; }
.pl-login-demo[hidden] { display: none; }

.pl-login-links { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--text-muted, rgba(245, 246, 248, .62)); }
.pl-login-links a { color: var(--pink, #ff64b4); font-weight: 700; text-decoration: none; }
.pl-login-links a:hover { text-decoration: underline; }

/* the short note shown while the browser is on its way to the website's sign-in page (this app has no sign-in page of its own) */
.pl-go { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--bg, #12151b); color: var(--text, #f5f6f8); font: 600 15px/1.5 var(--font, 'Manrope', system-ui, sans-serif); }
.pl-go a { color: var(--pink, #ff64b4); font-weight: 800; text-decoration: none; }
.pl-go a:hover { text-decoration: underline; }
.pl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
