/* © 2026 HumanWidget. All Rights Reserved. */

:root {
  --primary-color: #bd7bff;
  --primary-hover: #a753fb;
  --secondary-color: #4b5563;
  --success-color: #10b981;
  --error-color: #ef4444;
  --background-color: #f3f4f6;
  --card-background: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --font-family: "Inter", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.background-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(to bottom, var(--primary-color), #bd7bff);
  z-index: 0;
}

.subscription-wrapper {
  display: flex;
  align-items: center; /* This vertically centers the content */
  justify-content: center; /* This horizontally centers the content */
  min-height: 100vh; /* Ensures the wrapper takes up the full screen height */
  padding: 20px;
  z-index: 2;
}

.subscription-container {
  background: var(--card-background);
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 30px;
  max-width: 750px; /* Increased from the default */
  width: 95%;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

.state-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.icon-wrapper.active {
  background-color: #d1fae5;
  color: var(--success-color);
}

h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
}

.price-display {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 12px;
}

.feature-description,
.trial-info {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 24px;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  text-align: left;
  align-self: flex-start;
}

.features-list li {
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.features-list li::before {
  content: "✓";
  color: var(--success-color);
  font-weight: bold;
  margin-right: 12px;
}

.cta-button,
.secondary-button,
.dashboard-link {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
}

.cta-button {
  background-color: var(--primary-color);
  color: white;
}

.cta-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.cta-button:disabled {
  background-color: #d1d5db;
  cursor: not-allowed;
}

.secondary-button,
.dashboard-link {
  background-color: transparent;
  color: var(--text-primary);
  border-color: #d1d5db;
  margin-top: 12px;
}

.secondary-button:hover,
.dashboard-link:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.secondary-button.danger {
  color: var(--error-color);
  border-color: var(--error-color);
}
.secondary-button.danger:hover {
  background-color: #fef2f2;
}

.button-group {
  width: 100%;
  margin-top: 12px;
}
.button-group .secondary-button {
  margin-top: 0;
  margin-bottom: 12px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin: 0;
}

.stat-tile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  justify-self: end;
}
.status-badge.active,
.status-badge.trialing {
  background-color: #d1fae5;
  color: #065f46;
}
.status-badge.past_due {
  background-color: #fef3c7;
  color: #92400e;
}
.status-badge.canceled,
.status-badge.paused {
  background-color: #e5e7eb;
  color: #4b5563;
}

.error-text {
  color: var(--error-color);
  margin: 12px 0 24px;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-left-color: var(--primary-color);
  animation: spin 1s ease infinite;
  margin-bottom: 24px;
}

.subscription-footer {
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-secondary);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.plan-options-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  width: 100%;
  margin: 10px 0 30px;
}

.subscription-container.wide {
  max-width: 860px;
}

.plan-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 25px;
  text-align: left;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  position: relative;
}

.plan-card.recommended {
  border-color: var(--primary-color);
  border-width: 2px;
}

.recommended-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

.plan-name {
  font-size: 1.5em;
  font-weight: 600;
  margin: 0 0 5px 0;
}

.plan-price {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px 0;
}

.billing-cycle-text {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Styles for the Plan Feature Lists */
.plan-card .features-list {
  /* Remove default padding and bullets */
  list-style: none;
  padding-left: 0;
  margin: 0 0 25px 0;
  flex-grow: 1;
}

.plan-card .features-list li {
  /* Flexbox properties removed to allow normal text flow */
  margin-bottom: 12px;
  font-size: 0.9em;
  color: #4b5563;
  line-height: 1.4;
  padding-left: 28px; /* Keeps space for the checkmark */
  position: relative; /* For positioning the checkmark */
}

/* This rule for the checkmark is correct and can stay */
.plan-card .features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #34d399;
  font-size: 16px;
  line-height: 1.4;
  font-weight: bold;
}

.plan-card .features-list li strong {
  font-weight: 600;
  color: #1f2937;
  margin-right: 7px;
}

.plan-card .cta-button {
  width: 100%;
}

.plan-card .cta-button:disabled {
  background-color: #6b7280;
  cursor: not-allowed;
}

.plan-card.enterprise-card {
  background-color: #f7f9fc;
  border-color: #e7eaf3;
}

/* --- NEW BILLING CYCLE TOGGLE STYLES --- */
.billing-cycle-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  font-weight: 600;
  color: var(--text-secondary);
}
.billing-cycle-toggle .monthly-label {
  color: var(--primary-color);
}
.billing-cycle-toggle .annual-label {
  color: var(--success-color);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-color);
  transition: 0.4s;
  border-radius: 26px;
}
.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--success-color);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.annual-discount-badge {
  background-color: var(--success-color);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

/* --- NEW UPGRADE BUTTON STYLES --- */
.upgrade-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.upgrade-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

.upgrade-button:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.upgrade-title {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.upgrade-desc {
  font-size: 1em;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- NEW --- Styles for the primary upgrade button */
.upgrade-button.pro-upgrade {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.upgrade-button.pro-upgrade .upgrade-title,
.upgrade-button.pro-upgrade .upgrade-desc {
  color: white;
}

.upgrade-button.pro-upgrade:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* ---------- Active subscription page ---------- */
.plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  margin: 8px 0 24px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-align: left;
}

.plan-summary-name {
  font-size: 1.25em;
  font-weight: 700;
}

.plan-summary-renews {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-section {
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.section-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin: -4px 0 4px;
}

#addOnButtons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.addon-row:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.addon-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.addon-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.addon-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.addon-action {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.addon-row:hover .addon-action {
  background: var(--primary-hover);
}

.upgrade-buttons-container {
  gap: 10px;
}

.upgrade-buttons-container .upgrade-button {
  align-items: flex-start;
  text-align: left;
  font-family: inherit;
}

.upgrade-buttons-container .upgrade-title {
  font-size: 1.05em;
}

.upgrade-buttons-container .upgrade-desc {
  font-size: 0.9em;
}

.billing-section {
  width: 100%;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
  text-align: center;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.link-button {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--text-primary);
}

.link-button.danger:hover {
  color: var(--error-color);
}

.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

.contact-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 14px 0 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .plan-options-container {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 600px) {
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .subscription-container {
    padding: 20px;
  }
}

/* © 2026 HumanWidget. All Rights Reserved. */
