:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --text-main: #111827;
  --text-muted: #6b7280;
  --bg-light: #f9fafb;
  --white: #ffffff;
  --border: #e5e7eb;
}

#subscriptionModal,
#emailConfirmationModal {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.modal-container {
  background: var(--white);
  border-radius: 24px;
  width: 95%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  padding: 32px 24px;
  text-align: center;
  color: var(--white);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
}

.modal-header p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.toggle-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.toggle-label.active {
  color: var(--white);
  font-weight: 800;
}

.switch {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  transition: background 0.3s;
}

.switch.on {
  background: #10b981;
  border-color: #059669;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch.on .switch-thumb {
  transform: translateX(20px);
}

.discount-pill {
  background: #10b981;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

.modal-body {
  overflow-y: auto;
  padding: 0;
  background: var(--bg-light);
  flex-grow: 1;
  scrollbar-width: thin;
}

.free-trial-cta {
  background: var(--white);
  padding: 20px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.btn-free {
  background: linear-gradient(to right, var(--accent), var(--accent-dark));
  color: var(--white);
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3);
  transition: all 0.2s;
}

.btn-free:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -5px rgba(249, 115, 22, 0.4);
}

.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
}

.card {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.card-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card.featured .card-label {
  color: var(--primary);
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.price-area {
  margin-bottom: 20px;
}

.old-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
  display: block;
  height: 1.2em;
  opacity: 0.6;
}

.current-price {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.current-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.feature-icon {
  width: 20px;
  height: 20px;
  background: #dbeafe;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.btn-select {
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 100%;
  border: 2px solid var(--primary);
}

.btn-select.outline {
  background: transparent;
  color: var(--primary);
}

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

.btn-select:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.recommended-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
  z-index: 5;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 20;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.confirm-container {
  width: 90%;
  max-width: 420px;
  padding: 0;
}

@media (min-width: 768px) {
  .plans-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 32px;
  }
  .modal-header { padding: 40px 24px; }
  .modal-header h2 { font-size: 1.85rem; }
  .card.featured { transform: scale(1.05); z-index: 2; }
}
