:root {
  --pricing-green: #1f3b2d;
  --pricing-mid: #44735a;
  --pricing-mint: #d2f7d2;
  --pricing-page: #f5f7f2;
  --pricing-line: #d7dfd5;
  --cost-social: #7fcb86;
  --cost-server: #4f7cac;
  --cost-payment: #c59aff;
  --cost-future: #f1bd63;
  --cost-development: #d7705f;
}

[hidden] { display: none !important; }

.pricing-page { min-height: 100vh; padding-bottom: calc(6rem + env(safe-area-inset-bottom)); background: var(--pricing-page); }
.pricing-header {
  position: relative;
  min-height: 570px;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 24, 35, .62) 0%, rgba(7, 24, 35, .24) 52%, rgba(7, 24, 35, .1) 100%),
    url("assets/tarification-paroisses-pilotes.png") center 56% / cover no-repeat;
}
.pricing-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 170px;
  background: linear-gradient(transparent, rgba(4, 20, 26, .28));
  pointer-events: none;
}
.pricing-page .topbar { z-index: 3; }
.pricing-page .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.pricing-hero {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 150px 0 72px;
}
.pricing-hero h1 {
  width: fit-content;
  max-width: 790px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .34);
  font: 400 clamp(3.2rem, 8vw, 6.2rem)/.96 "DM Serif Display", Georgia, serif;
}
.pricing-title-line {
  width: fit-content;
  display: block;
}
.pricing-title-line::after {
  content: "";
  width: 100%;
  height: 3px;
  display: block;
  margin-top: .08em;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.22, .72, .18, 1);
}
@media (hover: hover) {
  .pricing-hero h1:hover .pricing-title-line::after { transform: scaleX(1); }
  .pricing-hero h1:hover .pricing-title-line:nth-child(2)::after { transition-delay: .15s; }
  .pricing-hero h1:hover .pricing-title-line:nth-child(3)::after { transition-delay: .3s; }
}
.pilot-program {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 58px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 54px;
  border-bottom: 1px solid var(--pricing-line);
}
.pilot-program h2 {
  max-width: 720px;
  margin: 0;
  color: var(--pricing-green);
  font: 400 clamp(2.1rem, 4vw, 3.6rem)/1.02 "DM Serif Display", Georgia, serif;
}
.pilot-copy { align-self: end; }
.pilot-copy p { margin: 0 0 18px; color: #526057; }
.pilot-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 17px;
  color: var(--pricing-green);
  background: var(--pricing-mint);
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease;
}
.pilot-copy a:hover, .pilot-copy a:focus-visible { color: var(--pricing-green); background: #bcedbf; transform: translateY(-1px); }
.pricing-section { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 84px 0; }
.pricing-heading { max-width: 720px; margin-bottom: 38px; }
.pricing-heading h2 { margin: 0; color: var(--pricing-green); font: 400 clamp(2.35rem, 5vw, 4rem)/1 "DM Serif Display", Georgia, serif; }
.pricing-heading > p:last-child { color: #5d6673; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 20px; }
.price-card { position: relative; min-width: 0; display: flex; flex-direction: column; padding: 32px; background: #fff; border: 1px solid var(--pricing-line); border-radius: 18px; box-shadow: 0 12px 36px rgba(31,59,45,.07); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.price-card:focus-within { border-color: #7fcb86; box-shadow: 0 0 0 3px rgba(127, 203, 134, .26), 0 18px 48px rgba(31, 59, 45, .14); transform: translateY(-3px); }
@media (hover: hover) {
  .price-card:hover { border-color: #7fcb86; box-shadow: 0 0 0 3px rgba(127, 203, 134, .26), 0 18px 48px rgba(31, 59, 45, .14); transform: translateY(-3px); }
}
.price-kicker { margin: 0 0 7px; color: var(--pricing-mid); font-size: .75rem; text-transform: uppercase; }
.price-card h3 { margin: 0; color: var(--pricing-green); font: 400 2.15rem/1 "DM Serif Display", Georgia, serif; }
.price { display: grid; gap: 2px; margin: 28px 0; }
.price strong { color: #171a1f; font-size: 2.5rem; font-weight: 500; }
.price span { color: #6b7280; font-size: .85rem; }
.plan-scope { display: grid; gap: 5px; min-height: 70px; margin: 0 0 22px; color: #455149; }
.plan-scope strong { color: var(--pricing-green); font-size: 1.04rem; font-weight: 500; }
.plan-scope span { color: #667069; font-size: .84rem; }
.plan-scope .plan-extra { display: flex; align-items: flex-start; gap: 8px; margin-top: 5px; color: #365f49; line-height: 1.45; }
.plan-scope .plan-extra::before { flex: 0 0 auto; content: "✓"; color: #2f8f50; font-size: 1rem; font-weight: 700; line-height: 1.2; }
.price-breakdown { min-width: 0; margin: 0 0 24px; border-top: 1px solid var(--pricing-line); border-bottom: 1px solid var(--pricing-line); }
.price-breakdown summary {
  position: relative;
  padding: 15px 28px 15px 0;
  color: var(--pricing-green);
  cursor: pointer;
  font-size: .87rem;
  font-weight: 500;
  list-style: none;
}
.price-breakdown summary::-webkit-details-marker { display: none; }
.price-breakdown summary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(127, 203, 134, .34); border-radius: 5px; }
.price-breakdown summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--pricing-mid);
  background: #eef4ec;
  border-radius: 999px;
  transform: translateY(-50%);
  transition: transform .22s ease, background .22s ease;
}
.price-breakdown[open] summary::after { background: var(--pricing-mint); transform: translateY(-50%) rotate(45deg); }
.price-breakdown-body { padding: 1px 0 16px; animation: breakdown-in .24s ease both; }
.cost-bar { height: 14px; display: flex; overflow: hidden; background: #e8ede8; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(31, 59, 45, .08); transform-origin: left center; }
.price-breakdown[open] .cost-bar { animation: cost-bar-reveal .52s cubic-bezier(.22, .72, .18, 1) both; }
.cost-segment { min-width: 2px; height: 100%; }
.cost-segment.social, .cost-swatch.social { background: var(--cost-social); }
.cost-segment.server, .cost-swatch.server { background: var(--cost-server); }
.cost-segment.payment, .cost-swatch.payment { background: var(--cost-payment); }
.cost-segment.future, .cost-swatch.future { background: var(--cost-future); }
.cost-segment.development, .cost-swatch.development { background: var(--cost-development); }
.cost-legend { width: auto; max-width: 100%; display: block; margin: 14px 0 0; padding: 0; overflow: hidden; list-style: none; }
.cost-row { width: auto; min-width: 0; display: flex; gap: 8px; align-items: flex-start; color: #59635d; font-size: .75rem; line-height: 1.35; }
.cost-row + .cost-row { margin-top: 8px; }
.cost-swatch { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 2px; border-radius: 2px; }
.cost-row > span:nth-child(2) { min-width: 0; flex: 1 1 auto; }
.cost-legend strong { width: max-content; flex: 0 0 max-content; margin-left: auto; color: #303a34; font-weight: 500; white-space: nowrap; }
.choose-plan { width: 100%; min-height: 50px; margin-top: auto; color: #fff; background: var(--pricing-green); border: 0; border-radius: 9px; font: inherit; cursor: pointer; }
.choose-plan:hover, .choose-plan:focus-visible { background: #087443; transform: translateY(-1px); }
.pricing-footer { min-height: 104px; padding: 28px max(22px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #667069; background: #fff; border-top: 1px solid var(--pricing-line); font-size: .85rem; }
.pricing-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

@keyframes breakdown-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cost-bar-reveal {
  from { opacity: .35; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}

.checkout-dialog { width: min(780px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; color: #171a1f; background: #fff; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(9,18,13,.32); }
.checkout-dialog::backdrop { background: rgba(9,18,13,.62); backdrop-filter: blur(3px); }
.checkout-shell { margin: 0; }
.checkout-header { display: flex; justify-content: space-between; gap: 24px; padding: 28px 30px 22px; border-bottom: 1px solid var(--pricing-line); }
.checkout-kicker { margin: 0 0 5px; color: var(--pricing-mid); font-size: .73rem; text-transform: uppercase; }
.checkout-header h2 { margin: 0; color: var(--pricing-green); font: 400 2rem/1.05 "DM Serif Display", Georgia, serif; }
#selectedPlanLabel { margin: 8px 0 0; color: #667069; }
.checkout-close { width: 38px; height: 38px; color: #526057; background: #f1f5f1; border: 0; border-radius: 999px; font-size: 1.4rem; cursor: pointer; }
.checkout-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 18px 30px; list-style: none; background: #f8faf7; border-bottom: 1px solid var(--pricing-line); }
.checkout-steps li { position: relative; display: flex; align-items: center; color: #7a837e; font-size: .82rem; }
.checkout-steps li:not(:last-child)::after,
.checkout-steps li:not(:last-child)::before {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 100%;
  height: 3px;
  content: "";
  border-radius: 999px;
  transform: translateY(-50%);
}
.checkout-steps li:not(:last-child)::after { z-index: 0; background: #dfe7e0; }
.checkout-steps li:not(:last-child)::before {
  z-index: 1;
  background: linear-gradient(90deg, var(--pricing-green), #7fcb86);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  transition: transform .46s cubic-bezier(.22, .72, .18, 1);
}
.checkout-steps li.complete:not(:last-child)::before { transform: translateY(-50%) scaleX(1); }
.checkout-step-number {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  color: #7a837e;
  background: #e6ebe6;
  border-radius: 999px;
  transition: color .24s ease, background .24s ease, box-shadow .24s ease, transform .24s ease;
}
.checkout-step-label {
  position: relative;
  z-index: 2;
  margin-left: 8px;
  padding: 0 10px 0 0;
  background: #f8faf7;
  transition: color .24s ease;
}
.checkout-steps li.active { color: var(--pricing-green); font-weight: 500; }
.checkout-steps li.active .checkout-step-number { color: #fff; background: var(--pricing-green); }
.checkout-steps li[aria-current="step"] .checkout-step-number { box-shadow: 0 0 0 4px rgba(127, 203, 134, .2); transform: scale(1.05); }
.checkout-step { display: grid; gap: 20px; padding: 28px 30px 32px; }
.checkout-step label { display: grid; gap: 7px; color: #455149; font-size: .86rem; }
.checkout-step label > span { color: inherit; }
.checkout-step label > span:not(:first-child), .checkout-step label span span { color: #7a837e; }
.checkout-step input:not([type="checkbox"]):not([type="radio"]), .checkout-step select { width: 100%; min-height: 46px; padding: 0 12px; color: #171a1f; background: #fff; border: 1px solid #cbd5cc; border-radius: 8px; font: inherit; }
.checkout-step input:focus, .checkout-step select:focus, .checkout-step button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(127,203,134,.34); }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: #edf2ed; border-radius: 10px; }
.auth-choice button { min-height: 42px; color: #5e6861; background: transparent; border: 0; border-radius: 7px; font: inherit; cursor: pointer; }
.auth-choice button.active { color: var(--pricing-green); background: #fff; box-shadow: 0 2px 8px rgba(31,59,45,.08); }
[data-auth-panel] { display: grid; gap: 15px; }
.billing-type { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; }
.billing-type legend { grid-column: 1 / -1; margin-bottom: 5px; color: var(--pricing-green); font-size: 1.05rem; font-weight: 500; }
.billing-type label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--pricing-line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.billing-type label::after {
  position: absolute;
  inset: -1px;
  content: "";
  border: 2px solid transparent;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transform: scale(.985);
  transition: border-color .22s ease, opacity .22s ease, transform .22s ease;
}
.billing-type label:hover, .billing-type label:focus-within {
  border-color: #7fcb86;
  box-shadow: 0 7px 18px rgba(31, 59, 45, .1);
  transform: translateY(-1px);
}
.billing-type label:hover::after, .billing-type label:focus-within::after {
  border-color: #7fcb86;
  opacity: 1;
  transform: scale(1);
}
.billing-type label:has(input:checked) { background: #f2fbf2; border-color: #7fcb86; }
.billing-type label span { display: grid; gap: 3px; }
.billing-type small { color: #707a73; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.country-field select { font-size: .96rem; }
.country-field small { color: #7a837e; font-size: .74rem; }
.inline-check, .authority-check, .legal-acceptances label { display: flex !important; align-items: flex-start; gap: 10px !important; line-height: 1.45; }
.authority-check { padding: 15px; background: #f6f8f5; border: 1px solid var(--pricing-line); border-radius: 10px; }
.checkout-step input[type="checkbox"], .checkout-step input[type="radio"] { margin-top: 3px; accent-color: var(--pricing-green); }
.checkout-status { min-height: 20px; margin: 0; color: #b42318; font-size: .84rem; }
.checkout-status[data-state="success"] { color: #087443; }
.checkout-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 4px; }
.checkout-actions.end { justify-content: flex-end; }
.checkout-primary, .checkout-secondary { min-height: 48px; padding: 0 18px; border-radius: 8px; font: inherit; cursor: pointer; }
.checkout-primary { color: #fff; background: var(--pricing-green); border: 1px solid var(--pricing-green); }
.checkout-secondary { color: var(--pricing-green); background: #fff; border: 1px solid #bec9c0; }
.checkout-primary.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  background: var(--pricing-green);
  border-color: var(--pricing-green);
  cursor: wait;
  opacity: .88;
}
.checkout-primary.is-loading::before {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  content: "";
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: checkout-button-spin .72s linear infinite;
}
@keyframes checkout-button-spin {
  to { transform: rotate(360deg); }
}
.payment-button {
  position: relative;
  max-width: 430px;
  overflow: hidden;
  isolation: isolate;
  animation: payment-button-arrival .42s ease both;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.payment-button::after {
  content: "";
  position: absolute;
  inset: -40% -25%;
  z-index: 1;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  pointer-events: none;
  transform: translateX(-125%);
}
.payment-button:hover:not(:disabled), .payment-button:focus-visible:not(:disabled) {
  background: #087443;
  box-shadow: 0 10px 22px rgba(20, 67, 48, .22);
  transform: translateY(-2px);
}
.payment-button:hover:not(:disabled)::after, .payment-button:focus-visible:not(:disabled)::after { animation: payment-button-shine .62s ease; }
.payment-button:active:not(:disabled) { box-shadow: 0 4px 10px rgba(20, 67, 48, .18); transform: translateY(0) scale(.985); }
@keyframes payment-button-arrival {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes payment-button-shine {
  from { transform: translateX(-125%); }
  to { transform: translateX(125%); }
}
.contract-summary { display: grid; gap: 1px; overflow: hidden; background: var(--pricing-line); border: 1px solid var(--pricing-line); border-radius: 12px; }
.contract-summary > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 15px; background: #fff; }
.contract-summary span { color: #68736b; }
.contract-summary strong { font-weight: 400; text-align: right; }
.contract-summary .schedule { display: block; background: #f2fbf2; }
.contract-summary .schedule strong { display: block; margin-bottom: 5px; color: var(--pricing-green); font-weight: 500; text-align: left; }
.legal-acceptances { display: grid; gap: 13px; }
.legal-acceptances a { text-decoration: underline; }

@media (max-width: 820px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .pilot-program { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .pricing-header { min-height: 520px; background-position: 61% 56%; }
  .pricing-hero, .pricing-section, .pilot-program { width: calc(100% - 30px); }
  .pricing-hero { padding: 170px 0 48px; }
  .pilot-program { padding: 42px 0; }
  .price-card { padding: 25px 21px; }
  .pricing-footer { align-items: flex-start; flex-direction: column; }
  .checkout-dialog { width: calc(100% - 14px); max-height: calc(100dvh - 14px); border-radius: 12px; }
  .checkout-header, .checkout-step { padding-left: 18px; padding-right: 18px; }
  .checkout-steps { padding-left: 18px; padding-right: 18px; }
  .checkout-steps li { font-size: .7rem; }
  .form-grid, .billing-type { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .checkout-actions { align-items: stretch; flex-direction: column-reverse; }
  .checkout-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .price-breakdown-body { animation: none; }
  .price-breakdown[open] .cost-bar { animation: none; }
  .payment-button, .payment-button::after, .checkout-primary.is-loading::before { animation: none !important; transition: none; }
  .price-breakdown summary::after, .pilot-copy a, .price-card, .pricing-title-line::after, .billing-type label, .billing-type label::after, .checkout-steps li::before, .checkout-step-number, .checkout-step-label { transition: none; }
}
