/* Modern Application Form Styles */

/* ============================================
   BACKGROUND & LAYOUT
   ============================================ */

/* Ensure breadcrumb is visible and styled for light background */
.breadcrumb-area {
  position: relative;
  z-index: 10;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.breadcrumb-area .breadcrumb-item.active {
  color: var(--theme-color);
  font-weight: 600;
}

.breadcrumb-area .breadcrumb-item a {
  color: #4a5568;
  transition: color 0.2s ease;
}

.breadcrumb-area .breadcrumb-item a:hover {
  color: var(--theme-color);
}

.application-page-wrapper {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdf4 100%);
  margin-top: -30px; /* Pull up to reduce gap after breadcrumb */
  padding-top: 30px;
}

.application-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.bg-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(17, 110, 99, 0.02) 0%,
    rgba(253, 163, 27, 0.03) 100%
  );
}

.bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 20% 50%,
      rgba(17, 110, 99, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(253, 163, 27, 0.05) 0%,
      transparent 50%
    );
  background-size: 100% 100%;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.application-container {
  position: relative;
  z-index: 1;
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

/* ============================================
   LEFT SECTION - FORM AREA
   ============================================ */

.application-form-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.application-header {
  border-bottom: 3px solid #e2e8f0;
  padding-bottom: 1.5rem;
  position: relative;
}

.application-header::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
  border-radius: 3px;
}

.application-header .header-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  box-shadow: 0 6px 20px rgba(17, 110, 99, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.application-header h2 {
  color: #1a202c;
  font-weight: 700;
  font-size: 2rem;
}

.application-header .lead {
  color: #4a5568;
  font-size: 1rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ============================================
   MODERN TIMELINE
   ============================================ */

.application-timeline {
  margin-bottom: 2rem;
  /* Background now handled by timeline-container */
}

.timeline-container {
  display: flex;
  flex-direction: row;
  gap: 0;
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(17, 110, 99, 0.06) 0%,
    rgba(253, 163, 27, 0.04) 100%
  );
  padding: 2rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 2px solid rgba(17, 110, 99, 0.2);
  box-shadow: 0 4px 15px rgba(17, 110, 99, 0.12);
  overflow-x: auto;
  justify-content: space-between;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  transition: all 0.3s ease;
  padding: 0 1rem;
  text-align: center;
  min-width: 120px;
}

.timeline-item:hover {
  transform: translateY(-5px);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: calc(50% + 1.5rem);
  top: 1.5rem;
  width: calc(100% - 3rem);
  height: 3px;
  background: #e2e8f0;
  transition: background 0.3s ease;
  z-index: 1;
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-marker {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: white;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #a0aec0;
  transition: all 0.3s ease;
  z-index: 2;
  margin-bottom: 0.75rem;
}

.marker-number {
  display: block;
}

.marker-check {
  display: none;
  color: white;
  font-size: 1.2rem;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-title {
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.timeline-desc {
  color: #4a5568;
  font-size: 0.75rem;
  margin-bottom: 0;
  font-weight: 500;
  line-height: 1.3;
}

/* Timeline Active State */
.timeline-item.active .timeline-marker {
  background: linear-gradient(
    135deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
  border-color: var(--theme-color);
  color: white;
  box-shadow: 0 6px 20px rgba(17, 110, 99, 0.5);
  transform: scale(1.15);
}

.timeline-item.active .timeline-title {
  color: var(--theme-color);
  font-weight: 700;
}

.timeline-item.active::after {
  background: linear-gradient(to right, var(--theme-color), #e2e8f0);
}

/* Timeline Completed State */
.timeline-item.completed .timeline-marker {
  background: #48bb78;
  border-color: #48bb78;
  color: white;
  box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.timeline-item.completed .marker-number {
  display: none;
}

.timeline-item.completed .marker-check {
  display: block;
}

.timeline-item.completed::after {
  background: #48bb78;
}

.timeline-item.completed .timeline-title {
  color: #48bb78;
}

/* ============================================
   FORM CARD
   ============================================ */

.application-form-card {
  background: #ffffff; /* Pure white for main form card */
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(17, 110, 99, 0.08);
  border: 1px solid rgba(17, 110, 99, 0.15);
  animation: slideIn 0.5s ease-out;
}

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

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

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

/* ============================================
   NAVIGATION
   ============================================ */

.form-navigation {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f0f0f0;
}

.navigation-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.step-badge {
  background: linear-gradient(
    135deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(17, 110, 99, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-previous,
.btn-next,
.btn-submit {
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.btn-next,
.btn-submit {
  background: var(--theme-color2);
  border: none;
  box-shadow: 0 4px 15px rgba(17, 110, 99, 0.4);
}

.btn-next:hover,
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(17, 110, 99, 0.5);
}

/* ============================================
   RIGHT SECTION - STATUS CHECKER
   ============================================ */

.application-status-section {
  position: sticky;
  top: 2rem;
}

.status-checker-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(17, 110, 99, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(17, 110, 99, 0.2);
}

.status-checker-card .card-header {
  background: var(--theme-color);
  color: white;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.status-checker-card .card-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.status-checker-card .header-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.status-checker-card .card-header h4 {
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  position: relative;
  color: white;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-checker-card .card-header p {
  margin-bottom: 0;
  opacity: 0.95;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.status-checker-card .card-body {
  padding: 2rem;
}

.status-form .form-label {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.status-form .form-control-lg {
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.status-form .form-control-lg:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 4px rgba(17, 110, 99, 0.15);
}

.status-form .btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-form .btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.status-form .btn-warning:active {
  transform: translateY(0);
}

.status-result {
  border-top: 2px solid #e2e8f0;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.status-info {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8eef5 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status-header h5 {
  margin: 0;
  font-weight: 700;
  color: #2d3748;
}

.status-badge {
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
}

.status-badge.draft {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-color: #fcd34d;
}

.status-badge.submitted {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border-color: #93c5fd;
}

.status-badge.under-review {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
  border-color: #a5b4fc;
}

.status-badge.approved {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}

.status-badge.rejected {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

.status-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

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

.detail-label {
  font-weight: 600;
  color: #718096;
  font-size: 0.9rem;
}

.detail-value {
  font-weight: 600;
  color: #2d3748;
  text-align: right;
}

/* ============================================
   QUICK INFO CARD
   ============================================ */

.quick-info-card {
  background: #ffffff;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.quick-info-card .card-title {
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.quick-info-card .card-title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.info-list li:hover {
  padding-left: 0.5rem;
  background: #f7fafc;
  margin: 0 -0.5rem;
  padding-right: 0.5rem;
  border-radius: 8px;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li i {
  flex-shrink: 0;
  font-size: 1.2rem;
  margin-top: 0.1rem;
  color: var(--theme-color);
}

.info-list li span {
  flex: 1;
  color: #2d3748;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================
   HELP CARD
   ============================================ */

.help-card {
  background: var(--theme-color);
  color: white;
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 10px 35px rgba(17, 110, 99, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.help-card .help-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 1rem;
}

.help-card h5 {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.help-card p {
  opacity: 0.95;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.help-card .btn-outline-primary {
  background: var(--theme-color2);
  color: white;
  border: none;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.help-card .btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

@media (max-width: 991px) {
  .application-status-section {
    position: static;
    margin-top: 2rem;
  }

  .timeline-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .timeline-item {
    min-width: 100px;
  }
}

@media (max-width: 767px) {
  .application-form-section {
    padding: 1.5rem;
  }

  .application-header .header-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .application-header h2 {
    font-size: 1.5rem;
  }

  .timeline-container {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-item {
    flex-direction: row;
    text-align: left;
    padding: 1rem;
    margin-bottom: 0.5rem;
  }

  .timeline-item::after {
    display: none;
  }

  .timeline-marker {
    margin-bottom: 0;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .timeline-content {
    align-items: flex-start;
  }

  .navigation-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-left,
  .nav-center,
  .nav-right {
    width: 100%;
  }

  .btn-previous,
  .btn-next,
  .btn-submit {
    width: 100%;
  }
}

/* ============================================
   ENHANCED FORM CONTROLS & INPUTS
   ============================================ */

/* Form Inputs */
.application-form-card .form-control,
.application-form-card .form-select {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.application-form-card .form-control:focus,
.application-form-card .form-select:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 4px rgba(17, 110, 99, 0.15),
    0 0 20px rgba(17, 110, 99, 0.08);
  outline: none;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.application-form-card .form-control:hover:not(:focus),
.application-form-card .form-select:hover:not(:focus) {
  border-color: #cbd5e0;
}

/* Form Labels */
.application-form-card label {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.application-form-card label.required::after {
  content: " *";
  color: #e53e3e;
  font-weight: 700;
}

/* Primary Button Enhancement */
.btn-primary {
  background: var(--theme-color2);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(17, 110, 99, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(17, 110, 99, 0.45);
  background: linear-gradient(135deg, #0d5a52 0%, #ea8c00 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button Enhancement */
.btn-secondary {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  color: #4a5568;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
  color: #2d3748;
}

/* Section Headers within Form */
.application-form-card h3,
.application-form-card h4 {
  color: #2d3748;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.application-form-card h3::after,
.application-form-card h4::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--theme-color) 0%,
    var(--theme-color2) 100%
  );
}

/* Form Help Text */
.application-form-card .form-text {
  color: #718096;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Hide validation messages by default until form is submitted or field is touched */
.application-form-card:not(.was-validated) .invalid-feedback,
.application-form-card:not(.was-validated) .valid-feedback {
  display: none !important;
}

.application-form-card:not(.was-validated) .is-invalid,
.application-form-card:not(.was-validated) .is-valid {
  border-color: #e2e8f0 !important;
  background-color: #ffffff !important;
}

/* Also hide on individual fields that haven't been touched */
.application-form-card .form-control:not(.touched) ~ .invalid-feedback,
.application-form-card .form-control:not(.touched) ~ .valid-feedback,
.application-form-card .form-select:not(.touched) ~ .invalid-feedback,
.application-form-card .form-select:not(.touched) ~ .valid-feedback {
  display: none !important;
}

.application-form-card .form-control:not(.touched).is-invalid,
.application-form-card .form-control:not(.touched).is-valid,
.application-form-card .form-select:not(.touched).is-invalid,
.application-form-card .form-select:not(.touched).is-valid {
  border-color: #e2e8f0 !important;
  background-color: #ffffff !important;
}

/* Invalid Feedback Enhancement */
.application-form-card .invalid-feedback {
  color: #e53e3e;
  font-size: 0.875rem;
  font-weight: 500;
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.25rem;
}

/* Only show invalid feedback after user interaction */
.application-form-card
  .form-control.is-invalid:not(:placeholder-shown)
  ~ .invalid-feedback,
.application-form-card
  .form-select.is-invalid:not(:placeholder-shown)
  ~ .invalid-feedback,
.application-form-card .form-control.is-invalid:focus ~ .invalid-feedback,
.application-form-card .form-select.is-invalid:focus ~ .invalid-feedback,
.application-form-card
  .form-control.is-invalid.was-validated
  ~ .invalid-feedback,
.application-form-card
  .form-select.is-invalid.was-validated
  ~ .invalid-feedback {
  display: flex;
}

.application-form-card .is-invalid {
  border-color: #e2e8f0; /* Default border until interaction */
  background-color: #ffffff;
}

/* Only show invalid styling after user interaction */
.application-form-card .form-control.is-invalid:not(:placeholder-shown),
.application-form-card .form-select.is-invalid:not(:placeholder-shown),
.application-form-card .form-control.is-invalid:focus,
.application-form-card .form-select.is-invalid:focus,
.application-form-card .form-control.is-invalid.was-validated,
.application-form-card .form-select.is-invalid.was-validated {
  border-color: #e53e3e;
  background-color: #fff5f5;
}

.application-form-card .is-invalid:focus {
  border-color: #e53e3e;
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1);
}

/* Valid Feedback Enhancement */
.application-form-card .valid-feedback {
  color: #48bb78;
  font-size: 0.875rem;
  font-weight: 500;
  display: none; /* Hidden by default */
}

/* Only show valid feedback after user interaction */
.application-form-card
  .form-control.is-valid:not(:placeholder-shown)
  ~ .valid-feedback,
.application-form-card
  .form-select.is-valid:not(:placeholder-shown)
  ~ .valid-feedback,
.application-form-card .form-control.is-valid.was-validated ~ .valid-feedback,
.application-form-card .form-select.is-valid.was-validated ~ .valid-feedback {
  display: block;
}

.application-form-card .is-valid {
  border-color: #e2e8f0; /* Default border until interaction */
  background-color: #ffffff;
}

/* Only show valid styling after user interaction */
.application-form-card .form-control.is-valid:not(:placeholder-shown),
.application-form-card .form-select.is-valid:not(:placeholder-shown),
.application-form-card .form-control.is-valid.was-validated,
.application-form-card .form-select.is-valid.was-validated {
  border-color: #48bb78;
  background-color: #f0fff4;
}

/* Radio & Checkbox Enhancement */
.application-form-card .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e0;
  transition: all 0.2s ease;
}

.application-form-card .form-check-input:checked {
  background-color: var(--theme-color);
  border-color: var(--theme-color);
  box-shadow: 0 2px 8px rgba(17, 110, 99, 0.3);
}

.application-form-card .form-check-input:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 3px rgba(17, 110, 99, 0.1);
}

.application-form-card .form-check-label {
  margin-left: 0.5rem;
  color: #4a5568;
  cursor: pointer;
}

/* Disabled States */
.application-form-card .form-control:disabled,
.application-form-card .form-select:disabled {
  background-color: #f7fafc;
  border-color: #e2e8f0;
  color: #a0aec0;
  cursor: not-allowed;
  opacity: 0.6;
}

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

.btn-primary:disabled:hover,
.btn-secondary:disabled:hover,
.btn-warning:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Loading States */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s ease-in-out infinite;
}

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

/* Focus Visible for Keyboard Navigation */
.application-form-card *:focus-visible {
  outline: 3px solid var(--theme-color);
  outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-warning:focus-visible {
  outline: 3px solid var(--theme-color);
  outline-offset: 3px;
}

/* ============================================
   TOM SELECT CUSTOM STYLES
   ============================================ */

/* Village dropdown Tom Select styling - Match form-control appearance */
.ts-wrapper {
  width: 100% !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 0.65rem 1rem !important;
  background-color: #ffffff !important;
  min-height: calc(1.5em + 1.3rem + 4px) !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
}

.ts-wrapper:hover {
  border-color: #cbd5e0 !important;
}

.ts-wrapper.focus {
  border-color: var(--theme-color) !important;
  box-shadow: 0 0 0 4px rgba(17, 110, 99, 0.15),
    0 0 20px rgba(17, 110, 99, 0.08) !important;
  outline: none !important;
  transform: translateY(-1px) !important;
  transition: all 0.2s ease !important;
}

/* Remove all styling from inner ts-control - it should be invisible */
.ts-control {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  min-height: auto !important;
  height: auto !important;
}

.ts-control:hover {
  border: none !important;
  background: transparent !important;
}

.ts-control.focus,
.ts-wrapper.focus .ts-control {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  background: transparent !important;
}

.ts-control input {
  font-size: 1rem !important;
  color: #212529 !important;
  line-height: 1.5 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

.ts-control input::placeholder {
  color: #6c757d !important;
  opacity: 0.7 !important;
}

/* Remove the default item styling to look cleaner */
.ts-control .item {
  background: none !important;
  border: none !important;
  color: #212529 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-weight: normal !important;
}

/* Dropdown menu */
.ts-dropdown {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-top: 0.25rem;
  background: white;
  z-index: 1050;
}

.ts-dropdown .ts-dropdown-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

/* Village option styling */
.ts-dropdown .option,
.ts-dropdown .optgroup-header,
.ts-dropdown .no-results,
.ts-dropdown .create {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.ts-dropdown .option {
  transition: background-color 0.15s ease;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background-color: #f8f9fa;
}

.ts-dropdown .option.selected {
  background-color: rgba(17, 110, 99, 0.1);
  color: var(--theme-color);
  font-weight: 500;
}

/* Custom village option layout */
.village-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.village-name {
  font-weight: 500;
  color: #212529;
  font-size: 0.9375rem;
}

.village-details {
  font-size: 0.8125rem;
  color: #6c757d;
  display: flex;
  gap: 0.75rem;
}

.village-details i {
  margin-right: 0.25rem;
  color: var(--theme-color);
  font-size: 0.75rem;
}

/* No results message */
.ts-dropdown .no-results {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Loading spinner */
.ts-dropdown .loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* Clear button */
.ts-control .clear-button {
  color: #6c757d;
  cursor: pointer;
  transition: color 0.15s ease;
  font-size: 1.2rem;
  margin-left: 0.5rem;
}

.ts-control .clear-button:hover {
  color: #dc3545;
}

/* Loading state */
.ts-wrapper.loading .ts-control::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f4f6;
  border-top-color: var(--theme-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Disabled state */
.ts-control.disabled,
.ts-wrapper.disabled .ts-control {
  background-color: #e9ecef;
  opacity: 0.65;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ts-dropdown .ts-dropdown-content {
    max-height: 250px;
  }

  .village-details {
    flex-direction: column;
    gap: 0.25rem;
  }
}
