/* Pre-auth language toggle (login / register) */
.auth-card--pre-auth {
  position: relative;
}

.lang-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.lang-toggle .lang-option {
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  user-select: none;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.lang-toggle .lang-option:hover {
  color: var(--accent-primary);
}

.lang-toggle .lang-option.active {
  font-weight: 600;
  text-decoration: underline;
  color: var(--accent-primary);
}

.lang-toggle .lang-separator {
  pointer-events: none;
  opacity: 0.6;
  padding: 0 0.1rem;
}

/* Registration wizard */
.register-step-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-top: 0.25rem;
}

.register-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color, rgba(128, 128, 128, 0.35));
  transition: background 0.2s ease, transform 0.2s ease;
}

.register-step-dot.active {
  background: var(--accent-primary, #6366f1);
  transform: scale(1.15);
}

.register-step.hidden {
  display: none !important;
}

.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.plan-card {
  position: relative;
  border: 1px solid var(--border-color, rgba(128, 128, 128, 0.35));
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--card-bg, var(--bg-secondary, rgba(255, 255, 255, 0.04)));
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.plan-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
}

.plan-card--recommended {
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 24px rgba(99, 102, 241, 0.15);
}

.plan-card--disabled {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.25);
}

.plan-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

.plan-badge--recommended {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary, #818cf8);
}

.plan-badge--discount {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.plan-price,
.plan-price--highlight {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
}

.plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.price-strike {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.plan-price--muted {
  color: var(--text-muted);
  font-weight: 500;
}

.plan-coming-soon {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.plan-features {
  margin: 0 0 1rem 1rem;
  padding: 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary, inherit);
}

.plan-features li {
  margin-bottom: 0.35rem;
}

.plan-select-btn {
  margin-top: auto;
  width: 100%;
}

.register-step-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

.register-back-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  text-decoration: none;
}

.register-verify-message {
  text-align: center;
  line-height: 1.5;
  color: var(--text-secondary, inherit);
}

/* Registration checkboxes */
.register-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.register-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.4;
}

.register-checkbox-label input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.register-checkbox-label .terms-link {
  color: var(--accent-primary);
  text-decoration: underline;
  cursor: pointer;
}

.register-checkbox-label .terms-link:hover {
  opacity: 0.8;
}

/* Terms and Conditions Modal */
.terms-modal-content {
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.terms-modal-body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
  max-height: 60vh;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.terms-modal-body h4 {
  margin: 1.25rem 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.terms-modal-body h4:first-child {
  margin-top: 0;
}

.terms-modal-body p {
  margin: 0 0 0.75rem 0;
}

.terms-bottom-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #333);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.terms-accept-checkbox {
  font-size: 0.85rem;
}

.terms-accept-checkbox input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.terms-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.terms-actions .btn {
  min-width: 140px;
}

[data-theme="light"] .plan-card--recommended {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.45), 0 8px 20px rgba(99, 102, 241, 0.12);
}

/* Gated report types (free tier) */
.report-type-option.report-type-locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.report-type-option.report-type-locked:hover {
  transform: none;
  box-shadow: none;
}

.report-type-locked .premium-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.report-type-locked .fa-lock {
  margin-left: 0.5rem;
  font-size: 0.85em;
  opacity: 0.7;
}

/* Disabled preference checkboxes (email / marketing — not yet available) */
.preference-item input[type="checkbox"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preference-item label.preference-label:has(input[type="checkbox"]:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.preference-item:has(input[type="checkbox"]:disabled) .preference-description {
  opacity: 0.4;
}

.preference-item.preference-item--disabled {
  cursor: not-allowed;
}

/* Upgrade / manage plan modal */
.upgrade-modal-content .plan-cards--compact {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.upgrade-modal-content .plan-card {
  min-height: auto;
}

.plan-features-inline {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary, inherit);
  margin: 0.5rem 0 0 0;
}

.upgrade-intro {
  margin-bottom: 0.5rem;
  color: var(--text-secondary, inherit);
}

.upgrade-current-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
}

.upgrade-current-value {
  margin: 0 0 1rem 0;
}

.btn-block.upgrade-cta {
  width: 100%;
  margin-top: 0.5rem;
}

#downgrade-confirm-modal .modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
