/* Premigest — pages d'authentification
   Palette limitée aux couleurs du logo + noir et blanc. */

.pg-auth {
  --pg-navy: #022b41;
  --pg-violet: #6a60ff;
  --pg-indigo: #654cff;
  --pg-black: #000;
  --pg-white: #fff;

  --pg-text: var(--pg-navy);
  --pg-muted: rgba(2, 43, 65, 0.64);
  --pg-subtle: rgba(2, 43, 65, 0.45);
  --pg-line: rgba(2, 43, 65, 0.12);
  --pg-line-strong: rgba(2, 43, 65, 0.24);
  --pg-tint: rgba(106, 96, 255, 0.08);
  --pg-ring: rgba(106, 96, 255, 0.24);
  --pg-navy-hover: color-mix(in srgb, var(--pg-navy) 78%, var(--pg-black));

  --pg-radius: 10px;
  --pg-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  margin: 0;
  min-height: 100vh;
  background: var(--pg-white);
  color: var(--pg-text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.pg-auth a {
  color: inherit;
}

/* ---------- Layout ---------- */

.pg-shell {
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  min-height: 100vh;
}

.pg-aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 56px 40px;
  color: var(--pg-white);
  background:
    radial-gradient(70% 55% at 90% 0%, rgba(106, 96, 255, 0.42), transparent 70%),
    radial-gradient(60% 45% at 0% 100%, rgba(101, 76, 255, 0.3), transparent 70%),
    var(--pg-navy);
  overflow: hidden;
  isolation: isolate;
}

.pg-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='white' stroke-opacity='0.5' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='white' stroke-opacity='0.5' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(160deg, #000 0%, transparent 65%);
}

.pg-aside-inner {
  max-width: 460px;
  margin-top: auto;
  margin-bottom: auto;
}

.pg-aside-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pg-aside-kicker i {
  color: var(--pg-violet);
  font-size: 1rem;
}

.pg-aside-title {
  margin: 24px 0 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.pg-aside-title em {
  font-style: normal;
  color: var(--pg-violet);
}

.pg-aside-lead {
  margin: 16px 0 0;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
}

.pg-aside-points {
  display: grid;
  gap: 18px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.pg-aside-points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pg-aside-points .pg-aside-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(106, 96, 255, 0.18);
  border: 1px solid rgba(106, 96, 255, 0.35);
  color: var(--pg-white);
  font-size: 1.1rem;
}

.pg-aside-points strong {
  display: block;
  font-weight: 600;
}

.pg-aside-points span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
}

.pg-aside-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.pg-aside-foot a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.pg-aside-foot a:hover {
  color: var(--pg-white);
}

.pg-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--pg-white);
}

.pg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 48px;
}

.pg-topbar-logo img {
  display: block;
  height: 34px;
  width: auto;
}

.pg-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pg-muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.pg-topbar-back:hover {
  color: var(--pg-navy);
}

.pg-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 48px 48px;
}

.pg-panel {
  width: 100%;
  max-width: 400px;
  animation: pg-enter 0.4s var(--pg-ease) both;
}

.pg-panel-wide {
  max-width: 440px;
}

.pg-main-foot {
  display: none;
  padding: 0 24px 28px;
  color: var(--pg-subtle);
  font-size: 0.82rem;
  text-align: center;
}

.pg-main-foot a {
  color: var(--pg-muted);
  text-decoration: none;
}

/* ---------- Headings ---------- */

.pg-heading {
  margin-bottom: 28px;
}

.pg-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--pg-violet);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-title {
  margin: 0;
  color: var(--pg-navy);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pg-lead {
  margin: 10px 0 0;
  color: var(--pg-muted);
  font-size: 1rem;
}

.pg-lead strong {
  color: var(--pg-navy);
  font-weight: 600;
}

/* ---------- Notices ---------- */

.pg-notices {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.pg-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--pg-radius);
  border: 1px solid rgba(106, 96, 255, 0.28);
  background: var(--pg-tint);
  color: var(--pg-navy);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pg-notice i {
  flex: none;
  margin-top: 1px;
  color: var(--pg-violet);
  font-size: 1.1rem;
}

.pg-notice p {
  margin: 0;
}

.pg-notice--error {
  border-color: var(--pg-navy);
  background: var(--pg-navy);
  color: var(--pg-white);
}

.pg-notice--error i {
  color: var(--pg-white);
}

.pg-notice--warning {
  border-color: rgba(101, 76, 255, 0.5);
  background: rgba(101, 76, 255, 0.1);
}

.pg-notice--warning i {
  color: var(--pg-indigo);
}

/* ---------- Social ---------- */

.pg-social {
  display: grid;
  gap: 10px;
}

.pg-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--pg-subtle);
  font-size: 0.85rem;
}

.pg-divider::before,
.pg-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pg-line);
}

/* ---------- Fields ---------- */

.pg-form {
  display: grid;
  gap: 18px;
}

.pg-field {
  display: grid;
  gap: 7px;
}

.pg-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pg-label {
  color: var(--pg-navy);
  font-size: 0.9rem;
  font-weight: 500;
}

.pg-input-wrap {
  position: relative;
}

.pg-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--pg-line-strong);
  border-radius: var(--pg-radius);
  background: var(--pg-white);
  color: var(--pg-navy);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.pg-input::placeholder {
  color: var(--pg-subtle);
}

.pg-input:hover {
  border-color: rgba(2, 43, 65, 0.42);
}

.pg-input:focus {
  border-color: var(--pg-violet);
  box-shadow: 0 0 0 4px var(--pg-ring);
}

.pg-input:-webkit-autofill {
  -webkit-text-fill-color: var(--pg-navy);
  box-shadow: 0 0 0 1000px var(--pg-white) inset;
}

.pg-input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px var(--pg-white) inset, 0 0 0 4px var(--pg-ring);
}

.pg-input-wrap.has-reveal .pg-input {
  padding-right: 48px;
}

.pg-reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pg-subtle);
  font-size: 1.15rem;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.15s ease, background 0.15s ease;
}

.pg-reveal:hover {
  color: var(--pg-navy);
  background: var(--pg-tint);
}

.pg-reveal:focus-visible {
  outline: 2px solid var(--pg-violet);
  outline-offset: 1px;
}

.pg-field.has-error .pg-input {
  border-color: var(--pg-indigo);
  border-width: 1.5px;
}

.pg-field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--pg-indigo);
  font-size: 0.86rem;
  font-weight: 500;
}

.pg-field-error i {
  margin-top: 2px;
}

.pg-hint {
  margin: 0;
  color: var(--pg-subtle);
  font-size: 0.84rem;
}

.pg-hint.is-visible-warning {
  color: var(--pg-indigo);
  font-weight: 500;
}

.pg-hint[hidden] {
  display: none;
}

.pg-otp {
  height: 58px;
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
}

.pg-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--pg-muted);
  font-size: 0.92rem;
  cursor: pointer;
}

.pg-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--pg-navy);
  cursor: pointer;
}

/* Strength meter */
.pg-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.pg-strength-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--pg-line);
  transition: background 0.2s ease;
}

.pg-strength[data-level="1"] .pg-strength-bar:nth-child(-n + 1),
.pg-strength[data-level="2"] .pg-strength-bar:nth-child(-n + 2),
.pg-strength[data-level="3"] .pg-strength-bar:nth-child(-n + 3) {
  background: var(--pg-violet);
}

.pg-strength[data-level="4"] .pg-strength-bar {
  background: var(--pg-navy);
}

.pg-strength-label {
  min-width: 70px;
  margin-left: 6px;
  color: var(--pg-subtle);
  font-size: 0.8rem;
  text-align: right;
}

/* ---------- Buttons & links ---------- */

.pg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--pg-radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--pg-ring);
}

.pg-btn-primary,
.pg-auth a.pg-btn-primary {
  background: var(--pg-navy);
  color: var(--pg-white);
}

.pg-btn-primary:hover,
.pg-auth a.pg-btn-primary:hover {
  background: var(--pg-navy-hover);
  color: var(--pg-white);
}

.pg-btn-outline,
.pg-auth a.pg-btn-outline {
  border-color: var(--pg-line-strong);
  background: var(--pg-white);
  color: var(--pg-navy);
}

.pg-btn-outline:hover,
.pg-auth a.pg-btn-outline:hover {
  border-color: var(--pg-navy);
  background: var(--pg-white);
  color: var(--pg-navy);
}

.pg-btn-outline img {
  width: 18px;
  height: 18px;
}

.pg-btn-ghost,
.pg-auth a.pg-btn-ghost {
  width: auto;
  background: transparent;
  color: var(--pg-muted);
}

.pg-btn-ghost:hover,
.pg-auth a.pg-btn-ghost:hover {
  color: var(--pg-navy);
  background: var(--pg-tint);
}

.pg-btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.pg-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-color: var(--pg-white) var(--pg-white) transparent transparent;
  border-radius: 50%;
  animation: pg-spin 0.7s linear infinite;
}

.pg-btn-outline.is-loading::after {
  border-color: var(--pg-navy) var(--pg-navy) transparent transparent;
}

.pg-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.pg-actions .pg-btn-ghost {
  flex: none;
}

.pg-link {
  color: var(--pg-violet) !important;
  font-weight: 600;
  text-decoration: none;
}

.pg-link:hover {
  color: var(--pg-indigo) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pg-link-sm {
  font-size: 0.86rem;
}

.pg-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pg-violet);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.pg-link-btn:hover:not(:disabled) {
  color: var(--pg-indigo);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pg-link-btn:disabled {
  color: var(--pg-subtle);
  cursor: default;
}

.pg-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--pg-muted);
  font-size: 0.9rem;
}

.pg-switch {
  margin: 28px 0 0;
  color: var(--pg-muted);
  font-size: 0.95rem;
  text-align: center;
}

.pg-legal {
  margin: 20px 0 0;
  color: var(--pg-subtle);
  font-size: 0.82rem;
  text-align: center;
}

.pg-legal a {
  color: var(--pg-muted);
}

/* ---------- Status pages ---------- */

.pg-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: var(--pg-tint);
  border: 1px solid rgba(106, 96, 255, 0.24);
  color: var(--pg-violet);
  font-size: 1.6rem;
}

.pg-state-icon--solid {
  background: var(--pg-navy);
  border-color: var(--pg-navy);
  color: var(--pg-white);
}

.pg-steps {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: pg-step;
}

.pg-steps li {
  display: flex;
  gap: 12px;
  color: var(--pg-muted);
  font-size: 0.95rem;
  counter-increment: pg-step;
}

.pg-steps li::before {
  content: counter(pg-step);
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pg-tint);
  color: var(--pg-violet);
  font-size: 0.8rem;
  font-weight: 700;
}

.pg-stack {
  display: grid;
  gap: 10px;
}

/* ---------- Onboarding société ---------- */

.pg-center {
  text-align: center;
}

.pg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.pg-fieldset legend {
  margin-bottom: 7px;
  padding: 0;
}

.pg-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: var(--pg-subtle);
  font-size: 0.85rem;
  font-weight: 500;
}

.pg-progress li {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pg-progress li + li::before {
  content: "";
  width: 28px;
  height: 1px;
  margin-right: 2px;
  background: var(--pg-line-strong);
}

.pg-progress li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--pg-line-strong);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.pg-progress .is-done {
  color: var(--pg-navy);
}

.pg-progress .is-done > span {
  border-color: var(--pg-navy);
  background: var(--pg-navy);
  color: var(--pg-white);
}

.pg-progress .is-current {
  color: var(--pg-violet);
}

.pg-progress .is-current > span {
  border-color: var(--pg-violet);
  background: var(--pg-tint);
  color: var(--pg-violet);
}

.pg-currency {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.pg-currency-option {
  position: relative;
  cursor: pointer;
}

.pg-currency-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pg-currency-card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 14px 12px;
  border: 1px solid var(--pg-line-strong);
  border-radius: var(--pg-radius);
  background: var(--pg-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pg-currency-option:hover .pg-currency-card {
  border-color: rgba(2, 43, 65, 0.42);
}

.pg-currency-option input:focus-visible + .pg-currency-card {
  box-shadow: 0 0 0 4px var(--pg-ring);
}

.pg-currency-option input:checked + .pg-currency-card {
  border-color: var(--pg-violet);
  background: var(--pg-tint);
  box-shadow: inset 0 0 0 1px var(--pg-violet);
}

.pg-currency-symbol {
  color: var(--pg-navy);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.pg-currency-code {
  color: var(--pg-navy);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pg-currency-name {
  color: var(--pg-muted);
  font-size: 0.8rem;
}

.pg-currency-check {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--pg-violet);
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pg-currency-option input:checked + .pg-currency-card .pg-currency-check {
  opacity: 1;
  transform: none;
}

.pg-field.has-error .pg-currency-card {
  border-color: var(--pg-indigo);
}

/* Aperçu de document (panneau gauche) */
.pg-preview {
  margin-top: 40px;
}

.pg-preview-label {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-preview-doc {
  padding: 22px;
  border-radius: 14px;
  background: var(--pg-white);
  color: var(--pg-navy);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: rotate(-1deg);
}

.pg-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pg-line);
}

.pg-preview-company {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.pg-preview-company > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.pg-preview-company strong {
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pg-preview-company span {
  color: var(--pg-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.pg-preview .is-empty {
  color: var(--pg-subtle);
}

.pg-preview-company strong.is-empty {
  color: rgba(2, 43, 65, 0.35);
}

.pg-preview-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--pg-navy);
  color: var(--pg-white) !important;
  font-size: 0.95rem !important;
  font-weight: 700;
}

.pg-preview-meta {
  display: grid;
  align-content: start;
  gap: 2px;
  text-align: right;
}

.pg-preview-meta strong {
  color: var(--pg-violet);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.pg-preview-meta span {
  color: var(--pg-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pg-preview-lines {
  display: grid;
  gap: 8px;
  padding: 16px 0;
}

.pg-preview-lines span {
  height: 8px;
  border-radius: 999px;
  background: var(--pg-line);
}

.pg-preview-lines span:nth-child(2) {
  width: 78%;
}

.pg-preview-lines span:nth-child(3) {
  width: 56%;
}

.pg-preview-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--pg-line);
  font-size: 0.85rem;
}

.pg-preview-total span {
  color: var(--pg-muted);
}

.pg-preview-total strong {
  font-size: 1.1rem;
}

.pg-preview-total em {
  font-style: normal;
  color: var(--pg-violet);
}

@media (max-width: 520px) {
  .pg-grid-2 {
    grid-template-columns: 1fr;
  }

  .pg-progress li + li::before {
    width: 14px;
  }
}

/* ---------- Subscription ---------- */

.pg-shell--single {
  grid-template-columns: 1fr;
}

.pg-shell--single .pg-main {
  background:
    radial-gradient(900px 380px at 50% -120px, rgba(106, 96, 255, 0.07), transparent 70%),
    var(--pg-white);
}

.pg-shell--single .pg-topbar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.pg-shell--single .pg-content {
  align-items: flex-start;
  padding-top: 8px;
}

.pg-panel-xl {
  max-width: 1120px;
  min-width: 0;
}

.pg-progress--center {
  justify-content: center;
}

.pg-heading--center {
  max-width: 620px;
  margin: 0 auto 28px;
  text-align: center;
}

.pg-period {
  display: flex;
  width: fit-content;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-white);
}

.pg-period-option {
  position: relative;
  cursor: pointer;
}

.pg-period-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pg-period-option span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--pg-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.pg-period-option em {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pg-tint);
  color: var(--pg-violet);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
}

.pg-period-option:hover span {
  color: var(--pg-navy);
}

.pg-period-option input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--pg-ring);
}

.pg-period-option input:checked + span {
  background: var(--pg-navy);
  color: var(--pg-white);
}

.pg-period-option input:checked + span em {
  background: rgba(255, 255, 255, 0.16);
  color: var(--pg-white);
}

.pg-period-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  color: var(--pg-muted);
  font-size: 0.85rem;
}

.pg-period-note i {
  color: var(--pg-violet);
}

.pg-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-top: 32px;
}

.pg-plan {
  position: relative;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 20px;
  align-content: start;
  padding: 28px 26px;
  border: 1px solid var(--pg-line);
  border-radius: 16px;
  background: var(--pg-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--pg-ease);
}

.pg-plan:hover {
  border-color: var(--pg-line-strong);
  box-shadow: 0 18px 40px -24px rgba(2, 43, 65, 0.35);
  transform: translateY(-2px);
}

.pg-plan.is-featured {
  border-color: var(--pg-violet);
  box-shadow: 0 0 0 1px var(--pg-violet), 0 24px 48px -28px rgba(106, 96, 255, 0.55);
}

.pg-plan-badge {
  position: absolute;
  top: -12px;
  left: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pg-violet);
  color: var(--pg-white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pg-plan-name {
  margin: 0;
  color: var(--pg-navy);
  font-size: 1.2rem;
  font-weight: 600;
}

.pg-plan-desc {
  margin: 6px 0 0;
  color: var(--pg-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pg-plan-features {
  align-self: start;
}

.pg-plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--pg-navy);
}

.pg-plan-price strong {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.pg-plan-price span {
  color: var(--pg-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.pg-plan-billing {
  margin: 6px 0 0;
  color: var(--pg-muted);
  font-size: 0.85rem;
}

.pg-plan-billing s {
  margin-left: 4px;
  color: var(--pg-subtle);
}

.pg-plan-features {
  padding-top: 20px;
  border-top: 1px solid var(--pg-line);
}

.pg-plan-inherit {
  margin: 0 0 10px;
  color: var(--pg-navy);
  font-size: 0.88rem;
  font-weight: 600;
}

.pg-plan-features ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg-plan-features li {
  display: flex;
  gap: 10px;
  color: var(--pg-text);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pg-plan-features li i {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pg-tint);
  color: var(--pg-violet);
  font-size: 0.85rem;
}

.pg-plans-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 0;
  color: var(--pg-muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Dialog ---------- */

.pg-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--pg-white);
  color: var(--pg-text);
  box-shadow: 0 32px 80px -24px rgba(2, 43, 65, 0.5);
}

.pg-dialog::backdrop {
  background: rgba(2, 43, 65, 0.55);
  backdrop-filter: blur(3px);
}

.pg-dialog[open] {
  animation: pg-enter 0.25s var(--pg-ease) both;
}

.pg-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.pg-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--pg-line);
}

.pg-dialog-kicker {
  color: var(--pg-violet);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-dialog-title {
  margin: 4px 0 0;
  color: var(--pg-navy);
  font-size: 1.3rem;
  font-weight: 600;
}

.pg-dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pg-muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.pg-dialog-close:hover {
  background: var(--pg-tint);
  color: var(--pg-navy);
}

.pg-dialog-body {
  display: grid;
  gap: 22px;
  padding: 20px 24px;
  overflow-y: auto;
}

.pg-dialog-foot {
  display: flex;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--pg-line);
}

.pg-dialog-foot .pg-btn-ghost {
  width: auto;
}

.pg-choice-list {
  display: grid;
  gap: 8px;
}

.pg-choice,
.pg-method {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--pg-line-strong);
  border-radius: var(--pg-radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pg-choice:hover,
.pg-method:hover {
  border-color: var(--pg-navy);
}

.pg-choice input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pg-violet);
}

.pg-choice:has(input:checked),
.pg-method:has(input:checked) {
  border-color: var(--pg-violet);
  background: var(--pg-tint);
  box-shadow: 0 0 0 1px var(--pg-violet);
}

.pg-choice:has(input:focus-visible),
.pg-method:has(input:focus-visible) {
  box-shadow: 0 0 0 4px var(--pg-ring);
}

.pg-choice-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pg-choice-main strong {
  color: var(--pg-navy);
  font-size: 0.95rem;
  font-weight: 600;
}

.pg-choice-main small,
.pg-method-name small {
  color: var(--pg-muted);
  font-size: 0.8rem;
}

.pg-choice-main em {
  color: var(--pg-violet);
  font-style: normal;
  font-weight: 600;
}

.pg-choice-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--pg-navy);
  font-size: 0.92rem;
}

.pg-choice-side s {
  color: var(--pg-subtle);
  font-size: 0.78rem;
}

.pg-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.pg-method {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.pg-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pg-method-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 32px;
  color: var(--pg-navy);
  font-size: 1.3rem;
}

.pg-method-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pg-method-name {
  display: flex;
  flex-direction: column;
  color: var(--pg-navy);
  font-size: 0.9rem;
  font-weight: 600;
}

.pg-method-check {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--pg-violet);
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pg-method:has(input:checked) .pg-method-check {
  opacity: 1;
  transform: none;
}

.pg-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--pg-radius);
  background: var(--pg-navy);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

.pg-summary strong {
  color: var(--pg-white);
  font-size: 1.4rem;
  font-weight: 700;
}

.pg-summary small {
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 640px) {
  .pg-period {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 4px;
    border-radius: 14px;
  }

  .pg-period-option span {
    justify-content: center;
    width: 100%;
    padding: 9px 8px;
    border-radius: 10px;
  }

  .pg-plan {
    padding: 24px 20px;
  }

  .pg-dialog-foot {
    flex-direction: column-reverse;
  }

  .pg-dialog-foot .pg-btn-ghost {
    width: 100%;
  }
}

/* ---------- Motion ---------- */

@keyframes pg-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .pg-panel {
    animation: none;
  }

  .pg-btn.is-loading::after {
    animation-duration: 1.6s;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .pg-aside {
    padding: 44px 40px 32px;
  }
}

@media (max-width: 960px) {
  .pg-shell {
    grid-template-columns: 1fr;
  }

  .pg-aside {
    display: none;
  }

  .pg-topbar {
    padding: 20px 24px;
  }

  .pg-content {
    align-items: flex-start;
    padding: 24px 24px 32px;
  }

  .pg-main-foot {
    display: block;
  }
}

@media (max-width: 480px) {
  .pg-title {
    font-size: 1.6rem;
  }

  .pg-topbar-back span {
    display: none;
  }
}

/* ---------- Paiement ---------- */

.pg-panel-pay {
  max-width: 520px;
  min-width: 0;
}

.pg-panel-pay .pg-fieldset {
  margin-bottom: 22px;
}

.pg-pay-summary {
  display: grid;
  gap: 16px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--pg-line);
  border-radius: 16px;
  background: var(--pg-white);
}

.pg-pay-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--pg-navy);
  font-weight: 600;
}

.pg-pay-brand img,
.pg-pay-brand i {
  width: 36px;
  height: 36px;
  object-fit: contain;
  font-size: 1.4rem;
}

.pg-pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--pg-line);
}

.pg-pay-amount span {
  color: var(--pg-muted);
  font-size: 0.92rem;
}

.pg-pay-amount strong {
  color: var(--pg-navy);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
}

.pg-pay-amount small {
  margin-left: 4px;
  color: var(--pg-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pg-pay-rows {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pg-pay-rows div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.92rem;
}

.pg-pay-rows dt {
  color: var(--pg-muted);
  font-weight: 500;
}

.pg-pay-rows dd {
  margin: 0;
  color: var(--pg-navy);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.pg-pay-steps {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.pg-pay-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--pg-navy);
  font-size: 0.95rem;
}

.pg-pay-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--pg-tint);
  color: var(--pg-violet);
  font-size: 0.82rem;
  font-weight: 700;
}

.pg-pay-actions {
  display: grid;
  gap: 10px;
}

.pg-pay-note {
  margin: 16px 0 0;
  color: var(--pg-muted);
  font-size: 0.88rem;
  text-align: center;
}

.pg-pay-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--pg-white);
  border-radius: 50%;
  animation: pg-spin 0.7s linear infinite;
}

.pg-pay-spinner[hidden] {
  display: none !important;
}

#payment-element {
  margin-bottom: 20px;
}

#payment-message {
  margin: 12px 0 0;
  color: var(--pg-navy);
  font-size: 0.9rem;
}

#payment-message[hidden] {
  display: none !important;
}

.pg-wait {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
}

.pg-wait[hidden] {
  display: none !important;
}

.pg-wait-card {
  width: min(420px, 100%);
  padding: 32px 28px;
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: var(--pg-white);
  text-align: center;
  box-shadow: 0 24px 60px rgba(2, 43, 65, 0.14);
}

.pg-wait-spinner {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 18px;
  border: 3px solid var(--pg-line);
  border-top-color: var(--pg-violet);
  border-radius: 50%;
  animation: pg-spin 0.7s linear infinite;
}

.pg-wait-spinner[hidden] {
  display: none !important;
}

.pg-wait-title {
  margin: 0;
  color: var(--pg-navy);
  font-size: 1.15rem;
  font-weight: 600;
}

.pg-wait-text {
  margin: 8px 0 0;
  color: var(--pg-muted);
  font-size: 0.95rem;
}

.pg-wait-card .pg-btn {
  margin-top: 20px;
}

.pg-wait-card .pg-btn[hidden] {
  display: none !important;
}
