/* ============================================
   ATLASSIAN-INSPIRED MODERN THEME
   - Professional, spacious design
   - Smooth gradients and shadows
   - Clean typography
   - Modern color palette
   ============================================ */

/* ============================================
   CSS VARIABLES - Atlassian-inspired palette
   ============================================ */
:root {
  /* Brand colors - can be overridden by JavaScript */
  --primary-color: #0052CC;
  --secondary-color: #00B8D9;
  --accent-color: #6554C0;
  
  /* UI Colors - Atlassian palette */
  --text-primary: #172B4D;
  --text-secondary: #5E6C84;
  --text-tertiary: #8993A4;
  --border-color: #DFE1E6;
  --bg-primary: #FFFFFF;
  --bg-secondary: #FAFBFC;
  --bg-tertiary: #F4F5F7;
  --bg-hover: #EBECF0;
  
  /* Status Colors */
  --success: #00875A;
  --error: #DE350B;
  --warning: #FF991F;
  --info: #0065FF;
  
  /* Shadows - Atlassian style */
  --shadow-sm: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-md: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-lg: 0 8px 16px -4px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-xl: 0 20px 32px -8px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0052CC 0%, #0065FF 100%);
  --gradient-secondary: linear-gradient(135deg, #00B8D9 0%, #00C7E6 100%);
  --gradient-hero: linear-gradient(135deg, #0747A6 0%, #0052CC 50%, #0065FF 100%);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
  --transition-base: 250ms cubic-bezier(0.2, 0, 0, 1);
  --transition-slow: 350ms cubic-bezier(0.2, 0, 0, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================
   HEADER - Atlassian Style
   ============================================ */
.modern-header {
  background: var(--bg-primary);
  border-bottom: 2px solid var(--bg-tertiary);
  padding: 24px 0;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.powered-by {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.powered-by strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding: 64px 0;
  min-height: calc(100vh - 100px);
}

/* ============================================
   PROGRESS BAR - Atlassian Stepped Progress
   ============================================ */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 56px;
  padding: 32px;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.step-indicator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 3px solid transparent;
  transition: all var(--transition-base);
  position: relative;
  z-index: 2;
}

.progress-step.active .step-indicator {
  background: var(--gradient-primary);
  color: white;
  border-color: white;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
  transform: scale(1.1);
}

.progress-step.completed .step-indicator {
  background: var(--success);
  color: white;
  border-color: white;
}

.progress-step.completed .step-indicator::after {
  content: '✓';
  position: absolute;
  font-size: 18px;
  font-weight: 700;
}

.step-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.progress-step.active .step-label {
  color: var(--primary-color);
  font-weight: 700;
}

.progress-line {
  width: 48px;
  height: 3px;
  background: var(--border-color);
  margin: 0 8px;
  flex-shrink: 0;
  position: relative;
  top: -16px;
}

.progress-step.completed + .progress-line {
  background: var(--success);
}

/* Mobile Progress */
@media (max-width: 768px) {
  .progress-bar {
    padding: 20px;
  }
  
  .step-label {
    display: none;
  }
  
  .step-indicator {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .progress-line {
    width: 24px;
    margin: 0 4px;
  }
}

/* ============================================
   FORM SECTIONS
   ============================================ */
.enrollment-form {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 56px;
  box-shadow: var(--shadow-lg);
}

.form-section {
  display: none;
  animation: fadeInUp var(--transition-slow) ease-out;
}

.form-section.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.section-description {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   FORM FIELDS - Atlassian Style
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-grid-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

.form-field {
  margin-bottom: 24px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all var(--transition-base);
  font-weight: 500;
}

.form-field input:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-secondary);
}

.form-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
  background: var(--bg-primary);
}

.form-field input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-weight: 500;
}

/* ============================================
   GRADE & ISEE SELECTION - Pill Style
   ============================================ */
.grade-grid,
.isee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 12px;
}

.grade-option,
.isee-option {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 24px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  letter-spacing: -0.01em;
}

.grade-option:hover,
.isee-option:hover {
  background: var(--bg-hover);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.grade-option.selected,
.isee-option.selected {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
  transform: translateY(-2px);
}

/* ============================================
   COURSE SELECTION - Atlassian Cards
   ============================================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.course-card {
  padding: 32px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.course-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.course-card:hover::before {
  transform: scaleX(1);
}

.course-card.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.05) 0%, rgba(0, 101, 255, 0.05) 100%);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.course-card.selected::before {
  transform: scaleX(1);
  height: 6px;
}

.course-card.selected::after {
  content: '✓';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

.course-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
}

.course-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.course-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.course-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 500;
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.course-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.skeleton-product {
  height: 280px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.course-skeleton.hidden {
  display: none;
}

/* ============================================
   PAYMENT LAYOUT
   ============================================ */
.payment-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.summary-card,
.payment-card {
  padding: 32px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.summary-card h3,
.payment-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 15px;
}

.summary-row:last-of-type {
  border-bottom: none;
}

.summary-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.summary-value {
  color: var(--text-primary);
  font-weight: 700;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin: 24px -32px -32px;
  background: var(--bg-tertiary);
  border-top: 2px solid var(--border-color);
  border-radius: 0 0 12px 12px;
  font-weight: 700;
}

.total-amount {
  font-size: 32px;
  color: var(--primary-color);
  letter-spacing: -0.03em;
  font-weight: 700;
}

/* ============================================
   PAYMENT PLAN SELECTOR
   ============================================ */
.payment-plan-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.plan-option {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.plan-option:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.plan-option input[type="radio"] {
  margin-right: 16px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.plan-option:has(input:checked) {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.05) 0%, rgba(0, 101, 255, 0.05) 100%);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.15);
}

.plan-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.plan-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.plan-desc {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.installment-info {
  padding: 20px;
  background: rgba(0, 184, 217, 0.08);
  border-radius: 12px;
  margin-bottom: 32px;
  border-left: 4px solid var(--secondary-color);
}

.installment-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.schedule-date {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
  font-weight: 500;
}

/* ============================================
   PAYMENT METHOD
   ============================================ */
.payment-method {
  margin-bottom: 32px;
}

.payment-method label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stripe-element {
  padding: 16px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all var(--transition-base);
}

.stripe-element:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
}

.error-message {
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
}

/* ============================================
   BUTTONS - Atlassian Style
   ============================================ */
.btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.01em;
  text-transform: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0747A6 0%, #0052CC 100%);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-pay {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--bg-tertiary);
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   CONFIRMATION
   ============================================ */
.confirmation-card {
  text-align: center;
  padding: 64px 32px;
}

.success-icon {
  margin: 0 auto 32px;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon svg {
  filter: drop-shadow(0 4px 12px rgba(0, 135, 90, 0.3));
}

.confirmation-card h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.confirmation-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 500;
}

.ach-notice {
  padding: 20px;
  background: rgba(255, 153, 31, 0.1);
  border: 2px solid var(--warning);
  border-radius: 12px;
  margin-bottom: 40px;
}

.ach-notice p {
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  font-weight: 600;
}

.confirmation-details {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 40px;
}

.confirmation-details h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span:first-child {
  color: var(--text-secondary);
  font-weight: 600;
}

.detail-row span:last-child {
  color: var(--text-primary);
  font-weight: 700;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */
.form-errors {
  padding: 16px 20px;
  background: rgba(222, 53, 11, 0.1);
  border: 2px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ============================================
   INSTALLMENT & BREAKDOWN
   ============================================ */
.installment-breakdown {
  padding: 16px;
  background: rgba(0, 184, 217, 0.08);
  border-radius: 8px;
  margin: 16px 0;
  border-left: 4px solid var(--secondary-color);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.breakdown-row span:last-child {
  color: var(--text-primary);
  font-weight: 700;
}

.course-summary-details {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .enrollment-form {
    padding: 32px;
  }
  
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .payment-layout {
    grid-template-columns: 1fr;
  }
  
  .course-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header h2 {
    font-size: 24px;
  }
  
  .form-actions {
    flex-direction: column-reverse;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* ============================================
   FLATPICKR OVERRIDES
   ============================================ */
.flatpickr-calendar {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  border: 2px solid var(--border-color) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
}

.flatpickr-day.selected {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3) !important;
}

.flatpickr-day:hover {
  background: var(--bg-hover) !important;
  border-color: var(--primary-color) !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}
