:root {
  --n1-navy: #12324a;
  --n1-gold: #c7a15b;
  --n1-bg: #f5f4f0;
  --n1-text: #222d35;
  --n1-muted: #6b747b;
  --n1-border: rgba(18, 50, 74, .14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body.rdh-niveau-1-body {
  background: var(--n1-bg);
  color: var(--n1-text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

.rdh-n1-page {
  min-height: 100vh;
}

.rdh-n1-brand {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid rgba(18, 50, 74, .10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
}

.rdh-n1-brand img {
  display: block;
  width: auto;
  max-width: 260px;
  max-height: 48px;
}

.rdh-n1-shell {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.rdh-n1-intro {
  margin-bottom: 24px;
  text-align: center;
}

.rdh-n1-kicker {
  color: var(--n1-gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 6px;
}

.rdh-n1-intro h1 {
  margin: 0;
  color: var(--n1-navy);
  font-size: clamp(28px, 3vw, 39px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.rdh-n1-intro p {
  max-width: 650px;
  margin: 12px auto 0;
  color: var(--n1-muted);
  font-size: 15px;
  line-height: 1.55;
}

.rdh-n1-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 20px;
  align-items: stretch;
}

.rdh-n1-card {
  background: #fff;
  border: 1px solid var(--n1-border);
  border-radius: 18px;
  padding: 25px;
  box-shadow:
    0 8px 28px
    rgba(18, 50, 74, .06);
  height: 100%;
}

.rdh-n1-search-card,
.rdh-n1-qr-card {
  display: flex;
  flex-direction: column;
}

.rdh-n1-search-top {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.rdh-n1-card h2 {
  margin: 0 0 5px;
  color: var(--n1-navy);
  font-size: 21px;
}

.rdh-n1-card-intro {
  margin: 0 0 20px;
  color: var(--n1-muted);
  font-size: 14px;
  line-height: 1.45;
}

.rdh-n1-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--n1-navy);
  font-size: 14px;
  font-weight: 750;
}

.rdh-n1-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.rdh-n1-search-row input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid rgba(18, 50, 74, .22);
  border-radius: 11px;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
}

.rdh-n1-search-row input:focus {
  border-color: var(--n1-navy);
  box-shadow:
    0 0 0 3px
    rgba(18, 50, 74, .07);
}

.rdh-n1-search-button {
  height: 48px;
  border: 0;
  border-radius: 11px;
  padding: 0 19px;
  background: var(--n1-navy);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.rdh-n1-search-button:disabled {
  opacity: .55;
}

.rdh-n1-message {
  min-height: 18px;
  margin: 9px 0 0;
  font-size: 13px;
}

.rdh-n1-message.is-loading {
  color: var(--n1-muted);
}

.rdh-n1-message.is-error {
  color: #a53b36;
}

.rdh-n1-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rdh-n1-results-title {
  margin: 3px 0 2px;
  color: var(--n1-navy);
  font-size: 13px;
  font-weight: 800;
}

.rdh-n1-result-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--n1-border);
  background: #fff;
  border-radius: 11px;
  padding: 11px 13px;
  cursor: pointer;
  transition:
    border-color .15s ease,
    background .15s ease;
}

.rdh-n1-result-button:hover {
  border-color: rgba(18, 50, 74, .35);
  background: #fafaf8;
}

.rdh-n1-result-button strong {
  display: block;
  color: var(--n1-navy);
  font-size: 14px;
  margin-bottom: 3px;
}

.rdh-n1-result-button span {
  display: block;
  color: var(--n1-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rdh-n1-selection {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--n1-border);
}

.rdh-n1-selection[hidden] {
  display: none;
}

.rdh-n1-selection-label {
  color: var(--n1-navy);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 5px;
}

.rdh-n1-selection-address {
  color: var(--n1-navy);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  margin-top: 4px;
}

.rdh-n1-main-button,
.rdh-n1-download {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.rdh-n1-main-button {
  margin-top: 14px;
  background: var(--n1-navy);
  color: #fff;
}

.rdh-n1-main-button:disabled {
  opacity: .45;
  cursor: default;
}

.rdh-n1-edit-address {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--n1-navy);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  align-self: flex-start;
}

.rdh-n1-privacy {
  margin-top: auto;
  padding: 13px 14px;
  background: #f7f6f2;
  border-left: 3px solid var(--n1-gold);
  border-radius: 8px;
  color: var(--n1-muted);
  font-size: 12px;
  line-height: 1.45;
}

.rdh-n1-privacy strong {
  color: var(--n1-navy);
}

.rdh-n1-qr-card {
  justify-content: flex-start;
}

.rdh-n1-placeholder {
  min-height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.rdh-n1-placeholder[hidden] {
  display: none;
}

.rdh-n1-placeholder-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 15px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--n1-navy);
  color: #fff;
  font-size: 31px;
}

.rdh-n1-placeholder h2 {
  margin-bottom: 7px;
}

.rdh-n1-placeholder p {
  margin: 0;
  color: var(--n1-muted);
  font-size: 14px;
  line-height: 1.45;
}

.rdh-n1-result {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.rdh-n1-result[hidden] {
  display: none;
}

.rdh-n1-qrcode {
  width: 248px;
  height: 248px;
  max-width: 100%;
  margin: 18px auto 22px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.rdh-n1-qrcode canvas,
.rdh-n1-qrcode img {
  display: block;
  width: 100% !important;
  height: auto !important;
}

.rdh-n1-download {
  margin-top: auto;
  background: var(--n1-gold);
  color: #172a37;
}

.rdh-n1-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 16px 3px 0;
  border-top: 1px solid var(--n1-border);
  color: var(--n1-muted);
  font-size: 12px;
}

.rdh-n1-footer a {
  color: var(--n1-navy);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 800px) {

  .rdh-n1-brand {
    height: 66px;
  }

  .rdh-n1-brand img {
    max-height: 43px;
    max-width: 230px;
  }

  .rdh-n1-shell {
    width: min(100% - 24px, 620px);
    padding-top: 25px;
  }

  .rdh-n1-grid {
    grid-template-columns: 1fr;
  }

  .rdh-n1-card {
    height: auto;
  }

  .rdh-n1-selection-address {
    font-size: 17px;
    line-height: 1.42;
  }

  .rdh-n1-edit-address {
    font-size: 17px;
  }

  .rdh-n1-qrcode {
    width: min(248px, 100%);
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 520px) {

  .rdh-n1-intro {
    text-align: left;
  }

  .rdh-n1-intro h1 {
    font-size: 29px;
  }

  .rdh-n1-card {
    padding: 20px 16px;
  }

  .rdh-n1-search-row {
    grid-template-columns: 1fr;
  }

  .rdh-n1-search-button {
    width: 100%;
  }

  .rdh-n1-selection-address {
    font-size: 16px;
    line-height: 1.4;
  }

  .rdh-n1-edit-address {
    font-size: 16px;
  }

  .rdh-n1-footer {
    flex-direction: column;
    gap: 10px;
  }
}

/* ============================================================
   HEBERGEMENT 2
   SECURITE ESPACEMENTS DES ETATS INTERMEDIAIRES
   ============================================================ */

/*
 * Le contenu haut garde toujours une vraie respiration
 * avant le pavé de confidentialité.
 */
.rdh-n1-search-top {
  flex: 0 0 auto;
}

/*
 * Le pavé du bas ne doit jamais remonter contre
 * l'adresse ou le lien Modifier l'adresse.
 */
.rdh-n1-privacy {
  margin-top: 28px;
}

/*
 * L'adresse sélectionnée peut passer sur plusieurs lignes
 * sans heurter les éléments suivants.
 */
.rdh-n1-selection-address {
  margin-bottom: 4px;
}

/*
 * Espacement stable sous le bouton principal.
 */
.rdh-n1-main-button {
  margin-bottom: 2px;
}

/*
 * Modifier l'adresse garde son propre espace vertical.
 */
.rdh-n1-edit-address {
  display: inline-block;
  margin-top: 16px;
  margin-bottom: 4px;
  line-height: 1.3;
}

/*
 * Sur desktop, les deux cartes restent de même hauteur,
 * mais le contenu gauche n'est plus artificiellement tassé.
 */
@media (min-width: 801px) {

  .rdh-n1-search-card {
    justify-content: flex-start;
  }

  .rdh-n1-privacy {
    margin-top: 28px;
  }
}


/*
 * Sur mobile/tablette on laisse tout s'écouler naturellement.
 */
@media (max-width: 800px) {

  .rdh-n1-privacy {
    margin-top: 24px;
  }

  .rdh-n1-edit-address {
    margin-top: 14px;
  }
}


/* ============================================================
   HEBERGEMENT 2
   SUPPRESSION SURTITRE + REMONTEE INTRO
   ============================================================ */

.rdh-n1-shell {
  padding-top: 20px;
}

.rdh-n1-intro {
  margin-top: 0;
}

.rdh-n1-intro h1 {
  margin-top: 0;
}

@media (max-width: 800px) {
  .rdh-n1-shell {
    padding-top: 16px;
  }
}


/* ============================================================
   HEBERGEMENT 2 - LOGO HEADER ALIGNE SUR HI
   ============================================================ */

.rdh-n1-brand img {
  max-width: 255px;
  max-height: 68px;
}

@media (max-width: 800px) {
  .rdh-n1-brand img {
    max-width: 245px;
    max-height: 60px;
  }
}



/*
 * ============================================================
 * RDH_H2_POSTER_PREVIEW_V1
 * Aperçu du gabarit QR complet.
 * ============================================================
 */

.rdh-n1-qrcode {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.rdh-n1-poster-preview-canvas {
  display: block;
  width: 100%;
  max-width: 430px;
  height: auto;
  border-radius: 8px;
  box-shadow:
    0 8px 26px rgba(16, 43, 87, 0.10);
}

/* === FIN RDH_H2_POSTER_PREVIEW_V1 === */


/*
 * ============================================================
 * RDH_H2_PREVIEW_COMPACT_V1
 * ============================================================
 */

.rdh-n1-result .rdh-n1-qrcode {
  margin-top: 4px;
}

.rdh-n1-download {
  width: min(100%, 330px) !important;
  padding: 11px 18px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  margin-top: 14px !important;
}

/* === FIN RDH_H2_PREVIEW_COMPACT_V1 === */

/*
 * ============================================================
 * RDH_H2_DOWNLOAD_POSITION_FINAL_V1
 * Bouton sous l'aperçu, sans chevauchement
 * ============================================================
 */

.rdh-n1-result {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rdh-n1-result .rdh-n1-qrcode {
  margin-bottom: 12px !important;
}

.rdh-n1-download {
  position: static !important;
  width: auto !important;
  min-width: 260px;
  max-width: 310px;
  padding: 10px 22px !important;
  margin: 0 auto 10px !important;
  transform: none !important;
  font-size: 14px !important;
}

/* === FIN RDH_H2_DOWNLOAD_POSITION_FINAL_V1 === */


/*
 * ============================================================
 * RDH_H2_PREVIEW_NATURAL_HEIGHT_V1
 * Le conteneur prend désormais la hauteur réelle de l'affiche.
 * ============================================================
 */

.rdh-n1-result .rdh-n1-qrcode {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;

  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  margin: 4px auto 14px !important;
}

.rdh-n1-result .rdh-n1-poster-preview-canvas {
  position: static !important;
  display: block !important;
  width: min(100%, 300px) !important;
  max-width: 300px !important;
  height: auto !important;
  margin: 0 auto !important;
  transform: none !important;
}

.rdh-n1-result .rdh-n1-download {
  position: static !important;
  display: block !important;

  width: auto !important;
  min-width: 235px !important;
  max-width: 280px !important;

  margin: 10px auto 14px !important;
  padding: 9px 18px !important;

  transform: none !important;
  font-size: 13px !important;
}

/* === FIN RDH_H2_PREVIEW_NATURAL_HEIGHT_V1 === */


/* ============================================================
   NIVEAU 1
   SELECTEUR DE PAGE
   ============================================================ */

.rdh-n1-field select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;

  border:
    1px solid
    rgba(18, 50, 74, .22);

  border-radius: 11px;

  padding:
    0
    42px
    0
    14px;

  background: #fff;

  color:
    var(--n1-text);

  font-size: 16px;

  outline: none;
}

.rdh-n1-field select:focus {
  border-color:
    var(--n1-navy);

  box-shadow:
    0 0 0 3px
    rgba(18, 50, 74, .07);
}

.rdh-n1-main-button {
  margin-top: 18px;
}

/*
 * L'aperçu reste strictement dans
 * les proportions du gabarit Niveau 2.
 */

.rdh-n1-result .rdh-n1-poster-preview-canvas {
  position: static !important;

  display: block !important;

  width:
    min(100%, 300px) !important;

  max-width:
    300px !important;

  height:
    auto !important;

  margin:
    0 auto !important;

  transform:
    none !important;
}
