/**
 * B3 Swatches – Custom Freemius Pricing Page Styles
 *
 * Mirrors the admin settings UI: slate neutrals, dynamic admin color,
 * 10px button radius, subtle shadows, smooth transitions.
 */

/* ─── Design tokens ─── */
#fs_pricing {
  --b3-wvs-admin-color: var(--wp-admin-theme-color, #46b3e5);

  /* Map B3 tokens → Freemius CSS variables */
  --fs-ds-theme-primary-accent-color: var(--b3-wvs-admin-color);
  --fs-ds-theme-primary-accent-color-hover: color-mix(
    in srgb,
    var(--b3-wvs-admin-color) 85%,
    #0f172a
  );
  --fs-ds-theme-background-color: #ffffff;
  --fs-ds-theme-background-shade: #f8fafc;
  --fs-ds-theme-dark-background-text-color: #ffffff;
  --fs-ds-theme-text-color: #0f172a;
  --fs-ds-theme-border-color: #e2e8f0;
  --fs-ds-theme-divider-color: #e2e8f0;
  --fs-ds-theme-muted-text-color: #64748b;
  --fs-ds-theme-error-color: #ef4444;
  --fs-ds-theme-package-popular-background: color-mix(
    in srgb,
    var(--b3-wvs-admin-color) 90%,
    #0f172a
  );
}

/* ─── Page wrapper ─── */
#fs_pricing.wrap {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 1120px;
  margin: 24px auto 40px;
  padding: 0 16px;
}

/* ─── Stagger-fade entrance ─── */
@keyframes b3-pricing-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#fs_pricing_app {
  animation: b3-pricing-fade-up 0.4s ease-out both;
}

/* ─── Package cards ─── */
#fs_pricing_app .fs-package {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-bottom: 3px solid #e2e8f0;
  border-radius: 0.875rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  overflow: hidden;
  vertical-align: top;
}

#fs_pricing_app .fs-package:first-child,
#fs_pricing_app .fs-package + .fs-package {
  border-left: 1px solid #e2e8f0;
}

#fs_pricing_app .fs-package:last-child {
  border-right: 1px solid #e2e8f0;
}

#fs_pricing_app .fs-package:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* Stagger cards in */
@keyframes b3-pricing-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#fs_pricing_app .fs-package:nth-child(1) {
  animation: b3-pricing-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

#fs_pricing_app .fs-package:nth-child(2) {
  animation: b3-pricing-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

#fs_pricing_app .fs-package:nth-child(3) {
  animation: b3-pricing-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

#fs_pricing_app .fs-package:nth-child(4) {
  animation: b3-pricing-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #fs_pricing_app,
  #fs_pricing_app .fs-package {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── Plan title bar ─── */
#fs_pricing_app .fs-plan-title {
  background: #f8fafc;
  border-top: none;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 0;
  text-transform: uppercase;
}

/* ─── Featured plan (Most Popular) ─── */
#fs_pricing_app .fs-package.fs-featured-plan {
  border-color: var(--b3-wvs-admin-color);
  border-bottom-color: var(--b3-wvs-admin-color);
  box-shadow: 0 2px 12px
    color-mix(in srgb, var(--b3-wvs-admin-color) 20%, transparent);
  position: relative;
  z-index: 1;
}

#fs_pricing_app .fs-package.fs-featured-plan:hover {
  box-shadow: 0 8px 28px
    color-mix(in srgb, var(--b3-wvs-admin-color) 25%, transparent);
}

#fs_pricing_app .fs-package.fs-featured-plan .fs-plan-title {
  background: var(--b3-wvs-admin-color);
  color: #ffffff;
  border-top-color: var(--b3-wvs-admin-color);
  border-bottom-color: var(--b3-wvs-admin-color);
}

#fs_pricing_app .fs-package.fs-featured-plan .fs-most-popular {
  background: color-mix(in srgb, var(--b3-wvs-admin-color) 90%, #0f172a);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0.875rem 0.875rem 0 0;
}

/* ─── Pricing amount ─── */
#fs_pricing_app .fs-selected-pricing-amount .fs-currency-symbol {
  font-size: 28px;
  font-weight: 600;
  color: #0f172a;
  vertical-align: super;
}

#fs_pricing_app
  .fs-selected-pricing-amount
  .fs-selected-pricing-amount-integer {
  font-size: 48px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

#fs_pricing_app
  .fs-selected-pricing-amount
  .fs-selected-pricing-amount-fraction-container {
  color: #94a3b8;
  font-weight: 500;
}

#fs_pricing_app .fs-selected-pricing-amount-free {
  font-size: 42px;
  font-weight: 700;
  color: #0f172a;
}

/* Billing cycle text */
#fs_pricing_app .fs-selected-pricing-cycle {
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: lowercase;
}

/* License quantity text */
#fs_pricing_app .fs-selected-pricing-license-quantity {
  color: #64748b;
  font-size: 0.8125rem;
}

/* Discount strikethrough */
#fs_pricing_app .fs-undiscounted-price {
  color: #94a3b8;
  font-size: 0.875rem;
}

#fs_pricing_app .fs-undiscounted-price::after {
  background-color: #ef4444;
  height: 1.5px;
}

/* ─── CTA buttons ─── */
#fs_pricing_app .fs-upgrade-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.55rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}

#fs_pricing_app .fs-upgrade-button:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

/* Featured plan CTA — primary (admin-color) style */
#fs_pricing_app .fs-package.fs-featured-plan .fs-upgrade-button {
  background: var(--b3-wvs-admin-color);
  border-color: var(--b3-wvs-admin-color);
  color: #ffffff;
  box-shadow: 0 1px 3px
    color-mix(in srgb, var(--b3-wvs-admin-color) 30%, transparent);
}

#fs_pricing_app .fs-package.fs-featured-plan .fs-upgrade-button:hover {
  filter: brightness(0.95);
  box-shadow: 0 4px 14px
    color-mix(in srgb, var(--b3-wvs-admin-color) 35%, transparent);
  transform: translateY(-1px);
}

/* Already-bought / active license button */
#fs_pricing_app .fs-upgrade-button.fs-button-active-license {
  background: color-mix(in srgb, var(--b3-wvs-admin-color) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--b3-wvs-admin-color) 30%, transparent);
  color: var(--b3-wvs-admin-color);
}

/* ─── License quantity table ─── */
#fs_pricing_app .fs-license-quantities {
  border-collapse: collapse;
}

#fs_pricing_app .fs-license-quantity-container {
  border-color: #e2e8f0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

#fs_pricing_app .fs-license-quantity-container:hover {
  background: #f8fafc;
}

/* Discount badges */
#fs_pricing_app .fs-license-quantity-discount span {
  background: #ffffff;
  border: 1px solid var(--b3-wvs-admin-color);
  color: var(--b3-wvs-admin-color);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
}

/* Selected row */
#fs_pricing_app .fs-package.fs-featured-plan .fs-license-quantity-selected {
  background: var(--b3-wvs-admin-color);
  border-color: var(--b3-wvs-admin-color);
}

#fs_pricing_app
  .fs-package.fs-featured-plan
  .fs-license-quantity-selected
  .fs-license-quantity-discount
  span {
  background: #ffffff;
  color: var(--b3-wvs-admin-color);
}

/* ─── Plan features ─── */
#fs_pricing_app .fs-plan-features li .fs-feature-title {
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
}

#fs_pricing_app .fs-plan-features li > span,
#fs_pricing_app .fs-plan-features li .fs-tooltip {
  font-size: 0.8125rem;
}

/* Feature checkmark icons */
#fs_pricing_app .fs-plan-features li svg,
#fs_pricing_app .fs-plan-features li .fs-feature-check {
  color: var(--b3-wvs-admin-color);
}

/* ─── Support & main features section ─── */
#fs_pricing_app .fs-support-and-main-features {
  color: #64748b;
  border-top: 1px solid #f1f5f9;
}

#fs_pricing_app
  .fs-support-and-main-features
  .fs-plan-features-with-value
  li
  .fs-feature-title {
  color: #475569;
}

/* ─── Billing cycle toggle ─── */
#fs_pricing_app .fs-pricing-toggle,
#fs_pricing_app .fs-billing-frequency {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

#fs_pricing_app .fs-pricing-toggle .fs-toggle-active,
#fs_pricing_app .fs-billing-frequency-active {
  color: var(--b3-wvs-admin-color);
}

/* Toggle switch */
#fs_pricing_app .fs-toggle-switch {
  background: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

#fs_pricing_app .fs-toggle-switch.fs-toggle-active,
#fs_pricing_app .fs-toggle-switch:checked {
  background: var(--b3-wvs-admin-color);
}

#fs_pricing_app .fs-toggle-switch::after,
#fs_pricing_app .fs-toggle-switch .fs-toggle-thumb {
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

/* ─── Refund / guarantee / footer notes ─── */
#fs_pricing_app .fs-money-back-guarantee,
#fs_pricing_app .fs-risk-free-message {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

/* ─── Tooltips ─── */
#fs_pricing_app .fs-tooltip .fs-tooltip-body {
  background: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ─── Plan description ─── */
#fs_pricing_app .fs-plan-description {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
}

/* ─── Trial / badge styling ─── */
#fs_pricing_app .fs-trial-message,
#fs_pricing_app .fs-trial-plan-text {
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Responsive refinements ─── */
@media (max-width: 960px) {
  #fs_pricing_app .fs-package {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 16px;
    display: block;
  }
}

/* ─── WordPress admin bar offset ─── */
#fs_pricing.wrap {
  padding-top: 12px;
}

/* ─── Tab bar (if Freemius tabs are active) ─── */
#fs_pricing .fs-tab-bar,
#fs_pricing .nav-tab-wrapper {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

#fs_pricing .nav-tab {
  border-radius: 0.625rem 0.625rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
}

#fs_pricing .nav-tab-active {
  color: var(--b3-wvs-admin-color);
  border-bottom-color: var(--b3-wvs-admin-color);
}

/* ─── Links ─── */
#fs_pricing a:not(.fs-upgrade-button) {
  color: var(--b3-wvs-admin-color);
  transition: color 0.15s ease;
}

#fs_pricing a:not(.fs-upgrade-button):hover {
  color: color-mix(in srgb, var(--b3-wvs-admin-color) 80%, #0f172a);
}
