/**
 * Plan cards component – shared by onboarding, upgrade modal, billing tab.
 * Clean structure: name, description, price, savings, CTA, billing info, features.
 * Uses design-system variables for light/dark mode.
 */

/* ----- Container (onboarding step) ----- */
.plan-cards-step-container {
  margin-top: 16px;
  margin-bottom: 8px;
}

/* ----- Plan block: center toggle + grid ----- */
.plan-cards-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.plan-cards-toggle-stack {
  width: 100%;
  max-width: 400px;
  margin-bottom: 10px;
}

/* ----- Pill toggle v2: light shell, dark active segment, −20% badge ----- */
.plan-cards-pill-toggle {
  display: inline-flex;
  align-items: stretch;
  background: var(--plan-toggle-track-bg, #f3f4f6);
  border: 1px solid var(--plan-toggle-track-border, rgba(15, 23, 42, 0.08));
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.plan-cards-pill-toggle .pill-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.plan-cards-pill-toggle .pill-slider {
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--plan-toggle-active-bg, #141414);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.plan-cards-pill-toggle.pill-slider-yearly .pill-slider {
  transform: translateX(calc(100% + 0px));
}

.plan-cards-pill-toggle .pill-segment {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--plan-toggle-inactive-label, rgba(15, 23, 42, 0.45));
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.22s ease;
  background: transparent;
  user-select: none;
}

.plan-cards-pill-toggle .pill-segment.pill-right {
  flex-wrap: wrap;
}

.plan-cards-pill-toggle .pill-discount-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--color-primary);
  line-height: 1.2;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.plan-cards-pill-toggle:not(.pill-slider-yearly) .pill-discount-badge {
  opacity: 0.5;
}

/* Active segment: white label on dark pill */
.plan-cards-pill-toggle input[value="monthly"]:checked ~ .pill-left,
.plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-right {
  color: #fff;
}

.plan-cards-pill-toggle input[value="monthly"]:checked ~ .pill-right,
.plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-left {
  color: var(--plan-toggle-inactive-label, rgba(15, 23, 42, 0.45));
}

.plan-cards-pill-toggle input[value="monthly"]:checked ~ .pill-right .pill-discount-badge,
.plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-left .pill-discount-badge {
  opacity: 0.55;
}

.plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-right .pill-discount-badge {
  opacity: 1;
}

/* ----- Cards grid ----- */
.trial-pricing-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 0 auto;
  max-width: 720px;
}

.trial-pricing-card {
  background: var(--plan-card-bg, var(--color-surface-elevated, #ffffff));
  border: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.08));
  border-radius: 18px;
  padding: 28px 26px 26px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.07);
}

.trial-pricing-card.recommended {
  border-color: rgba(255, 1, 51, 0.22);
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 1, 51, 0.14);
}


/* ----- "Most Popular" badge (Pro plan) – subtle, above card ----- */
.plan-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.plan-card-badge-most-popular {
  background: var(--color-primary);
  color: white;
}

/* ----- Badge (billing tab only, e.g. trial ending) ----- */
.trial-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.trial-badge-subtle {
  background: var(--color-text-tertiary);
  font-size: 11px;
}

/* ----- Plan name ----- */
.trial-plan-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--color-text-primary);
}

/* ----- Tagline / description ----- */
.trial-plan-tagline {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* ----- Price block (vertical slide for monthly/yearly) ----- */
.trial-plan-price-block {
  margin-bottom: 8px;
}

.trial-plan-price-block .price-slider-wrapper {
  height: 44px;
  overflow: hidden;
  position: relative;
}

.trial-plan-price-block .price-slider {
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.trial-plan-price-block .price-slider.price-slider-yearly {
  transform: translateY(-50%);
}

.trial-plan-price-block .price-row {
  height: 44px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 44px;
  box-sizing: border-box;
}

.trial-plan-price-block .price-stack {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.trial-plan-price-block .price-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.trial-plan-price-block .price-period {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-tertiary);
}

.trial-plan-price-block .price-crossed {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-decoration: line-through;
  opacity: 0.7;
}

.trial-plan-price-block .price-free {
  color: var(--color-primary);
  font-size: 30px;
  font-weight: 800;
}

/* ----- Savings line (e.g. "Save €29 with yearly billing") ----- */
.trial-plan-savings {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: 18px;
  line-height: 1.45;
}

.trial-plan-savings .savings-amount {
  color: var(--color-primary);
}

/* Yearly savings callout — forest green (mock), inherits on dark below */
.trial-plan-savings .savings-text.yearly-price.savings-text-yearly-highlight {
  color: var(--plan-save-green, #166534);
  font-weight: 600;
}

.trial-plan-savings .savings-text.yearly-price.savings-text-yearly-highlight .savings-amount {
  color: inherit;
  font-weight: 800;
}

/* ----- CTA button ----- */
.btn-trial {
  width: 100%;
  padding: 16px 22px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
}

.btn-trial.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-trial.btn-primary:hover {
  background: var(--color-primary-hover, #e11d48);
}

.btn-trial.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.12));
}

.btn-trial.btn-secondary:hover {
  background: var(--color-bg-tertiary, #f9fafb);
  border-color: var(--color-border-medium, rgba(0, 0, 0, 0.18));
}

/* ----- Billing info under CTA ("Billed monthly. Cancel anytime.") ----- */
.trial-plan-billing-info {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
}

/* ----- Feature list with checkmarks ----- */
.trial-plan-features {
  list-style: none;
  padding: 22px 0 0;
  margin: 22px 0 0;
  border-top: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.08));
  flex: 1;
}

.trial-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: var(--color-text-primary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.trial-feature-item:last-child {
  margin-bottom: 0;
}

.trial-feature-intro {
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: 10px;
  padding-bottom: 4px;
}

/* Check icon – red, no background (both plans); inline SVG so it always shows */
.trial-feature-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.trial-feature-icon .trial-feature-check {
  width: 20px;
  height: 20px;
}

/* ----- Promise text (billing tab: "Current plan", "Cancel anytime") ----- */
.trial-promise {
  text-align: center;
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 500;
  margin-top: 10px;
}

.trial-promise-subtle {
  color: var(--color-text-tertiary);
  font-weight: 400;
  font-size: 12px;
}

.billed-yearly-note {
  font-size: 11px;
  opacity: 0.8;
}

/* ----- Legacy / billing tab inline price block ----- */
.trial-plan-price {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-stack {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.price-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.price-period {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .trial-pricing-cards {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 20px;
  }

  .trial-pricing-card {
    padding: 24px 20px;
  }

  .trial-plan-price-block .price-amount {
    font-size: 28px;
  }
}

/* ----- Dark theme (variables handle most; overrides if needed) ----- */
:root[data-theme='dark'] .trial-pricing-card {
  background: var(--plan-card-bg-dark, var(--color-bg-secondary));
  border-color: var(--color-border-light);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .trial-pricing-card:hover {
  border-color: var(--color-border-medium);
}

:root[data-theme='dark'] .trial-pricing-card.recommended {
  border-color: rgba(255, 1, 51, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 1, 51, 0.22);
}

:root[data-theme='dark'] .btn-trial.btn-secondary {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

:root[data-theme='dark'] .btn-trial.btn-secondary:hover {
  background: var(--color-border-light);
  border-color: var(--color-border-medium);
}

:root[data-theme='dark'] .plan-toggle-track-bg,
:root[data-theme='dark'] .plan-cards-pill-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme='dark'] .plan-cards-pill-toggle .pill-slider {
  background: var(--plan-toggle-active-bg-dark, #f8fafc);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .plan-cards-pill-toggle input[value="monthly"]:checked ~ .pill-left,
:root[data-theme='dark'] .plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-right {
  color: #0f172a;
}

:root[data-theme='dark'] .plan-cards-pill-toggle input[value="monthly"]:checked ~ .pill-right,
:root[data-theme='dark'] .plan-cards-pill-toggle input[value="yearly"]:checked ~ .pill-left {
  color: rgba(248, 250, 252, 0.55);
}

:root[data-theme='dark'] .trial-plan-savings .savings-text.yearly-price.savings-text-yearly-highlight {
  color: var(--plan-save-green-dark, #86efac);
}

:root[data-theme='dark'] .trial-plan-features {
  border-top-color: var(--color-border-light);
}