:root {
  --bg: #09131f;
  --bg-soft: #112336;
  --panel: rgba(7, 20, 33, 0.82);
  --panel-strong: rgba(11, 25, 40, 0.95);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3efe7;
  --muted: #b7c4d3;
  --gold: #d8b36a;
  --gold-soft: rgba(216, 179, 106, 0.14);
  --accent: #74d3c8;
  --danger: #ff8f6b;
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(116, 211, 200, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(216, 179, 106, 0.18), transparent 24%),
    linear-gradient(135deg, #07111b 0%, #0d1d2d 55%, #09131f 100%);
  color: var(--text);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.ambient {
  position: absolute;
  inset: auto;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.75;
  pointer-events: none;
}

.ambient-a {
  width: 280px;
  height: 280px;
  top: 8%;
  right: 10%;
  background: rgba(116, 211, 200, 0.15);
}

.ambient-b {
  width: 360px;
  height: 360px;
  bottom: 6%;
  left: 3%;
  background: rgba(216, 179, 106, 0.12);
}

.frame {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(216, 179, 106, 0.3), rgba(116, 211, 200, 0.24));
  border: 1px solid rgba(216, 179, 106, 0.35);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-copy strong {
  font-size: 1.2rem;
  color: var(--gold);
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-gate,
.panel-expired {
  width: min(720px, 100%);
  padding: 40px 30px;
}

.panel-viewer {
  width: min(1120px, 100%);
  padding: 18px;
  background: var(--panel-strong);
}

.hidden {
  display: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0 0 14px;
  line-height: 1.25;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.95;
}

.notice {
  margin: 26px 0;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 143, 107, 0.14), rgba(216, 179, 106, 0.08));
  border: 1px solid rgba(255, 143, 107, 0.24);
}

.notice span {
  display: block;
  margin-bottom: 8px;
  color: var(--danger);
  font-weight: 800;
}

.notice p {
  margin: 0;
  color: #f2ddd6;
  line-height: 1.9;
}

.primary-btn {
  border: 0;
  border-radius: 20px;
  padding: 16px 22px;
  width: 100%;
  cursor: pointer;
  color: #09131f;
  background: linear-gradient(135deg, var(--gold), #f0d39a);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
  box-shadow: 0 15px 35px rgba(216, 179, 106, 0.22);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(216, 179, 106, 0.28);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.78;
}

.meta-line {
  margin: 16px 0 0;
  color: rgba(183, 196, 211, 0.82);
  font-size: 0.92rem;
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 10px 18px;
}

.session-pill,
.expired-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--gold-soft);
  border: 1px solid rgba(216, 179, 106, 0.2);
  color: var(--gold);
  font-weight: 700;
}

.viewer-stage {
  height: min(78vh, 920px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
}

.security-strip {
  flex: 0 0 auto;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #c7d3de;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
}

.pages-container {
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px;
  display: grid;
  justify-items: center;
  align-items: start;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 20%),
    #0b1621;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 0;
}

.nav-btn {
  border: 1px solid rgba(216, 179, 106, 0.24);
  background: rgba(216, 179, 106, 0.08);
  color: var(--gold);
  border-radius: 14px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-indicator {
  min-width: 140px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.page-shell-card {
  position: relative;
  width: min(100%, 1100px);
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #101c28;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.viewer-single-card {
  width: min(100%, 1120px);
  min-height: 220px;
  display: block;
}

.page-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  font-size: clamp(1.2rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  transform: rotate(-18deg);
}

.page-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: top;
}

.page-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  color: var(--muted);
  background: rgba(16, 28, 40, 0.72);
  backdrop-filter: blur(2px);
}

.page-loading.hidden,
.page-image.hidden {
  display: none;
}

.viewer-stage img,
.viewer-stage canvas {
  -webkit-user-drag: none;
}

.panel-expired .expired-stamp {
  margin-top: 26px;
  justify-content: flex-start;
  width: fit-content;
  color: #f1d29b;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 14px;
  }

  .panel-gate,
  .panel-expired,
  .panel-viewer {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .brand-row,
  .viewer-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-stage {
    height: 72vh;
  }

  .page-toolbar {
    flex-wrap: wrap;
  }

  .page-loading {
    min-height: 260px;
  }
}
