/**
 * Plan preview structure. Color tokens come from branding_tokens.css + branding_themes.css.
 * The parent must have .branding-pricing-theme-{id} so canonical vars are set.
 */
.theme-default {
  height: 100%;
}

/* --- Theme: dark --- */
.theme-dark {
  --theme-primary: var(--color-sky-500);
  --theme-secondary: var(--color-neutral-400);
  --theme-bg: var(--color-neutral-800);
  --theme-surface: var(--color-neutral-700);
  --theme-text: var(--color-neutral-100);
}

/* --- Single structure: uses the 5 theme colors --- */
.theme-brand-label {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--theme-text);
}

.theme-container {
  border-radius: var(--radius-xl);
  background-color: var(--theme-bg);
  padding: calc(var(--spacing) * 6);
}

.theme-email-preview-container {
  border-radius: var(--radius-xl);
  border: 1px solid var(--theme-secondary);
}

.theme-title {
  text-align: center;
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-default);
}

.theme-subtitle {
  margin-top: calc(var(--spacing) * 1);
  text-align: center;
  font-size: var(--text-sm);
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

.theme-toggle-wrapper {
  display: inline-flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 4px;
  background: color-mix(in srgb, var(--theme-primary) 10%, transparent);
}

.theme-interval-active {
  background-color: var(--theme-primary);
  color: var(--base-color);
  border-radius: calc(var(--radius-lg) - 2px);
  font-weight: 600;
}

.theme-interval-inactive {
  background-color: transparent;
  color: color-mix(in srgb, var(--theme-primary) 50%, transparent);
}

.theme-interval-inactive:hover {
  background-color: transparent;
}

.theme-select-wrap {
  position: relative;
  display: inline-flex;
}

.theme-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 16px;
  height: 16px;
  background-color: color-mix(in srgb, var(--theme-primary) 50%, transparent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20fill-rule%3D%27evenodd%27%20clip-rule%3D%27evenodd%27%20d%3D%27M5.23%207.21a.75.75%200%200%201%201.06.02L10%2011.168l3.71-3.94a.75.75%200%201%201%201.08%201.04l-4.24%204.5a.75.75%200%200%201-1.08%200l-4.24-4.5a.75.75%200%200%201%20.02-1.06Z%27/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20fill-rule%3D%27evenodd%27%20clip-rule%3D%27evenodd%27%20d%3D%27M5.23%207.21a.75.75%200%200%201%201.06.02L10%2011.168l3.71-3.94a.75.75%200%201%201%201.08%201.04l-4.24%204.5a.75.75%200%200%201-1.08%200l-4.24-4.5a.75.75%200%200%201%20.02-1.06Z%27/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: translateY(-50%);
  pointer-events: none;
}

.theme-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 25%, transparent);;
  background-color: var(--theme-surface);
  padding: 0 calc(var(--spacing) * 8) 0 calc(var(--spacing) * 4);
  font-size: var(--text-sm);
  color: var(--theme-text);
  cursor: pointer;
  height: 44px;
  display: flex;
  align-items: center;
}

.theme-select:focus {
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 15%, transparent);
}

.theme-select-disabled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--theme-secondary);
  background-color: var(--theme-bg);
  padding: calc(var(--spacing) * 3) calc(var(--spacing) * 6) calc(var(--spacing) * 2) calc(var(--spacing) * 3);
  font-size: var(--text-sm);
  color: var(--theme-secondary);
}

.theme-select-pair {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 25%, transparent);
  ;
  background-color: var(--theme-surface);
  overflow: hidden;
  max-height: 44px;
}

.theme-select-pair .theme-select,
.theme-select-pair .theme-select-disabled {
  border: none;
  background-color: transparent;
  padding: 0 calc(var(--spacing) * 4) 0 calc(var(--spacing) * 2);
  font-size: var(--text-l);
  color: var(--theme-text);
  margin: 0 12px;
}

.theme-select-pair .theme-select-disabled {
  color: var(--theme-secondary);
}

.theme-select-pair .theme-select:focus,
.theme-select-pair .theme-select-disabled:focus {
  outline: none;
}

.theme-select-divider {
  width: 1px;
  height: 1.5rem;
  background-color: color-mix(in srgb, var(--theme-primary) 25%, transparent);
}

.theme-card,
.theme-card-featured {
  border-radius: 16px;
  padding: calc(var(--spacing) * 6);
  box-shadow: var(--shadow-card, 0 4px 12px 0 rgb(13 17 21 / 0.1));
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 320px;
  border: 1px solid var(--theme-secondary);
  background: var(--login-card-bg);
}

.theme-card-featured {
  background-color: var(--theme-secondary);
}

.theme-card-title {
  font-size: 23px;
  font-weight: var(--font-weight-semibold);
  color: var(--theme-text);
  text-align: left;
}

.theme-card-title-featured {
  font-size: 23px;
  font-weight: var(--font-weight-bold);
  color: var(--theme-text);
  text-align: left;
}

.theme-card-price {
  font-size: 33px;
  font-weight: var(--font-weight-bold);
  color: var(--theme-text);
}

.theme-card-price-featured {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--theme-text);
}

.theme-price-symbol {
  color: var(--theme-secondary);
}

.theme-price-amount {
  color: inherit;
}

.theme-card-desc {
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  font-size: 13px;
}

.theme-card-desc-featured {
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

.theme-card-features,
.theme-card-features-featured {
  font-size: 13px;
  padding-top: calc(var(--spacing) * 6);
  padding-bottom: calc(var(--spacing) * 6);
}

.theme-card-features {
  color: var(--theme-text);
}

.theme-card-features-featured {
  color: var(--theme-text);
}

.theme-interval-label {
  align-self: center;
  font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

.theme-interval-label-featured {
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  align-self: center;
  font-size: 11px;
}

.theme-button-primary,
.theme-button-primary-featured {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  cursor: default;
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 4);
  font-weight: var(--font-weight-semibold);
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
}

.theme-button-primary {
  color: var(--theme-text);

  background-color: var(--theme-secondary);
  font-size: 13px;
}

.theme-button-primary-featured {
  color: var(--base-color);

  background-color: var(--theme-primary);
  font-size: var(--text-sm);
}

.theme-button-secondary {
  margin-top: calc(var(--spacing) * 4);
  width: 100%;
  border-radius: var(--radius-lg);
  background-color: var(--theme-secondary);
  padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 4);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  cursor: not-allowed;
}

.theme-button-selected {
  margin-top: calc(var(--spacing) * 4);
  width: 100%;
  border-radius: var(--radius-lg);
  background-color: var(--color-green-600);
  padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 4);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  cursor: default;
}

.theme-button-checkout {
  width: 100%;
  border-radius: var(--radius-lg);
  background-color: var(--theme-primary);
  padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 4);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  transition: background-color 0.15s;
}

.theme-button-checkout:hover {
  filter: brightness(1.1);
}

.theme-trial-text {
  color: var(--theme-text);
  font-size: 13px
}

.theme-trial-text-featured {
  color: var(--theme-text);
}

.theme-divider,
.theme-divider-featured {
  border-color: var(--divider-muted, color-mix(in srgb, var(--color-text) 15%, transparent));
}

.theme-empty-card {
  border-radius: var(--radius-xl);
  border: 2px dashed var(--theme-secondary);
  background-color: var(--theme-bg);
  padding: calc(var(--spacing) * 8);
  text-align: center;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.theme-empty-card-text {
  color: var(--theme-secondary);
  font-size: var(--text-sm);
}

.plan-price-symbol {
  color: color-mix(in srgb, var(--theme-text) 60%, transparent);
  font-weight: 400;
}

.plan-price-amount {
  color: var(--theme-text);
}

.theme-recommended-badge {
  background-color: var(--color-accent);
  color: var(--color-white);
  padding: 2px 4px;
  border-radius: 6px;
  font-size: var(--text-xs-size);
}

.theme-recommended-icon {
  color: var(--color-accent);
}

/* Feature list icons use accent color */
.theme-card-features [data-feature-list-icon],
.theme-card-features-featured [data-feature-list-icon],
.plan-features [data-feature-list-icon] {
  color: var(--color-accent);
}

/* Branding theme presets live in branding_themes.css (shared with login + email). */

/* --- Email preview: uses canonical vars from branding_themes ---
 * Background: base = --base-color, top layer = rgba(--color-secondary, 0.4)
 * Card = --base-color. Text: default = --color-text fw400, title = --color-primary fw600, prominent = --color-primary fw500
 */
.email-preview-theme {
  --color-text: #0D1115;
  --color-primary: #006199;
  --color-secondary: #E9F2FC;
  --base-color: #ffffff;
}

.email-preview-wrapper {
  background:
      linear-gradient(color-mix(in srgb, var(--color-secondary) 30%, transparent), color-mix(in srgb, var(--color-secondary) 30%, transparent)),
      linear-gradient(var(--base-color), var(--base-color));
  min-height: 200px;
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.email-preview-card {
  background-color: var(--base-color);
  border-radius: 12px;
  padding: 32px 48px;
  max-width: 576px;
  width: 100%;
}

.email-preview-text-default {
  color: var(--color-text);
  font-weight: var(--font-weight-400, 400);
  font-size: var(--text-base-size, 1rem);
}

.email-preview-text-title {
  color: var(--color-primary);
  font-weight: var(--font-weight-600, 600);
  font-size: var(--h3-size, 1.75rem);
}
.email-preview-text-footer-title {
  color: var(--color-primary);
}
.email-preview-text-prominent {
  color: var(--color-primary);
  font-weight: var(--font-weight-500, 500);
  font-size: var(--text-base-size, 1rem);
}

.email-preview-theme a.magic-link {
  color: var(--color-primary);
}

/* Email theme presets live in branding_themes.css (shared with pricing + login). */