/* PaymentGate — dialog dedicato: stile finestra Poseidon, blur dietro, non spostabile. */

.pg-shell {
  position: fixed;
  inset: 0;
  z-index: 9650;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.pg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: var(--blur, blur(8px));
  pointer-events: none;
}

.pg-frame.os-window {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: min(480px, 100%);
  height: 95vh;
  max-height: 95vh;
  min-width: 320px;
  min-height: 0;
}

.pg-frame .os-window-drag {
  cursor: default;
}

.pg-frame .os-window-btn:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

.pg-frame .os-window-btn:disabled:hover {
  background: transparent;
  color: var(--text-2);
}

.pg-frame .os-window-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

.pg-window {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 18px;
}

.pg-window::-webkit-scrollbar { width: 8px; }
.pg-window::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

/* ---- Header ---- */

.pg-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.pg-head-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
}

.pg-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.pg-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-1, #f3f3f3);
  line-height: 1.25;
}

.pg-subtitle {
  margin: 3px 0 0;
  font-size: 0.8125rem;
  color: var(--text-2, rgba(255, 255, 255, 0.65));
  line-height: 1.45;
}

.pg-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg-active, rgba(255, 255, 255, 0.1));
  color: var(--text-2, rgba(255, 255, 255, 0.65));
}

.pg-trial {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.1);
  font-size: 0.8125rem;
  color: #ffd54f;
  line-height: 1.45;
}

.pg-trial.is-promo {
  border-color: rgba(139, 201, 143, 0.45);
  background: rgba(76, 175, 80, 0.12);
  color: #b8e6bb;
}

/* ---- Piani / base / addon ---- */

.pg-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.pg-plan,
.pg-base,
.pg-addon {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.pg-plan {
  padding: 11px 14px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.pg-plan:hover { background: var(--bg-hover, rgba(255, 255, 255, 0.06)); }

.pg-plan.is-selected {
  border-color: var(--accent, #0078d4);
  background: var(--accent-subtle, rgba(0, 120, 212, 0.12));
}

.pg-plan.is-single {
  cursor: default;
  pointer-events: none;
}

.pg-plan-radio {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong, rgba(255, 255, 255, 0.24));
  position: relative;
}

.pg-plan.is-selected .pg-plan-radio {
  border-color: var(--accent, #0078d4);
}

.pg-plan.is-selected .pg-plan-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent, #0078d4);
}

.pg-plan-main {
  flex: 1 1 auto;
  min-width: 0;
}

.pg-plan-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1, #f3f3f3);
}

.pg-plan-caption {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-2, rgba(255, 255, 255, 0.65));
  line-height: 1.4;
}

.pg-plan-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--accent-subtle, rgba(0, 120, 212, 0.2));
  color: var(--accent, #0078d4);
}

.pg-plan-price {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.pg-plan-amount {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-1, #f3f3f3);
}

.pg-plan-period {
  font-size: 0.75rem;
  color: var(--text-2, rgba(255, 255, 255, 0.65));
}

.pg-base {
  padding: 11px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-active, rgba(255, 255, 255, 0.08));
}

.pg-base.is-owned {
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  opacity: 0.85;
}

.pg-plan-tag.is-owned {
  background: #2e7d32;
  color: #fff;
}

.pg-addons-head {
  margin: 4px 0 8px;
  font-size: 0.71875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3, rgba(255, 255, 255, 0.4));
}

.pg-addons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.pg-addon {
  padding: 11px 14px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.pg-addon:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.pg-addon.is-selected {
  border-color: var(--accent, #0078d4);
  background: var(--accent-subtle, rgba(0, 120, 212, 0.12));
}

.pg-addon.is-owned {
  cursor: default;
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  opacity: 0.85;
}

.pg-addon.is-owned:hover {
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
}

.pg-addon-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm, 4px);
  border: 2px solid var(--border-strong, rgba(255, 255, 255, 0.24));
  position: relative;
}

.pg-addon.is-selected .pg-addon-check {
  border-color: var(--accent, #0078d4);
  background: var(--accent, #0078d4);
}

.pg-addon.is-selected .pg-addon-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.pg-addon-check.is-owned {
  border-color: #2e7d32;
  background: #2e7d32;
}

.pg-addon-check.is-owned::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.pg-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 4px;
  margin-bottom: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

.pg-total span {
  font-size: 0.8125rem;
  color: var(--text-2, rgba(255, 255, 255, 0.65));
}

.pg-total strong {
  font-size: 0.9375rem;
  color: var(--text-1, #f3f3f3);
}

/* ---- Feature list ---- */

.pg-features {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pg-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8125rem;
  color: var(--text-1, #f3f3f3);
  line-height: 1.4;
}

.pg-features li::before {
  content: "✓";
  flex: 0 0 auto;
  color: #4caf50;
  font-weight: 700;
  margin-top: 1px;
}

/* ---- Azioni ---- */

.pg-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(229, 83, 75, 0.35);
  border-radius: var(--radius-sm, 6px);
  background: rgba(229, 83, 75, 0.12);
  font-size: 0.78125rem;
  color: #ff9b93;
}

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

.pg-cta {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: var(--accent, #0078d4);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pg-cta:hover:not(:disabled) {
  background: var(--accent-hover, #106ebe);
}

.pg-cta:disabled {
  opacity: 0.65;
  cursor: default;
}

.pg-secondary {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--text-2, rgba(255, 255, 255, 0.65));
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
}

.pg-secondary:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
  color: var(--text-1, #f3f3f3);
}

.pg-reassure {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.71875rem;
  color: var(--text-3, rgba(255, 255, 255, 0.4));
  line-height: 1.5;
}

.pg-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pg-spin 0.7s linear infinite;
}

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