/* ================================================
   Application Form Styles - Reusable Multi-step Forms
   Reuses existing form styles from components.css
   ================================================ */

/* Progress Indicator - Reuse existing card styles */
.form-progress {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-card);
}

/* Desktop: Make progress tracker sticky like mobile */
@media (min-width: 768px) {
  .form-progress {
    position: sticky;
    top: 4.5rem;
    z-index: 10;
    background: var(--c-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--c-grad-a), var(--c-grad-b));
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.progress-step.active {
  opacity: 1;
}

.progress-step.completed .step-number {
  background: var(--c-success);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: linear-gradient(90deg, var(--c-grad-a), var(--c-grad-b));
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: var(--c-text-med);
  text-align: center;
}

.progress-step.active .step-label {
  color: var(--c-text-hi);
}

.progress-bar {
  height: 4px;
  background: var(--c-border-glass);
  border-radius: 2px;
  overflow: hidden;
}

/* Form Steps */
.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* File Upload - Reuse existing card styles */
.file-upload {
  border: 2px dashed var(--c-border-glass);
  border-radius: var(--radius-card);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
  background: rgba(255, 255, 255, .02);
}

.file-upload:hover {
  border-color: var(--c-grad-a);
  background: rgba(35, 107, 255, 0.05);
}

.file-upload.has-file {
  border-color: var(--c-success);
  background: rgba(16, 185, 129, 0.1);
}

.file-upload input[type="file"] {
  display: none;
}

.file-preview {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.file-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
}

.file-preview-item img {
  width: 100%;
  height: auto;
  display: block;
}

.file-preview-item .remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
}

/* Mobile optimizations - Reuse responsive patterns */
@media (max-width: 767px) {
  .form-progress {
    position: sticky;
    top: 4.5rem;
    z-index: 10;
    background: var(--c-bg);
    backdrop-filter: blur(10px);
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .progress-steps {
    font-size: 0.75rem;
  }
  
  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  .step-label {
    font-size: 0.625rem;
  }
  
  .form-actions {
    /* position: sticky; */
    /* bottom: 0; */
    backdrop-filter: blur(10px);
    padding: 1rem 0.75rem;
    margin-bottom: 0;
    /* z-index: 10; */
  }
  
  .file-upload {
    padding: 1.5rem 1rem;
  }
}

/* ================================================
   Platform Checkboxes Styling
   ================================================ */

.field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--c-text-med);
}

.platform-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.platform-checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--c-border-glass);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 400;
}

.platform-checkbox:hover {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .15);
  transform: translateY(-1px);
}

.platform-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  position: relative;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid var(--c-text-low);
  border-radius: 4px;
  background: transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-checkbox input[type="checkbox"]:checked + .checkbox-custom {
  background: linear-gradient(90deg, var(--c-grad-a), var(--c-grad-b));
  border-color: var(--c-grad-a);
}

.platform-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.checkbox-label {
  color: var(--c-text-hi);
  font-size: 0.875rem;
  user-select: none;
}

.platform-checkbox input[type="checkbox"]:checked ~ .checkbox-label {
  color: var(--c-text-hi);
  font-weight: 500;
}

/* Desktop: One row (4 columns) */
@media (min-width: 768px) {
  .platform-checkboxes {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
  }
  
  .platform-checkbox {
    padding: 0.625rem 0.75rem;
    justify-content: center;
  }
  
  .checkbox-custom {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
  }
  
  .platform-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    font-size: 11px;
  }
  
  .checkbox-label {
    font-size: 0.8125rem;
  }
}

/* Mobile: 2x2 grid */
@media (max-width: 767px) {
  .platform-checkboxes {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }
  
  .platform-checkbox {
    padding: 0.875rem 1rem;
  }
  
  .checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }
  
  .platform-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    font-size: 14px;
  }
  
  .checkbox-label {
    font-size: 0.875rem;
  }
}

/* ================================================
   Reusable Combobox Component (Searchable Dropdown)
   Used for PEP Store, Vehicle Type, and other selects
   ================================================ */

.combobox {
  position: relative;
  width: 100%;
}

.combobox-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--c-border-glass);
  border-radius: var(--radius-card);
  color: var(--c-text-hi);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.combobox-input:focus {
  outline: none;
  border-color: var(--c-grad-a);
  background: rgba(255, 255, 255, .08);
}

.combobox-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--c-text-med);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.combobox.active .combobox-toggle {
  transform: translateY(-50%) rotate(180deg);
  color: var(--c-grad-a);
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: var(--c-bg) !important;
  background-color: #090A16 !important;
  border: 1px solid var(--c-border-glass);
  border-radius: var(--radius-card);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.combobox.active .combobox-dropdown {
  display: block;
}

/* Optional: Search filter inside dropdown */
.combobox-search {
  padding: 0.75rem;
  border-bottom: 1px solid var(--c-border-glass);
  position: sticky;
  top: 0;
  background: var(--c-bg);
  z-index: 1;
}

.combobox-filter {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--c-border-glass);
  border-radius: var(--radius-sm);
  color: var(--c-text-hi);
  font-size: 0.875rem;
}

.combobox-filter:focus {
  outline: none;
  border-color: var(--c-grad-a);
}

.combobox-options {
  padding: 0.5rem 0;
  max-height: 320px;
  overflow-y: auto;
}

/* Optional: Grouped options */
.combobox-group {
  margin-bottom: 0.5rem;
}

.combobox-group-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-med);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, .02);
}

.combobox-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: #ffffff !important;
  font-size: 0.9375rem;
  transition: background 0.2s ease;
  display: none;
  background: transparent;
}

.combobox-option.visible {
  display: block;
}

.combobox-option:hover {
  background: rgba(35, 107, 255, 0.1);
}

.combobox-option.selected {
  background: rgba(35, 107, 255, 0.15);
  color: var(--c-grad-a);
}

/* Mobile responsive */
@media (max-width: 767px) {
  .combobox-dropdown {
    max-height: 300px;
  }
  
  .combobox-options {
    max-height: 220px;
  }
  
  .combobox-option {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
}

