/* ============================================================
   Hörweite — Shared Page Shell
   Fullscreen overlay system for secondary pages
   z-index: 9994 (below auth-modal 9996, above nav)
   ============================================================ */

.hw-page {
  position: fixed;
  inset: 0;
  z-index: 9994;
  background: var(--hw-night-0, #0B1026);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%,
                    rgba(107, 95, 255, 0.15) 0%,
                    transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%,
                    rgba(142, 197, 252, 0.08) 0%,
                    transparent 55%);
  color: var(--hw-cream, #F3EFE0);
  font-family: 'Satoshi', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}
.hw-page.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* --- Header -------------------------------------------------- */
.hw-page__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  min-height: 58px;
  background: rgba(11, 16, 38, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 2;
}
.hw-page__back {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--hw-cream, #F3EFE0);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hw-page__back:hover {
  background: rgba(255, 255, 255, 0.09);
}
.hw-page__back:active {
  transform: scale(0.94);
}
.hw-page__back svg {
  width: 20px;
  height: 20px;
}
.hw-page__titlewrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hw-page__icon {
  font-size: 20px;
  line-height: 1;
}
.hw-page__title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--hw-cream, #F3EFE0);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hw-page__action {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--hw-cream, #F3EFE0);
  background: rgba(107, 95, 255, 0.18);
  border: 1px solid rgba(107, 95, 255, 0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hw-page__action:hover {
  background: rgba(107, 95, 255, 0.28);
}

/* --- Body ---------------------------------------------------- */
.hw-page__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px calc(96px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.hw-page__body::-webkit-scrollbar {
  width: 6px;
}
.hw-page__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* --- Auth gate ---------------------------------------------- */
.hw-authgate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 60vh;
}
.hw-authgate__icon {
  font-size: 48px;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 20px rgba(107, 95, 255, 0.4));
}
.hw-authgate__title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--hw-cream, #F3EFE0);
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.hw-authgate__text {
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  color: var(--hw-cream-dim, #B8B5A8);
  line-height: 1.6;
  max-width: 32ch;
  margin: 0 0 24px;
}
.hw-authgate__btn {
  padding: 14px 28px;
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--hw-aurora, #6B5FFF) 0%, #8A7BFF 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 28px -6px rgba(107, 95, 255, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hw-authgate__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px -8px rgba(107, 95, 255, 0.7);
}
.hw-authgate__btn:active {
  transform: translateY(0);
}

/* --- Shared helpers for page content ------------------------ */
.hw-page__section-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  color: var(--hw-cream, #F3EFE0);
  margin: 20px 0 10px;
  letter-spacing: -0.01em;
}
.hw-page__hint {
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  color: var(--hw-cream-dim, #B8B5A8);
  line-height: 1.5;
}

/* --- Body lock when any page is open ------------------------ */
body.hw-page-open {
  overflow: hidden;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 380px) {
  .hw-page__title { font-size: 20px; }
  .hw-page__body { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .hw-page {
    transition: opacity 0.15s ease;
    transform: none;
  }
}
