/* ============================================
   Apply Page — Multi-Program Application Form
   ============================================ */

/* ---------- Page Hero ---------- */
.apply-hero {
  background: linear-gradient(135deg, #1a365d 0%, #2d6a4d 100%);
  color: #fff;
  padding: calc(64px + 2.5rem) 0 2.5rem;
  text-align: center;
}
.apply-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.apply-hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Application Status Bar ---------- */
.app-status-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.app-status-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: #6b7280;
  flex-wrap: wrap;
}
.app-status-id strong {
  color: #1a365d;
  font-family: 'Courier New', monospace;
}
.app-status-saved {
  color: #059669;
  margin-left: auto;
}
#btn-save-exit {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
}

/* ---------- Resume Banner ---------- */
.resume-banner {
  background: #eff6ff;
  border-bottom: 2px solid #3b82f6;
  padding: 0.8rem 0;
}
.resume-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: #1e40af;
}
.resume-banner-inner strong {
  color: #1a365d;
}
.resume-banner-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Form Section ---------- */
.apply-form-section {
  padding: 2rem 0 4rem;
  background: #f9fafb;
  min-height: 70vh;
}
.apply-form-inner {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 2.5rem;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.progress-step span {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: #e5e7eb;
  color: #6b7280;
  transition: all 0.3s;
}
.progress-step small {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
  transition: color 0.3s;
  white-space: nowrap;
}
.progress-step.active span {
  background: #1a365d;
  color: #fff;
}
.progress-step.active small {
  color: #1a365d;
}
.progress-step.done span {
  background: #059669;
  color: #fff;
}
.progress-line {
  flex: 1;
  height: 3px;
  background: #e5e7eb;
  max-width: 50px;
  margin: 0 0.4rem;
  margin-bottom: 1.2rem;
  transition: background 0.3s;
}
.progress-line.done {
  background: #059669;
}

/* ---------- Steps ---------- */
.apply-step {
  animation: fadeIn 0.4s ease;
}
.apply-step.hidden {
  display: none;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.apply-step h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}
.step-desc {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 2rem;
}
.step-desc strong {
  color: #1a365d;
}

/* ================================================================
   STEP 1: PROGRAM SELECTION
   ================================================================ */

/* Selected Programs */
.selected-programs {
  margin-bottom: 1.5rem;
}
.selected-programs-empty {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  border: 2px dashed #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.8;
}
.selected-programs-empty a {
  color: #1a365d;
  font-weight: 500;
}

.program-select-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.program-select-card:hover {
  border-color: #86efac;
}
.program-select-info {
  flex: 1;
  min-width: 0;
}
.program-select-name {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
  margin-bottom: 0.3rem;
}
.program-select-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}
.program-select-meta span {
  position: relative;
}
.program-select-meta span + span::before {
  content: '·';
  margin-right: 0.75rem;
  color: #d1d5db;
}
.program-select-tuition {
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
  margin-top: 0.25rem;
}
.program-select-remove {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.program-select-remove:hover {
  background: #fecaca;
  border-color: #f87171;
}

/* Add Program */
.add-program-area {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
}
.add-program-icon {
  font-size: 1.3rem;
  font-weight: 700;
  margin-right: 0.3rem;
}
.add-program-hint {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}

/* Fee Summary */
.fee-summary {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.fee-summary h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.75rem;
}
.fee-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #78350f;
  padding: 0.35rem 0;
}
.fee-row.fee-total {
  border-top: 1.5px solid #fcd34d;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a365d;
}

/* ================================================================
   ADD PROGRAM MODAL
   ================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: #fff;
  border-radius: 1rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}
.modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  font-size: 1.2rem;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #e5e7eb;
  color: #111827;
}
.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
.modal-search {
  margin-bottom: 1rem;
}
.modal-search .form-input {
  width: 100%;
}
.modal-results {
  max-height: 50vh;
  overflow-y: auto;
}
.modal-loading,
.modal-no-results {
  text-align: center;
  color: #9ca3af;
  padding: 2rem;
  font-size: 0.95rem;
}
.modal-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.modal-result-item:hover {
  border-color: #1a365d;
  background: #f8fafc;
}
.modal-result-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  color: #111827;
}
.modal-result-meta {
  font-size: 0.8rem;
  color: #6b7280;
  flex: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-result-item .btn {
  flex-shrink: 0;
}

/* ================================================================
   STEP 5: PAYMENT
   ================================================================ */

.payment-card {
  margin-bottom: 1.5rem;
}
.payment-order {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.payment-order h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 0.75rem;
}
.payment-order-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #374151;
  padding: 0.3rem 0;
}
.payment-order-school {
  color: #6b7280;
  font-size: 0.85rem;
}
.payment-order-total {
  display: flex;
  justify-content: space-between;
  border-top: 1.5px solid #bbf7d0;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1a365d;
}

.payment-method {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.payment-method h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}

/* PayPal Placeholder */
.paypal-placeholder {
  text-align: center;
  padding: 2rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
}
.paypal-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.paypal-placeholder-text {
  font-size: 0.95rem;
  color: #374151;
  font-weight: 500;
}
.paypal-placeholder-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}
#paypal-button-container {
  margin-top: 1rem;
}

/* Bank Transfer */
.bank-transfer {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.25rem;
}
.bank-transfer h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}
.bank-transfer > p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}
.bank-details {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 0.85rem;
}
.bank-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  color: #374151;
}
.bank-row span:first-child {
  color: #6b7280;
  font-weight: 500;
}

/* ================================================================
   STEP 6: SUCCESS
   ================================================================ */

.success-card {
  text-align: center;
  padding: 2rem 1rem;
}
.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.success-card h2 {
  font-size: 1.8rem;
  color: #059669;
  margin-bottom: 0.75rem;
}
.success-id {
  font-size: 1.1rem;
  color: #374151;
  margin-bottom: 1.5rem;
}
.success-id strong {
  color: #1a365d;
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
}
.success-programs {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.success-programs p {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.5rem;
}
.success-program-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
}
.success-program-list li {
  font-size: 0.85rem;
  color: #065f46;
  padding: 0.2rem 0;
}
.success-program-list li::before {
  content: '✓ ';
  color: #059669;
  font-weight: 700;
}
.success-fee {
  font-size: 0.9rem;
  color: #1a365d;
  border-top: 1px solid #bbf7d0;
  padding-top: 0.5rem;
}
.success-next {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
}
.success-next h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.75rem;
}
.success-next ol {
  padding-left: 1.25rem;
  color: #374151;
  line-height: 1.8;
}
.success-next li {
  margin-bottom: 0.5rem;
}
.success-email {
  font-size: 0.95rem;
  color: #6b7280;
}

/* ================================================================
   FORM ELEMENTS (Shared)
   ================================================================ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.form-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}
.form-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group.full-width {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}
.form-select,
.form-input {
  padding: 0.7rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}
.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #1a365d;
  box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
}
.form-input::placeholder {
  color: #9ca3af;
}
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}
.checkbox-group {
  margin-top: 1rem;
}
.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  accent-color: #1a365d;
  cursor: pointer;
}
.checkbox-group a {
  color: #1a365d;
  text-decoration: underline;
}

/* Upload Grid */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.upload-card {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.2s;
}
.upload-card.uploaded {
  border-color: #059669;
  background: #f0fdf4;
}
.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.upload-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}
.upload-status {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}
.upload-status.uploaded {
  color: #059669;
  font-weight: 500;
}
.upload-card .btn {
  width: 100%;
}
.upload-note {
  font-size: 0.9rem;
  color: #6b7280;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

/* Review */
.review-section {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.review-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.75rem;
}
.review-content {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.7;
}
.review-program-item {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.review-program-item:last-child {
  border-bottom: none;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}
.review-grid .review-item {
  font-size: 0.9rem;
  color: #374151;
}
.review-grid .review-label {
  color: #6b7280;
  font-weight: 500;
}
.review-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.review-docs .doc-status {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.review-docs .doc-status.uploaded {
  background: #d1fae5;
  color: #065f46;
}
.review-docs .doc-status.pending {
  background: #fef3c7;
  color: #92400e;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn {
    width: 100%;
  }
  .progress-line {
    max-width: 20px;
  }
  .progress-step small {
    font-size: 0.65rem;
  }
  .upload-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .apply-form-inner {
    padding: 1.5rem;
  }
  .app-status-inner {
    font-size: 0.75rem;
    gap: 0.5rem;
  }
  .resume-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .modal-result-item {
    flex-wrap: wrap;
  }
  .modal-result-meta {
    flex: auto;
    width: 100%;
  }
  .program-select-card {
    flex-wrap: wrap;
  }
}

/* ================================================================
   PROGRAM FINDER (Matching Tool)
   ================================================================ */

#step-finder {
  /* Finder is always shown when active, no hidden by default */
}
.finder-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.finder-filter-group {
  flex: 1;
  min-width: 150px;
}
.finder-filter-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.3rem;
}
.finder-filter-actions {
  display: flex;
  align-items: flex-end;
}
.finder-filter-actions .btn {
  height: 42px;
}
.finder-results {
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.5rem;
}
.finder-placeholder {
  text-align: center;
  color: #9ca3af;
  padding: 2rem;
  font-size: 0.95rem;
}
.finder-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f3f4f6;
}
.finder-result-item:last-child {
  border-bottom: none;
}
.finder-result-item:hover {
  background: #f8fafc;
}
.finder-result-item:has(input:checked) {
  background: #f0fdf4;
}
.finder-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #059669;
  flex-shrink: 0;
  cursor: pointer;
}
.finder-result-info {
  flex: 1;
  min-width: 0;
}
.finder-result-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #111827;
}
.finder-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.2rem;
}
.finder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
}
.finder-selected-count {
  font-size: 0.9rem;
  color: #059669;
  font-weight: 500;
}

/* ================================================================
   BASKET FLOATING BAR (Programs page)
   ================================================================ */

.basket-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a365d;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.basket-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}
.basket-bar-inner strong {
  color: #fbbf24;
}
.basket-bar-inner .btn {
  background: #fff;
  color: #1a365d;
  border-color: #fff;
}
.basket-bar-inner .btn:hover {
  background: #f0fdf4;
  border-color: #f0fdf4;
}

/* Apply Now button added state */
.btn-added {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #fff !important;
  pointer-events: none;
}
