:root {
  --bg-color: #0B0A15;
  --panel-bg: rgba(26, 24, 41, 0.4);
  --input-bg: rgba(255, 255, 255, 0.05);
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --accent-color: #A855F7;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --error-color: #EF4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(168, 85, 247, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(79, 70, 229, 0.15), transparent 25%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.checkout-layout {
  width: 100%;
  max-width: 600px;
  padding: 2rem 1rem;
}

.checkout-form-container {
  width: 100%;
}

.form-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  margin: 0;
  letter-spacing: 0.05em;
}

.section-header hr {
  flex-grow: 1;
  border: 0;
  border-top: 1px solid var(--border-color);
}

/* Plan Selection */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-option {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.plan-option.active {
  border-color: #FFFFFF;
  background: #262626;
}

.plan-option input[type="radio"] {
  display: none;
}

.plan-info {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-name {
  font-weight: 500;
  font-size: 1rem;
}

.plan-price, .plan-price-details {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.original-price {
  text-decoration: line-through;
  margin-right: 0.5rem;
  opacity: 0.6;
}

.discounted-price {
  color: #FFFFFF;
}

.annual-badge {
  color: #D8B4FE;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Inputs */
.input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.input-row .input-group {
  flex: 1;
  margin-bottom: 0;
}

.input-group {
  margin-bottom: 0.75rem;
}

input {
  width: 100%;
  padding: 1.25rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #666666;
}

input::placeholder {
  color: #6B7280;
}

.phone-group {
  position: relative;
  display: flex;
  align-items: center;
}

.flag-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.25rem;
}

.phone-group input {
  padding-left: 3.5rem;
}

/* Summary */
.checkout-summary {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.summary-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.summary-icon {
  color: var(--text-secondary);
}

.summary-label {
  flex-grow: 1;
  font-weight: 500;
}

.summary-amount {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chevron {
  opacity: 0.5;
}

/* Submit Button */
.submit-button {
  width: 100%;
  background: var(--accent-color);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 20px var(--accent-glow);
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow);
  opacity: 0.9;
}

.submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.submit-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.submit-subtext {
  font-size: 1.125rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Footer */
.checkout-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.lock-icon {
  font-size: 0.875rem;
}

/* Stripe Elements */
#payment-element {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.message-container {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error-color);
  color: var(--error-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner for loading state */
#spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .input-row {
    flex-direction: column;
  }
}