/* L'Écho du Temps V2 : accès visiteur et fenêtre « Franchir le seuil » */
.top-actions {
  align-items: center;
  flex-wrap: wrap;
}

.gateway-button {
  min-width: 156px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(210, 173, 112, .62);
  color: #e4c98f;
  background:
    linear-gradient(180deg, rgba(210, 173, 112, .085), rgba(45, 29, 12, .06)),
    rgba(13, 11, 8, .38);
  box-shadow: inset 0 0 0 1px rgba(255, 232, 183, .025);
  transition: border-color .22s ease, background .22s ease, color .22s ease,
              box-shadow .22s ease, transform .22s ease;
}
.gateway-button:hover,
.gateway-button:focus-visible {
  border-color: rgba(235, 204, 143, .9);
  color: #f1dba9;
  background:
    linear-gradient(180deg, rgba(210, 173, 112, .15), rgba(65, 41, 14, .09)),
    rgba(18, 14, 9, .58);
  box-shadow: 0 0 20px rgba(185, 139, 66, .09), inset 0 0 0 1px rgba(255, 232, 183, .045);
  transform: translateY(-1px);
  outline: none;
}
.gateway-button:active { transform: translateY(0); }

body.threshold-awake .app-shell {
  filter: brightness(.48) saturate(.72);
  transform: scale(1.002);
  transition: filter .46s ease, transform .46s ease;
}
body.threshold-awake .brand-mark {
  color: #edc97e;
  text-shadow: 0 0 16px rgba(224,177,88,.66), 0 0 38px rgba(185,139,66,.28);
}

.threshold-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 42px 46px 34px;
  border: 1px solid rgba(203,157,81,.52);
  border-radius: 2px;
  color: #e9dfcc;
  background:
    radial-gradient(circle at 50% -8%, rgba(145,95,31,.2), transparent 34%),
    linear-gradient(145deg, #1c150e, #090807 72%);
  box-shadow: 0 34px 100px rgba(0,0,0,.84), inset 0 0 0 1px rgba(255,229,170,.045);
  text-align: center;
  overflow: visible;
}
.threshold-dialog::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(203,157,81,.13);
  pointer-events: none;
}
.threshold-dialog::backdrop {
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(2px);
}
.threshold-dialog[open] { animation: threshold-rise .38s cubic-bezier(.2,.75,.2,1); }
@keyframes threshold-rise {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.threshold-dialog.is-closing { animation: threshold-fall .22s ease forwards; }
@keyframes threshold-fall {
  to { opacity: 0; transform: translateY(7px) scale(.992); }
}
.threshold-close {
  position: absolute;
  z-index: 2;
  right: 16px;
  top: 11px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: rgba(232,223,207,.52);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease, transform .2s ease;
}
.threshold-close:hover { color: #ecd39f; transform: rotate(4deg); }

/* Serrure dessinée en CSS, sans emoji ni rupture visuelle. */
.threshold-lock {
  position: relative;
  margin: 0 auto 15px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210,173,112,.34);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185,139,66,.17), rgba(20,13,7,.72) 68%);
  box-shadow: 0 0 34px rgba(185,139,66,.16), inset 0 0 0 5px rgba(0,0,0,.08);
}
.threshold-lock::before {
  content: '';
  width: 17px;
  height: 21px;
  border: 1px solid rgba(230,197,130,.78);
  border-radius: 9px 9px 3px 3px;
  transform: translateY(-2px);
  box-shadow: inset 0 0 9px rgba(185,139,66,.13);
}
.threshold-lock::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 29px;
  width: 4px;
  height: 10px;
  border-radius: 3px 3px 1px 1px;
  background: #caa35c;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(220,177,92,.3);
}
.threshold-lock span {
  position: absolute;
  top: 12px;
  width: 13px;
  height: 10px;
  border: 1px solid rgba(230,197,130,.72);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.threshold-kicker { margin:0; color:#b99055; font-size:9px; letter-spacing:.25em; text-transform:uppercase; }
.threshold-dialog h2 { margin:8px 0 6px; color:#ead3a3; font:30px Georgia,serif; }
.threshold-motto { margin:0 0 22px; color:rgba(232,223,207,.62); font:italic 14px Georgia,serif; }
.threshold-intro { margin:0 auto 20px; max-width:440px; line-height:1.65; }
.threshold-list { margin:0 auto 24px; padding:0; max-width:430px; list-style:none; text-align:left; }
.threshold-list li { position:relative; padding:7px 0 7px 24px; color:rgba(232,223,207,.78); font-size:13px; }
.threshold-list li::before { content:'✓'; position:absolute; left:0; color:#c9a45f; }
.threshold-price { display:flex; flex-direction:column; gap:4px; margin:4px 0 18px; }
.threshold-price strong { color:#f0d49b; font:34px Georgia,serif; }
.threshold-price span { color:rgba(232,223,207,.62); font-size:11px; }
.threshold-pay { display:inline-flex; min-width:210px; justify-content:center; text-decoration:none; }
.threshold-pay.is-disabled { pointer-events:none; opacity:.5; }
.threshold-secure { margin:12px 0 0; color:rgba(232,223,207,.42); font-size:9px; }

@media (max-width: 700px) {
  .top-actions { width: 100%; }
  .gateway-button { flex: 1 1 150px; }
  .threshold-dialog { padding: 38px 24px 29px; }
}

@media (prefers-reduced-motion: reduce) {
  .gateway-button,
  body.threshold-awake .app-shell,
  .threshold-dialog[open],
  .threshold-dialog.is-closing { animation: none; transition: none; }
}

.threshold-test-mode {
  margin: 10px 0 0;
  color: rgba(222, 190, 126, .66);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Alerte importante : adresse e-mail déjà associée à un accès */
.threshold-checkout-error {
  position: relative;
  margin: 14px 0 16px;
  padding: 14px 16px 14px 44px;
  border: 1px solid rgba(218, 156, 91, .72);
  border-radius: 3px;
  color: #f3dfc5;
  background:
    linear-gradient(180deg, rgba(129, 57, 35, .28), rgba(72, 31, 22, .20)),
    rgba(18, 12, 9, .86);
  box-shadow:
    0 0 22px rgba(151, 67, 38, .12),
    inset 0 0 0 1px rgba(255, 218, 166, .035);
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.55;
  text-align: left;
}

.threshold-checkout-error::before {
  content: '!';
  position: absolute;
  left: 15px;
  top: 50%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 178, 109, .78);
  border-radius: 50%;
  color: #efc27f;
  font: 700 12px/1 Georgia, serif;
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(207, 142, 67, .14);
}


/* Tarif réellement applicable dans la fenêtre « Franchir le seuil ». */
.threshold-price-panel {
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid rgba(185,139,66,.28);
  background: linear-gradient(180deg, rgba(37,26,14,.48), rgba(12,10,8,.35));
  text-align: center;
}
.threshold-price-panel[data-kind="preferential"],
.threshold-price-panel[data-kind="teaser"] {
  border-color: rgba(220,177,92,.55);
  box-shadow: inset 0 0 28px rgba(185,139,66,.07), 0 0 22px rgba(185,139,66,.06);
}
.threshold-price-explanation { margin: 7px auto 5px; max-width: 490px; color: rgba(232,223,207,.72); font-size: 13px; line-height: 1.55; }
.threshold-price-confirmation { margin: 4px 0 0; color: rgba(232,223,207,.48); font-size: 10px; }
.threshold-founding-progress.is-hidden { display: none; }
.threshold-price-panel.is-checking { opacity: .65; }

/* Invitation facultative au teaser, avant toute vérification d'accès. */
#thresholdIdentifyForm .threshold-teaser-invitation {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 60px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(210, 173, 112, .28);
  border-radius: 6px;
  background: rgba(185, 139, 66, .045);
  color: #d9bd87;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
#thresholdIdentifyForm .threshold-teaser-invitation:hover,
#thresholdIdentifyForm .threshold-teaser-invitation:focus-visible {
  border-color: #d2ad70;
  background: rgba(185, 139, 66, .11);
}
#thresholdIdentifyForm .threshold-teaser-invitation:focus-visible {
  outline: 2px solid #d2ad70;
  outline-offset: 3px;
}
.threshold-teaser-envelope { font-size: 26px; line-height: 1; color: #d2ad70; }
.threshold-teaser-copy { min-width: 0; }
.threshold-teaser-copy strong { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; }
.threshold-teaser-copy > span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; color: #d1c3aa; }

/* Le formulaire reste parcourable, y compris sur une tablette peu haute. */
.threshold-dialog.threshold-dialog-v2.threshold-has-teaser-invitation { overflow-y: auto; }
@media (prefers-reduced-motion: reduce) {
  #thresholdIdentifyForm .threshold-teaser-invitation { transition: none; }
}

/* Espaces équilibrés autour de l'invitation, sur tous les formats. */
.threshold-has-teaser-invitation #thresholdIdentifyForm > .access-form-note { margin: 0; }
.threshold-has-teaser-invitation #thresholdIdentifyMessage:empty { display: none; }
#thresholdIdentifyForm .threshold-teaser-invitation { margin-block: 16px; }
