/* ===================================================================
   PriceLantern Global Shell Styles
   Navbar, footer, feedback button, cookie banner.
   All values reference tokens.css variables.
   =================================================================== */

/* Push page content below fixed navbar (all pages) */
main {
  padding-top: var(--pl-main-offset);
}

/* Full-bleed first sections (home hero, pricing) — avoid a body-coloured strip
   above them; the navbar offset lives inside the section's own padding. */
/* These sections bake the navbar offset into their own top padding and run a
   full-bleed background to the top — so main must not add its own offset, or a
   body-coloured strip shows above them behind the floating navbar. */
main:has(> .hero:first-child),
main:has(> .pricing),
main:has(> .subscribe),
main:has(> .pl-faq) {
  padding-top: 0;
}

/* ======================== NAVBAR ======================== */
.pl-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-navbar);
  padding: 16px 24px 18px;
  pointer-events: none;
}
.pl-navbar__pill {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 42, 56, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  padding: 10px 12px 10px 20px;
  pointer-events: auto;
  transition: background var(--duration-normal), box-shadow var(--duration-normal);
}
.pl-navbar.scrolled .pl-navbar__pill {
  background: rgba(10, 30, 44, 0.95);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

.pl-navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pl-white);
  flex-shrink: 0;
}
.pl-navbar__logo {
  width: 24px;
  height: auto;
  color: var(--pl-white);
}
.pl-navbar__wordmark {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: 0.82rem;
  line-height: 1.15;
  color: var(--pl-white);
  letter-spacing: -0.01em;
}

.pl-navbar__links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.pl-navbar__link {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--duration-normal);
  letter-spacing: 0.01em;
}
.pl-navbar__link:hover { color: var(--pl-white); }
.pl-navbar__link--accent { color: var(--pl-orange); }
.pl-navbar__link--accent:hover { color: #ff8040; }

.pl-navbar__signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: 0.82rem;
  color: var(--pl-white);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  padding: 8px 24px;
  text-decoration: none;
  transition: background var(--duration-normal), border-color var(--duration-normal);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pl-navbar__signin:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--pl-white);
}
.pl-navbar__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 50%;
  transition: transform var(--duration-normal);
}
.pl-navbar__account:hover { transform: translateY(-1px); }
.pl-navbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--pl-orange), #c94a10);
  color: var(--pl-white);
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: 0.9rem;
  box-shadow: 0 2px 10px var(--pl-orange-glow);
  transition: box-shadow var(--duration-normal);
}
.pl-navbar__avatar--blank {
  background: rgba(255, 255, 255, 0.1);
}
.pl-navbar__account:hover .pl-navbar__avatar {
  box-shadow: 0 4px 16px rgba(236, 100, 29, 0.5);
}

/* ======================== FOOTER ======================== */
.pl-footer {
  background: #0d2230;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 72px 0 40px;
  font-family: var(--pl-font);
}
.pl-footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.pl-footer__brand { padding-right: 24px; }
.pl-footer__logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 16px;
}
.pl-footer__logo-icon {
  width: 22px;
  height: auto;
  color: var(--pl-orange);
}
.pl-footer__wordmark {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: 1.05rem;
  color: var(--pl-white);
}
.pl-footer__tagline {
  font-size: var(--pl-text-sm);
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.65;
  margin: 0;
  max-width: 300px;
}
.pl-footer__heading {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-xs);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pl-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pl-footer__list li { margin-bottom: 10px; }
.pl-footer__list a {
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--pl-text-sm);
  text-decoration: none;
  transition: color var(--duration-normal);
}
.pl-footer__list a:hover { color: rgba(255, 255, 255, 0.85); }

.pl-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: var(--pl-text-xs);
  color: rgba(255, 255, 255, 0.25);
}
.pl-footer__socials {
  display: flex;
  gap: 20px;
}
.pl-footer__socials a {
  color: rgba(255, 255, 255, 0.3);
  transition: color var(--duration-normal);
}
.pl-footer__socials a:hover { color: rgba(255, 255, 255, 0.75); }

/* ======================== FEEDBACK BUTTON ======================== */
.pl-feedback-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--pl-orange);
  color: var(--pl-white);
  border: none;
  border-radius: 2rem;
  font-family: var(--pl-font);
  font-size: 0.9rem;
  font-weight: var(--pl-font-weight-semi);
  cursor: pointer;
  box-shadow: 0 4px 12px var(--pl-orange-glow);
  transition: background var(--duration-normal), transform var(--duration-fast), box-shadow var(--duration-normal);
}
.pl-feedback-btn:hover {
  background: var(--pl-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(236, 100, 29, 0.4);
}
.pl-feedback-btn:focus-visible {
  outline: 2px solid var(--pl-orange);
  outline-offset: 2px;
}
.pl-feedback-btn svg { flex-shrink: 0; }

/* ======================== COOKIE BANNER ======================== */
.pl-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #232B39;
  color: var(--pl-white);
  z-index: var(--z-overlay);
  padding: 1rem 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--pl-font);
  font-size: var(--pl-text-sm);
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 767px) {
  .pl-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .pl-footer__brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .pl-navbar {
    padding: 12px 16px 0;
  }
  .pl-navbar__pill {
    padding: 8px 10px 8px 16px;
  }
  .pl-navbar__links { gap: 16px; }
  .pl-navbar__link { display: none; }
  .pl-navbar__signin {
    padding: 7px 18px;
    font-size: 0.75rem;
  }
  .pl-footer__top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pl-feedback-btn__label { display: none; }
  .pl-feedback-btn { padding: 0.6rem 0.75rem; }
}

/* ===================================================================
   Toast notifications + keyboard cheatsheet — paired with pl_shell.js.
   Toasts replace window.alert() for non-blocking transient feedback.
   The cheatsheet is opened with `?` and lists the global shortcuts.
   =================================================================== */

/* ── Toast tray (bottom-right, stacks upward) ── */
.pl-toast-tray {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.pl-toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(20, 42, 56, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--pl-white);
  font-family: var(--pl-font);
  font-size: var(--pl-text-sm);
  line-height: 1.4;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.22s var(--ease-default), opacity 0.22s var(--ease-default);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pl-toast--in {
  transform: translateY(0);
  opacity: 1;
}
.pl-toast--leaving {
  transform: translateY(-8px);
  opacity: 0;
}
.pl-toast__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pl-toast--info  .pl-toast__icon { background: rgba(111, 173, 219, 0.15); color: var(--pl-blue); }
.pl-toast--success .pl-toast__icon { background: rgba(115, 196, 133, 0.15); color: var(--pl-green); }
.pl-toast--error .pl-toast__icon { background: rgba(255, 77, 79, 0.15); color: var(--pl-red); }
.pl-toast__message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.pl-toast__close {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.pl-toast__close:hover,
.pl-toast__close:focus-visible {
  color: var(--pl-white);
  background: rgba(255, 255, 255, 0.08);
}

/* Subtle left-edge accent bar matching the toast variant. */
.pl-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pl-orange);
  opacity: 0.7;
}
.pl-toast { position: relative; padding-left: 18px; }
.pl-toast--info::before    { background: var(--pl-blue); }
.pl-toast--success::before { background: var(--pl-green); }
.pl-toast--error::before   { background: var(--pl-red); }

/* ── Keyboard cheatsheet ── */
.pl-cheatsheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.pl-cheatsheet.is-open { display: flex; }
.pl-cheatsheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 44, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pl-cheatsheet__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: var(--space-6);
  background: rgba(20, 42, 56, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--pl-white);
  font-family: var(--pl-font);
  animation: plCheatIn 0.22s var(--ease-default);
}
@keyframes plCheatIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pl-cheatsheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.pl-cheatsheet__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: var(--pl-font-weight-semi);
  letter-spacing: -0.01em;
}
.pl-cheatsheet__close {
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.pl-cheatsheet__close:hover,
.pl-cheatsheet__close:focus-visible {
  color: var(--pl-white);
  background: rgba(255, 255, 255, 0.08);
}
.pl-cheatsheet__list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pl-cheatsheet__row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-4);
  align-items: center;
}
.pl-cheatsheet__row dt { margin: 0; }
.pl-cheatsheet__row dd { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: var(--pl-text-sm); }
.pl-cheatsheet kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--pl-text-xs);
  color: var(--pl-white);
}
.pl-cheatsheet__foot {
  margin: var(--space-5) 0 0;
  font-size: var(--pl-text-xxs);
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

@media (max-width: 480px) {
  .pl-toast-tray { bottom: 0.75rem; right: 0.75rem; left: 0.75rem; }
  .pl-toast { min-width: 0; max-width: 100%; }
  .pl-cheatsheet__panel { padding: var(--space-5); }
}

/* ===================================================================
   Accessibility shell — skip-to-content link and global focus-visible
   ring. Keyboard users currently get no visible indication when they
   tab through interactive elements, and screen-reader users have to
   tab through the entire nav to reach page content. These two rules
   address both at once.
   =================================================================== */

/* Skip-to-content — first tabbable element on every page. Visually
   hidden until focused, then snaps to the top-left as a high-contrast
   pill. Sits above the navbar in z-order so it isn't masked. */
.pl-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: calc(var(--z-navbar) + 10);
  padding: 10px 16px;
  background: var(--pl-orange);
  color: var(--pl-white);
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: var(--shadow-glow-orange);
  transform: translateY(-200%);
  transition: transform var(--duration-normal) var(--ease-default);
}
.pl-skip-link:focus,
.pl-skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--pl-white);
  outline-offset: 2px;
}

/* Don't show a focus ring on the <main> just because the skip link
   targeted it — only when something actually keyboard-focuses it. */
main#pl-main:focus { outline: none; }
main#pl-main:focus-visible {
  outline: 2px dashed var(--pl-orange);
  outline-offset: -4px;
}

/* Global focus-visible — orange ring on any keyboard-focused
   interactive element. Mouse clicks don't trigger focus-visible, so
   visual designs aren't affected for sighted mouse users. */
:focus-visible {
  outline: 2px solid var(--pl-orange);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Inputs and buttons sometimes have inner padding that makes the
   default outline-offset look detached — use a tighter offset. */
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline-offset: 2px;
}
