/* Preview hero for the Documents index — frames the actual artefact on a
   brand-blue stage so teachers see exactly what they're about to print. Used
   for both the login slips card and the parent letters card; the artefact
   layout differs but the stage is shared. */

.document-preview {
  position: relative;
  height: 240px;
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 640px) {
  .document-preview {
    height: 260px;
  }
}

.document-preview-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 20% 10%, rgba(255, 255, 255, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 90% 100%, rgba(8, 47, 106, 0.6) 0%, transparent 70%),
    linear-gradient(135deg, #1565C0 0%, #0D47A1 55%, #082F6A 100%);
  z-index: -2;
}

/* Fine star/grain speckle that matches the PDF header band. Pure CSS so we
   don't ship an SVG for two tiny dots. */
.document-preview-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 38%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 68%, rgba(255, 255, 255, 0.4) 0 1.2px, transparent 2px),
    radial-gradient(circle at 30% 82%, rgba(255, 255, 255, 0.3) 0 1px, transparent 2px);
  opacity: 0.8;
  z-index: -1;
}

.document-preview-artefact {
  position: absolute;
  display: block;
  background: white;
  border-radius: 8px;
  box-shadow:
    0 24px 60px -24px rgba(0, 0, 0, 0.55),
    0 6px 16px -6px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* --- Login slip variant ------------------------------------------------- */
/* Portrait A4 sheet tilted behind, with a zoomed single-slip callout
   overlapping in front — mirrors the letter card's fanned-pair composition
   and shows teachers both the whole sheet and what each slip looks like. */
.document-preview-artefact--slip-back,
.document-preview-artefact--slip-front {
  top: 50%;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
}

.document-preview-artefact--slip-back {
  left: calc(50% - 70px);
  height: 220px;
  width: auto;
  transform: translate(-50%, -50%) rotate(-5deg);
}

.document-preview-artefact--slip-front {
  left: calc(50% + 58px);
  width: 210px;
  height: auto;
  transform: translate(-50%, -50%) rotate(3deg);
  z-index: 1;
}

@media (min-width: 640px) {
  .document-preview-artefact--slip-back {
    height: 240px;
  }

  .document-preview-artefact--slip-front {
    width: 230px;
  }
}

/* --- Letter variant (two-sheet stack) ----------------------------------- */
/* The B&W sheet sits behind and slightly left; the colour sheet overlaps it
   on the right. Tilts are opposite so the pair reads as a fanned deck —
   visually mirroring the "colour or mono" toggle in the form. */
.document-preview-artefact--letter-back,
.document-preview-artefact--letter-front {
  top: 50%;
  height: 210px;
  width: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
}

.document-preview-artefact--letter-back {
  left: calc(50% - 60px);
  transform: translate(-50%, -50%) rotate(-6deg);
  opacity: 0.85;
}

.document-preview-artefact--letter-front {
  left: calc(50% + 40px);
  transform: translate(-50%, -50%) rotate(3deg);
  z-index: 1;
}

@media (min-width: 640px) {
  .document-preview-artefact--letter-back,
  .document-preview-artefact--letter-front {
    height: 230px;
  }
}

/* --- Printing-style swatches ------------------------------------------- */
/* Clickable chips that pair a colour sample with a label; the whole card
   lights up when its hidden radio is checked. */
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgb(203 213 225); /* slate-300 */
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
  user-select: none;
}

.theme-swatch:hover {
  border-color: rgb(148 163 184); /* slate-400 */
  background: rgb(248 250 252); /* slate-50 */
}

.theme-swatch:has(input:checked) {
  border-color: var(--color-brand-500);
  background: var(--color-brand-50);
  box-shadow: 0 0 0 3px rgb(21 101 192 / 0.12);
}

.theme-swatch-chip {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.theme-swatch-chip--colour {
  background: linear-gradient(135deg, var(--color-brand-500) 0%, var(--color-brand-700) 100%);
}

.theme-swatch-chip--mono {
  background: linear-gradient(135deg, #1f2937 0%, #475569 100%);
}

.theme-swatch-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(30 41 59); /* slate-800 */
}
