/* L'ancien appel d'installation reste dans le thème comme solution de repli,
   mais cette interface unique évite les doublons et l'ambiguïté App Store. */
[data-oni-app-install-trigger],
[data-oni-app-install] {
  display: none !important;
}

.c127-app {
  --c127-night: #080b17;
  --c127-panel: #10162a;
  --c127-ivory: #f2eadc;
  --c127-gold: #dfc27d;
  --c127-muted: #b8bfd0;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  isolation: isolate;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.c127-app[hidden],
.c127-app__trigger[hidden],
.c127-app__dialog[hidden] {
  display: none !important;
}

/* Protection indépendante du JavaScript et de son éventuel cache. */
@media (display-mode: standalone) {
  .c127-app__trigger,
  .c127-app__dialog {
    display: none !important;
  }
}

.c127-app__actions {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 8px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.c127-app__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 13px 7px 8px;
  border: 1px solid rgba(167, 152, 238, .38);
  border-radius: 999px;
  color: var(--c127-ivory);
  background: rgba(16, 22, 42, .96);
  box-shadow: 0 11px 28px rgba(0, 0, 0, .32);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  pointer-events: auto;
  touch-action: manipulation;
}

.c127-app__account:hover,
.c127-app__account:focus-visible {
  border-color: #a798ee;
  color: var(--c127-ivory);
  transform: translateY(-1px);
}

.c127-app__account-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #d8cff9;
  background: rgba(167, 152, 238, .14);
}

.c127-app__account-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c127-app__trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: calc(100vw - 40px);
  min-height: 58px;
  padding: 8px 17px 8px 9px;
  border: 1px solid rgba(223, 194, 125, .42);
  border-radius: 20px;
  color: var(--c127-ivory);
  background: rgba(8, 11, 23, .96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  text-align: left;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.c127-app__trigger:hover,
.c127-app__trigger:focus-visible {
  border-color: var(--c127-gold);
  transform: translateY(-2px);
}

.c127-app__icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #241a2e;
  background: linear-gradient(145deg, #f4dfa5, #cfaa60);
}

.c127-app__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c127-app__copy {
  display: grid;
  gap: 2px;
}

.c127-app__copy strong {
  color: var(--c127-ivory);
  font-size: .82rem;
  line-height: 1.2;
}

.c127-app__copy small {
  color: var(--c127-muted);
  font-size: .66rem;
  line-height: 1.25;
}

.c127-app__dialog {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .22s ease;
}

.c127-app__dialog.is-open {
  opacity: 1;
}

.c127-app__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 4, 10, .76);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.c127-app__sheet {
  position: relative;
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 30px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(223, 194, 125, .3);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  outline: 0;
  color: var(--c127-muted);
  background: radial-gradient(circle at 10% 0, rgba(167, 152, 238, .15), transparent 42%), var(--c127-panel);
  box-shadow: 0 -28px 72px rgba(0, 0, 0, .5);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.c127-app__dialog.is-open .c127-app__sheet {
  transform: translateY(0);
}

.c127-app__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(242, 234, 220, .14);
  border-radius: 50%;
  color: var(--c127-ivory);
  background: rgba(255, 255, 255, .04);
  font-size: 1.45rem;
  cursor: pointer;
  touch-action: manipulation;
}

.c127-app__eyebrow {
  margin: 0 42px 7px 0;
  color: var(--c127-gold);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.c127-app__sheet h2 {
  margin: 0;
  color: var(--c127-ivory);
  font: 500 clamp(1.65rem, 7vw, 2.2rem)/1.04 "Cormorant Garamond", Georgia, serif;
}

.c127-app__intro {
  margin: 12px 0 20px;
  color: var(--c127-muted);
  font-size: .86rem;
  line-height: 1.6;
}

.c127-app__steps {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px 16px 16px 38px;
  border: 1px solid rgba(167, 152, 238, .26);
  border-radius: 16px;
  background: rgba(167, 152, 238, .07);
  color: #d0cfdd;
  font-size: .82rem;
  line-height: 1.5;
}

.c127-app__fallback {
  margin: 0 0 20px;
  padding: 15px 16px;
  border: 1px solid rgba(167, 152, 238, .26);
  border-radius: 16px;
  background: rgba(167, 152, 238, .07);
  color: #d0cfdd;
  font-size: .82rem;
  line-height: 1.55;
}

.c127-app__primary,
.c127-app__secondary,
.c127-app__installed {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  font: 800 .82rem/1 "Manrope", system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.c127-app__primary {
  border: 0;
  color: #251b31;
  background: linear-gradient(135deg, #f2dea8, var(--c127-gold));
  box-shadow: 0 12px 30px rgba(223, 194, 125, .2);
}

.c127-app__secondary {
  margin-top: 6px;
  border: 0;
  color: #9da6ba;
  background: transparent;
}

.c127-app__installed {
  min-height: 38px;
  margin-top: 2px;
  border: 0;
  color: #c9c1e8;
  background: transparent;
  font-size: .72rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.c127-app__installed:hover,
.c127-app__installed:focus-visible {
  color: var(--c127-ivory);
}

.c127-app-open {
  overflow: hidden;
}

/* ── Espace compte, entièrement isolé du thème ── */
.c127-account {
  --c127-account-night: #080b17;
  --c127-account-panel: #10162a;
  --c127-account-ivory: #f2eadc;
  --c127-account-gold: #dfc27d;
  --c127-account-muted: #b8bfd0;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px) 0 clamp(40px, 7vw, 84px);
  color: var(--c127-account-ivory);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.c127-account__header {
  max-width: 690px;
  margin: 0 auto 30px;
  text-align: center;
}

.c127-account__eyebrow,
.c127-account__step {
  margin: 0 0 8px;
  color: var(--c127-account-gold);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.c127-account__header h2,
.c127-account--member h2 {
  margin: 0;
  color: var(--c127-account-ivory);
  font: 500 clamp(2rem, 6vw, 3.5rem)/1.02 "Cormorant Garamond", Georgia, serif;
}

.c127-account__header > p:last-child,
.c127-account--member > p:not(.c127-account__eyebrow) {
  margin: 14px 0 0;
  color: var(--c127-account-muted);
  line-height: 1.65;
}

.c127-account__notice {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 16px 19px;
  border: 1px solid rgba(232, 127, 127, .38);
  border-radius: 15px;
  color: #ffd4d4;
  background: rgba(158, 56, 56, .14);
  font-size: .85rem;
}

.c127-account__notice ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.c127-account__grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  max-width: 940px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(223, 194, 125, .24);
  border-radius: 28px;
  background: rgba(8, 11, 23, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.c127-account__card {
  padding: clamp(26px, 4.5vw, 48px);
}

.c127-account__card--register {
  background: radial-gradient(circle at 10% 0, rgba(167, 152, 238, .15), transparent 64%);
}

.c127-account__card--login {
  border-left: 1px solid rgba(223, 194, 125, .18);
  background: radial-gradient(circle at 90% 0, rgba(223, 194, 125, .1), transparent 62%);
}

.c127-account__card h2 {
  margin: 0;
  color: var(--c127-account-ivory);
  font: 500 clamp(1.65rem, 4vw, 2.15rem)/1.05 "Cormorant Garamond", Georgia, serif;
}

.c127-account__card > p:not(.c127-account__step) {
  min-height: 3em;
  margin: 10px 0 0;
  color: var(--c127-account-muted);
  font-size: .84rem;
  line-height: 1.55;
}

.c127-account form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.c127-account form > label:not(.c127-account__check) {
  margin-top: 7px;
  color: var(--c127-account-ivory);
  font-size: .74rem;
  font-weight: 700;
}

.c127-account input[type="text"],
.c127-account input[type="email"],
.c127-account input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(242, 234, 220, .18);
  border-radius: 12px;
  outline: 0;
  color: var(--c127-account-ivory);
  background: rgba(255, 255, 255, .045);
  font: 500 .88rem/1.3 "Manrope", system-ui, sans-serif;
}

.c127-account input[type="text"]:focus,
.c127-account input[type="email"]:focus,
.c127-account input[type="password"]:focus {
  border-color: var(--c127-account-gold);
  box-shadow: 0 0 0 3px rgba(223, 194, 125, .12);
}

.c127-account form > small {
  color: #8992a8;
  font-size: .68rem;
}

.c127-account__check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 11px 0 4px;
  color: var(--c127-account-muted);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.5;
}

.c127-account__check input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--c127-account-gold);
}

.c127-account__check a,
.c127-account__text-link {
  color: #ead79f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.c127-account__check--short {
  margin-top: 13px;
}

.c127-account__honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
}

.c127-account__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 9px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #251b31;
  background: linear-gradient(135deg, #f2dea8, var(--c127-account-gold));
  box-shadow: 0 12px 30px rgba(223, 194, 125, .16);
  font: 800 .8rem/1 "Manrope", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.c127-account__button:hover,
.c127-account__button:focus-visible {
  color: #251b31;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.c127-account__text-link {
  justify-self: center;
  margin-top: 9px;
  font-size: .73rem;
}

.c127-account--member {
  max-width: 720px;
  padding: clamp(34px, 7vw, 72px);
  border: 1px solid rgba(223, 194, 125, .22);
  border-radius: 28px;
  text-align: center;
  background: radial-gradient(circle at 50% 0, rgba(167, 152, 238, .14), transparent 65%), rgba(8, 11, 23, .94);
}

.c127-account__member-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 360px;
  margin: 27px auto 0;
}

@media (max-width: 760px) {
  .c127-app__actions {
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 28px);
  }

  .c127-account__grid {
    grid-template-columns: 1fr;
  }

  .c127-account__card--login {
    border-top: 1px solid rgba(223, 194, 125, .18);
    border-left: 0;
  }

  .c127-account__card > p:not(.c127-account__step) {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .c127-app__trigger {
    padding-right: 13px;
  }

  .c127-app__actions {
    justify-items: stretch;
  }

  .c127-app__account {
    justify-self: end;
  }

  .c127-app__copy small {
    display: none;
  }

  .c127-app__sheet {
    padding-inline: 19px;
  }

  .c127-account__card {
    padding-inline: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .c127-app__trigger,
  .c127-app__account,
  .c127-app__dialog,
  .c127-app__sheet,
  .c127-account__button {
    transition: none;
  }
}
