/* Gifted4You — customer-facing design system for the French magazine gift.
 *
 * One stylesheet for the landing page and the personalization flow. No build
 * step, no framework, no third-party font host: the fonts are self-hosted
 * (static/fonts, SIL Open Font License — see dpg/fonts/README.md), so an EU
 * visitor's IP never goes to Google.
 *
 * The look is a magazine cover: a bold cobalt ground, a high-contrast display
 * face for headlines, a plain white page around it. The tokens below mirror the
 * palette the PDF cover is painted with (dpg/generator.py).
 */

/* ----------------------------------------------------------------- fonts -- */

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/BodoniModa-Bold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/BodoniModa-Italic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-SemiBold.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens -- */

:root {
  --paper: #ffffff;
  --paper-raised: #ffffff;
  --paper-sunken: #eef0fa; /* mist */

  --ink: #16182b;
  --ink-soft: #4b4f6b; /* 8.0:1 on white */
  --ink-faint: #5b5f7a; /* 6.4:1 on white, 5.6:1 on mist */

  --cobalt: #2a3bc0; /* 8.5:1 with white */
  --cobalt-deep: #1f2e9e;
  --cobalt-soft: #d9ddf7;
  --accent: var(--cobalt);
  --accent-strong: var(--cobalt-deep);
  --accent-wash: #eef0fa;

  --blush: #f7d6d0;
  --sun: #f5c542;
  --gold: #a07800;
  --gold-wash: #fff6d6;

  --line: #dde0ee;
  --line-strong: #b9bfdc;

  --ok: #1f6b4a;
  --ok-wash: #e4f2ea;
  --danger: #a3271f;
  --danger-wash: #fbe9e6;

  --font-display: "Bodoni Moda", "Didot", "Bodoni MT", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-text: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;

  --measure: 34rem;
  --page: 70rem;
}

/* ------------------------------------------------------------------ base -- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* The step flow toggles whole panels with the `hidden` attribute; `!important`
   keeps that working for elements that also carry a `display` rule. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 1.6rem + 3.6vw, 4.1rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.7rem);
}

h3 {
  font-size: 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.3em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--cobalt);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cobalt-deep);
}

img {
  max-width: 100%;
  height: auto;
}

/* One focus ring everywhere — never removed, always visible. */
:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 4px;
}

.dpg-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 50;
}

.dpg-skip:focus {
  left: 0;
  color: var(--paper);
}

.dpg-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- layout --- */

.dpg-shell {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.dpg-shell--narrow {
  max-width: 46rem;
}

.dpg-section {
  padding: clamp(3rem, 1.75rem + 5vw, 6rem) 0;
}

.dpg-section--mist {
  background: var(--paper-sunken);
}

.dpg-section__head {
  max-width: var(--measure);
  margin-bottom: clamp(1.75rem, 1rem + 2vw, 2.75rem);
}

/* A plain small line above the hero title (no tracking, no capitals). */
.dpg-eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cobalt);
  margin: 0 0 0.9rem;
}

.dpg-lede {
  font-family: var(--font-text);
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* --------------------------------------------------------------- header --- */

.dpg-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.dpg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.dpg-wordmark {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.2;
}

.dpg-wordmark__name {
  font-weight: 600;
  font-size: 1.2rem;
}

.dpg-wordmark__tagline {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* The hero's own CTA is one scroll away on a phone; two stacked buttons in the
   first screenful just push the headline below the fold. */
@media (max-width: 40rem) {
  .dpg-header__inner > .dpg-btn {
    display: none;
  }
}

/* -------------------------------------------------------------- buttons --- */

.dpg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.dpg-btn:active {
  transform: translateY(1px);
}

.dpg-btn--primary {
  background: var(--cobalt);
  color: #fff;
}

.dpg-btn--primary:hover {
  background: var(--cobalt-deep);
  color: #fff;
}

.dpg-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.dpg-btn--ghost:hover {
  background: var(--ink);
  color: #fff;
}

.dpg-btn--quiet {
  background: none;
  border: none;
  padding: 0.35rem 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cobalt);
  text-decoration: underline;
  cursor: pointer;
}

.dpg-btn--lg {
  font-size: 1.08rem;
  padding: 1.05rem 1.6rem;
}

.dpg-btn--block {
  width: 100%;
}

.dpg-btn[disabled],
.dpg-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.dpg-cta-note {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
}

/* ----------------------------------------------------------------- hero --- */

.dpg-hero {
  padding: clamp(2rem, 1rem + 4vw, 4.5rem) 0 clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.dpg-hero__grid {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 3.5rem);
  align-items: center;
}

.dpg-hero__copy {
  max-width: 36rem;
}

.dpg-hero__subtitle {
  font-family: var(--font-text);
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.dpg-hero__support {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-bottom: 1.9rem;
}

@media (min-width: 62rem) {
  .dpg-hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* The hero image is the real product: a real render of the cover, shown on a
   phone. Phone-shaped on a phone, a flat lay on a wide screen. */
.dpg-hero__image {
  margin: 0 auto;
  max-width: 24rem;
}

@media (min-width: 62rem) {
  .dpg-hero__image {
    max-width: none;
    margin: 0;
  }
}

.dpg-hero__image img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

/* The one orchestrated moment on the page: the hero image settles in. */
@media (prefers-reduced-motion: no-preference) {
  .dpg-hero__image {
    animation: dpg-settle 700ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

@keyframes dpg-settle {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------ steps, lists ------ */

/* Ruled columns, not a row of identical boxes. */
.dpg-steps {
  display: grid;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 52rem) {
  .dpg-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.dpg-steps__item {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.dpg-steps__number {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--cobalt);
  margin-bottom: 0.6rem;
}

.dpg-steps__item p {
  margin: 0;
  color: var(--ink-soft);
}

.dpg-included {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 3.5rem);
  align-items: center;
}

@media (min-width: 62rem) {
  .dpg-included {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.dpg-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dpg-list li {
  border-top: 1px solid var(--line-strong);
  padding: 1.1rem 0;
}

.dpg-list li:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.dpg-list p {
  margin: 0;
  color: var(--ink-soft);
}

.dpg-figure {
  margin: 0;
}

.dpg-figure img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.dpg-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------- preview ---- */

.dpg-preview__caption {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
  max-width: var(--measure);
}

.dpg-preview__grid {
  display: grid;
  gap: 2rem 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 34rem) {
  .dpg-preview__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dpg-preview__item img {
  display: block;
  width: 100%;
  max-width: 17rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.dpg-preview__item h3 {
  margin: 1rem 0 0.25rem;
  font-size: 1.05rem;
}

.dpg-preview__item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.dpg-preview__actions {
  margin-top: 2rem;
}

.dpg-print {
  margin-top: clamp(2.5rem, 2rem + 3vw, 4rem);
  max-width: 26rem;
}

/* -------------------------------------------------- sample flip-through --- */

.dpg-sample {
  width: min(94vw, 34rem);
  max-height: 96vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}

.dpg-sample::backdrop {
  background: rgba(22, 24, 43, 0.72);
}

.dpg-sample__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.dpg-sample__close,
.dpg-sample__nav {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.dpg-sample__close:hover,
.dpg-sample__nav:hover {
  background: #fff;
  color: var(--ink);
}

.dpg-sample :focus-visible {
  outline-color: #fff;
}

.dpg-sample__stage {
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}

.dpg-sample__stage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 68vh;
  border-radius: 2px;
  background: #fff;
}

.dpg-sample__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
}

.dpg-sample__note {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--cobalt-soft);
}

/* --------------------------------------------------------------- panels --- */

.dpg-note {
  border-left: 4px solid var(--cobalt);
  padding: 0.25rem 0 0.25rem 1.5rem;
  max-width: 46rem;
}

.dpg-note h2 {
  font-size: 1.5rem;
}

.dpg-note p {
  margin: 0;
  color: var(--ink-soft);
}

.dpg-faq__item {
  border-top: 1px solid var(--line-strong);
  padding: 1.15rem 0;
  max-width: 46rem;
}

.dpg-faq__item:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.dpg-faq__q {
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.dpg-faq__a {
  margin: 0;
  color: var(--ink-soft);
}

/* The closing call to action echoes the cover: cobalt ground, white display type. */
.dpg-closing {
  background: var(--cobalt);
  color: #fff;
  text-align: center;
}

.dpg-closing h2 {
  color: #fff;
}

.dpg-closing .dpg-lede {
  color: var(--cobalt-soft);
  margin-left: auto;
  margin-right: auto;
}

.dpg-closing .dpg-btn--primary {
  background: #fff;
  color: var(--cobalt);
}

.dpg-closing .dpg-btn--primary:hover {
  background: var(--sun);
  color: var(--ink);
}

.dpg-closing :focus-visible {
  outline-color: #fff;
}

.dpg-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.75rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
}

.dpg-footer p {
  margin: 0 0 0.35rem;
}

/* ----------------------------------------------------------------- form --- */

.dpg-flow {
  background: var(--paper-sunken);
  padding: clamp(1.75rem, 1rem + 3vw, 3.25rem) 0 4rem;
  min-height: 70vh;
}

.dpg-flow__intro {
  margin-bottom: 2rem;
}

.dpg-flow__intro h1 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
}

.dpg-flow__greeting {
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.dpg-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 1rem + 1.5vw, 2.5rem);
}

/* Progress: a labelled bar plus step pills. The bar carries the ARIA state
   for screen readers; the pills are decorative and hidden from them. */
.dpg-progress {
  margin-bottom: 1.75rem;
}

.dpg-progress__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.dpg-progress__count {
  font-weight: 600;
  color: var(--ink);
}

.dpg-progress__track {
  height: 6px;
  border-radius: 999px;
  background: var(--paper-sunken);
  overflow: hidden;
}

.dpg-progress__fill {
  height: 100%;
  width: 20%;
  background: var(--cobalt);
  border-radius: 999px;
  transition: width 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.dpg-progress__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}

.dpg-progress__pill {
  font-size: 0.8rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  background: var(--paper);
}

.dpg-progress__pill[data-state="current"] {
  color: #fff;
  border-color: var(--cobalt);
  background: var(--cobalt);
  font-weight: 600;
}

.dpg-progress__pill[data-state="done"] {
  color: var(--ok);
  border-color: var(--ok);
  background: var(--ok-wash);
}

.dpg-step[hidden] {
  display: none;
}

.dpg-step__legend {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.1rem);
  line-height: 1.12;
  padding: 0;
  margin: 0 0 0.4rem;
}

.dpg-step__help {
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
  max-width: var(--measure);
}

.dpg-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.dpg-field {
  margin-bottom: 1.35rem;
}

.dpg-field__label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.dpg-field__optional {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.88rem;
  margin-left: 0.35rem;
}

.dpg-field__hint {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}

.dpg-input {
  width: 100%;
  font-family: inherit;
  /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.dpg-input::placeholder {
  color: var(--ink-faint);
  opacity: 0.9;
}

.dpg-input:hover {
  border-color: var(--ink-faint);
}

.dpg-input:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}

.dpg-input:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 1px;
}

.dpg-input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-wash);
}

.dpg-error {
  display: block;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.dpg-error:empty {
  display: none;
}

/* Occasion suggestions — real <button>s, keyboard reachable, not chips-as-divs. */
.dpg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dpg-chip {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.dpg-chip:hover {
  border-color: var(--cobalt);
  color: var(--cobalt-deep);
}

.dpg-chip[aria-pressed="true"] {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
  font-weight: 600;
}

.dpg-memory {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.dpg-memory .dpg-field {
  flex: 1;
  margin-bottom: 0;
}

.dpg-memory + .dpg-memory {
  margin-top: 1rem;
}

.dpg-memory__remove {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 3rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.dpg-memory__remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.dpg-memories__actions {
  margin-top: 1rem;
}

.dpg-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.dpg-nav__spacer {
  flex: 1;
}

@media (max-width: 26rem) {
  .dpg-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .dpg-nav .dpg-btn {
    width: 100%;
  }

  .dpg-nav__spacer {
    display: none;
  }
}

/* --------------------------------------------------------------- review --- */

.dpg-review {
  margin: 0 0 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.dpg-review__row {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1.1rem;
  background: var(--paper);
}

.dpg-review__row + .dpg-review__row {
  border-top: 1px solid var(--line);
}

.dpg-review__key {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0;
}

.dpg-review__value {
  margin: 0;
  overflow-wrap: anywhere;
}

.dpg-review__value ul {
  margin: 0;
  padding-left: 1.1rem;
}

@media (max-width: 32rem) {
  .dpg-review__row {
    grid-template-columns: 1fr auto;
  }

  .dpg-review__key {
    grid-column: 1 / -1;
  }
}

.dpg-submit-note {
  font-size: 0.92rem;
  color: var(--ink-faint);
  margin: 0.9rem 0 0;
}

/* ----------------------------------------------------------- generating --- */

.dpg-generating {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.dpg-generating__spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--cobalt);
  animation: dpg-spin 900ms linear infinite;
}

@keyframes dpg-spin {
  to {
    transform: rotate(360deg);
  }
}

.dpg-generating__message {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  min-height: 1.6em;
  margin-bottom: 0.5rem;
}

.dpg-generating__note {
  font-size: 0.95rem;
  color: var(--ink-faint);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dpg-generating__spinner {
    animation-duration: 3s;
  }

  .dpg-progress__fill,
  .dpg-btn {
    transition: none;
  }
}

/* ----------------------------------------------------- result / failure --- */

.dpg-result__badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-wash);
  border: 1px solid var(--ok);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  margin-bottom: 1rem;
}

/* An arch, like the one on the cover, drawn in CSS: shown when the buyer's own
   cover picture is not there (rendering is best-effort, and it is deleted with the PDF). */
.dpg-result__arch {
  display: block;
  width: 3.5rem;
  height: 4.5rem;
  margin-bottom: 1.25rem;
  background: var(--blush);
  border-radius: 1.75rem 1.75rem 0 0;
  border-bottom: 4px solid var(--sun);
}

.dpg-result__cover {
  display: block;
  width: min(15rem, 62%);
  height: auto;
  margin: 0 0 1.5rem;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(22, 24, 43, 0.22);
}

.dpg-result__title {
  margin-bottom: 0.6em;
}

.dpg-result__gift-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--cobalt-deep);
  margin-bottom: 1rem;
}

.dpg-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0 1.25rem;
}

@media (max-width: 32rem) {
  .dpg-result__actions .dpg-btn {
    width: 100%;
  }
}

.dpg-status {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.dpg-status--ok {
  background: var(--ok-wash);
  border: 1px solid var(--ok);
  color: var(--ok);
}

.dpg-status--warn {
  background: var(--gold-wash);
  border: 1px solid var(--gold);
  color: #5c4500;
}

.dpg-status p {
  margin: 0;
}

.dpg-failure__title {
  color: var(--danger);
}

.dpg-failure__message {
  color: var(--ink);
}

.dpg-failure__preserved {
  color: var(--ink-faint);
  font-size: 0.95rem;
}

.dpg-aside {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* The same "what we made" note appears under an h3 on the result view and an
   h2 on the already-created page; both should read as a quiet sub-heading. */
.dpg-aside h2,
.dpg-aside h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.dpg-aside p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------- standalone page --- */

.dpg-centered {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem;
  background: var(--paper-sunken);
}

.dpg-centered__inner {
  max-width: 32rem;
}

.dpg-centered .dpg-result__arch {
  margin-left: auto;
  margin-right: auto;
}

.dpg-centered p {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- legal ------ */

/* The privacy notice (/privacy). Long-form prose, one narrow column. */

.dpg-footer__link {
  color: var(--ink-faint);
}

.dpg-footer__link:hover,
.dpg-footer__link:focus-visible {
  color: var(--cobalt-deep);
}

.dpg-legal__updated {
  margin: -0.35rem 0 1.75rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

.dpg-legal__section {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.35rem;
  margin-top: 1.85rem;
  max-width: 46rem;
}

.dpg-legal__section h2 {
  font-size: 1.4rem;
  margin: 0 0 0.6rem;
}

.dpg-legal__section p {
  font-family: var(--font-text);
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.dpg-legal__list {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
  font-family: var(--font-text);
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.dpg-legal__list li {
  margin-bottom: 0.7rem;
}

.dpg-legal__mail {
  word-break: break-word;
}

/* --------------------------------------------- preview and edit the text --- */
/* Only rendered while config `site.preview_edit` is on (personalize.html). */

.dpg-consent {
  margin: 1.4rem 0 1.1rem;
  padding: 0.95rem 1rem;
  background: var(--accent-wash);
  border-radius: var(--radius);
}

.dpg-consent__label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.45;
}

.dpg-consent__box {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.1rem 0 0;
  accent-color: var(--cobalt);
}

.dpg-consent__box:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* « Vous préférez ne pas cocher cette case ? », aligned with the label text. */
.dpg-consent__decline {
  margin: 0.6rem 0 0 2.1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* « Me rétracter »: quiet, under the form and the draft (personalize.html). */
.dpg-withdraw {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.dpg-withdraw__confirm {
  margin-top: 0.5rem;
}

.dpg-withdraw__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.dpg-withdraw__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dpg-draft__title {
  margin-top: 0;
}

textarea.dpg-input {
  display: block;
  min-height: 3.1rem;
  line-height: 1.5;
  resize: vertical;
  overflow: hidden;
}

.dpg-field__counter {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
  text-align: right;
}

.dpg-field__counter[data-over="true"] {
  color: var(--danger);
  font-weight: 600;
}

.dpg-draft__autosave {
  min-height: 1.4em;
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.dpg-draft__more {
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-strong);
}

.dpg-draft__option .dpg-field__hint {
  margin: 0.4rem 0 0;
}
