/* APPLICATION FORMS UI IMPROVEMENTS */
/* Professional registration form styling for all devices */
/* Inspired by Ticketmaster, Airbnb, and other modern registration flows */

/* ============================================
   1. TEXT READABILITY & CONTRAST
   ============================================ */

/* Form Labels - Make them prominent */
.form-label {
  font-weight: 600 !important;
  color: #1a1a1a !important;
  font-size: 0.9375rem !important;
  margin-bottom: 0.5rem !important;
  display: block;
}

@media (max-width: 767.98px) {
  .form-label {
    font-size: 0.875rem !important;
  }
}

/* Help Text - Readable, not decorative */
.form-text,
small.text-muted,
.text-muted.small {
  color: #666666 !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  margin-top: 0.375rem !important;
  display: block;
}

@media (max-width: 767.98px) {
  .form-text,
  small.text-muted,
  .text-muted.small {
    font-size: 0.8125rem !important;
    color: #555555 !important;
  }
}

/* Checkbox/Radio Labels - Critical readability */
.form-check-label {
  font-size: 0.9375rem !important;
  line-height: 1.6 !important;
  color: #1a1a1a !important;
  font-weight: 400 !important;
}

@media (max-width: 767.98px) {
  .form-check-label {
    font-size: 0.875rem !important;
    line-height: 1.7 !important;
  }
}

/* Consent text - MUST be readable */
.consent-list li,
.form-check-label small {
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
  color: #333333 !important;
}

@media (max-width: 767.98px) {
  .consent-list li,
  .form-check-label small {
    font-size: 0.8125rem !important;
  }
}

/* ============================================
   2. FORM FIELDS & INPUTS
   ============================================ */

/* Form Controls - Professional sizing */
.form-control,
.form-select {
  min-height: 48px !important;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  border-radius: 6px !important;
  border: 2px solid #dee2e6 !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  font-weight: 400;
  color: #212529;
}

.form-control:focus,
.form-select:focus {
  border-color: #005373 !important;
  box-shadow: 0 0 0 3px rgba(0, 83, 115, 0.1) !important;
  outline: none !important;
}

.form-control::placeholder {
  color: #adb5bd;
  opacity: 1;
}

/* Mobile optimization - prevent zoom on iOS */
@media (max-width: 767.98px) {
  .form-control,
  .form-select {
    min-height: 50px !important;
    font-size: 1rem !important; /* 16px prevents iOS zoom */
    padding: 0.875rem 1rem !important;
  }
}

/* Disabled state */
.form-control:disabled,
.form-select:disabled {
  background-color: #f5f5f5 !important;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Error state */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #ef4444 !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.invalid-feedback {
  color: #ef4444 !important;
  font-size: 0.875rem !important;
  margin-top: 0.375rem !important;
  font-weight: 500;
}

/* ============================================
   3. CHECKBOXES & RADIOS
   ============================================ */

.form-check {
  padding-left: 1.75rem !important; /* Bootstrap default for checkbox positioning */
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  margin-bottom: 0.75rem !important;
  position: relative;
}

.form-check-input {
  width: 1.25rem !important;
  height: 1.25rem !important;
  position: absolute !important;
  left: 0 !important;
  margin-left: 0 !important; /* Override Tabler's -32px margin */
  margin-top: 0.15rem !important;
  border: 2px solid #dee2e6 !important;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #005373 !important;
  border-color: #005373 !important;
}

.form-check-input:focus {
  border-color: #005373 !important;
  box-shadow: 0 0 0 3px rgba(0, 83, 115, 0.1) !important;
}

@media (max-width: 767.98px) {
  .form-check {
    padding-left: 2rem !important; /* More space on mobile for larger checkbox */
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1rem !important;
  }
  
  .form-check-input {
    width: 1.375rem !important;
    height: 1.375rem !important;
  }
}

/* ============================================
   4. BUTTONS
   ============================================ */

/* Primary Action Buttons */
.btn-primary,
.btn-warning {
  font-weight: 600 !important;
  padding: 0.875rem 2rem !important;
  font-size: 1rem !important;
  border-radius: 6px !important;
  min-height: 48px !important;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary:hover,
.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

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

@media (max-width: 767.98px) {
  .btn-primary,
  .btn-warning {
    width: 100% !important;
    padding: 1rem !important;
    min-height: 52px !important;
    font-size: 1.0625rem !important;
  }
}

/* Secondary Buttons */
.btn-outline-primary,
.btn-outline-secondary,
.btn-secondary {
  font-weight: 500 !important;
  min-height: 44px !important;
  border-width: 2px !important;
}

@media (max-width: 767.98px) {
  .btn-outline-primary,
  .btn-outline-secondary,
  .btn-secondary {
    width: 100% !important;
    min-height: 48px !important;
  }
}

/* Button Groups */
.btn-list,
.d-flex.gap-3 {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .btn-list,
  .d-flex.gap-3 {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Link buttons */
.btn-link {
  font-weight: 500;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ============================================
   5. PROGRESS INDICATORS
   ============================================ */

.progress {
  height: 8px !important;
  border-radius: 4px !important;
  background-color: #e9ecef !important;
  margin-bottom: 1.5rem !important;
  overflow: visible;
}

.progress-bar {
  background-color: #005373 !important;
  transition: width 0.6s ease;
  border-radius: 4px;
}

/* Progress Text */
.progress-text,
.d-flex.justify-content-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
}

@media (max-width: 767.98px) {
  .progress {
    height: 6px !important;
    margin-bottom: 1rem !important;
  }
  
  .progress-text,
  .d-flex.justify-content-between {
    font-size: 0.8125rem;
  }
}

/* ============================================
   6. ALERTS & INFO BOXES
   ============================================ */

.alert {
  padding: 1rem 1.25rem !important;
  border-radius: 8px !important;
  border-left: 4px solid transparent !important;
  margin-bottom: 1.5rem !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
}

.alert-info {
  background-color: #e7f3f8 !important;
  border-left-color: #0088bf !important;
  color: #1a1a1a !important;
}

.alert-warning {
  background-color: #fff8e1 !important;
  border-left-color: #f59e0b !important;
  color: #1a1a1a !important;
}

.alert-success {
  background-color: #d1fae5 !important;
  border-left-color: #14b8a6 !important;
  color: #1a1a1a !important;
}

.alert-danger {
  background-color: #fee2e2 !important;
  border-left-color: #ef4444 !important;
  color: #1a1a1a !important;
}

.alert-heading {
  font-weight: 600 !important;
  font-size: 1rem !important;
  margin-bottom: 0.5rem !important;
  color: #1a1a1a !important;
}

.alert p,
.alert div {
  color: #1a1a1a !important;
}

@media (max-width: 767.98px) {
  .alert {
    padding: 0.875rem 1rem !important;
    margin-bottom: 1.25rem !important;
  }
  
  .alert-heading {
    font-size: 0.9375rem !important;
  }
  
  .alert p,
  .alert div {
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
  }
}

/* ============================================
   7. PAGE HEADERS & TITLES
   ============================================ */

.page-title,
h1.page-title {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.3 !important;
}

@media (min-width: 768px) {
  .page-title,
  h1.page-title {
    font-size: 2rem !important;
  }
}

/* Subtitles - SCOPED to application forms only */
.application-form .lead,
.application-form p.lead {
  font-size: 1rem !important;
  line-height: 1.6 !important;
  color: #666666 !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 767.98px) {
  .application-form .lead,
  .application-form p.lead {
    font-size: 0.9375rem !important;
  }
}

/* Section Headings */
h2, h3 {
  font-weight: 600 !important;
  color: #1a1a1a !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1rem !important;
}

h2 {
  font-size: 1.5rem !important;
}

h3 {
  font-size: 1.25rem !important;
}

@media (max-width: 767.98px) {
  h2 {
    font-size: 1.375rem !important;
  }
  
  h3 {
    font-size: 1.125rem !important;
  }
}

h4, h5 {
  font-weight: 600 !important;
  color: #1a1a1a !important;
}

h4 {
  font-size: 1.125rem !important;
}

h5 {
  font-size: 1rem !important;
}

/* ============================================
   8. CARDS & CONTAINERS
   ============================================ */

.card {
  border-radius: 8px !important;
  border: 1px solid #dee2e6 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  margin-bottom: 1.5rem !important;
}

.card-body {
  padding: 1.5rem !important;
}

@media (max-width: 767.98px) {
  .card-body {
    padding: 1.25rem !important;
  }
}

.card-header {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6 !important;
  padding: 1rem 1.5rem !important;
  font-weight: 600;
}

/* ============================================
   9. INPUT GROUPS ($ prefix, etc.)
   ============================================ */

.input-group-text {
  background-color: #f8f9fa !important;
  border: 2px solid #dee2e6 !important;
  border-right: 0 !important;
  font-weight: 600 !important;
  color: #495057 !important;
  padding: 0.75rem 1rem !important;
  border-radius: 6px 0 0 6px !important;
}

.input-group > .form-control {
  border-left: 0 !important;
  border-radius: 0 6px 6px 0 !important;
}

.input-group:focus-within .input-group-text {
  border-color: #005373 !important;
  background-color: #e7f3f8 !important;
}

.input-group:focus-within .form-control {
  border-color: #005373 !important;
}

/* ============================================
   10. FORM FIELD SPACING
   ============================================ */

.mb-3 {
  margin-bottom: 1.5rem !important;
}

@media (max-width: 767.98px) {
  .mb-3 {
    margin-bottom: 1.25rem !important;
  }
}

.row.mb-3 {
  margin-bottom: 1.5rem !important;
}

/* Form sections */
.form-section {
  margin-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .form-section {
    margin-bottom: 1.5rem;
  }
}

/* ============================================
   11. CONTAINER WIDTHS
   ============================================ */

/* Optimal form width */
.container.form-container,
.container-xl.form-container {
  max-width: 720px !important;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   12. FOCUS STATES & ACCESSIBILITY
   ============================================ */

/* Visible focus for keyboard navigation */
a:focus,
button:focus,
.btn:focus {
  outline: 2px solid #005373 !important;
  outline-offset: 2px !important;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #005373;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   13. MOBILE-SPECIFIC OPTIMIZATIONS
   ============================================ */

@media (max-width: 767.98px) {
  /* Reduce overall padding on mobile */
  .container,
  .container-xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Reduce card padding on mobile */
  .card-body {
    padding: 1rem !important;
  }
  
  /* Stack form rows properly */
  .row.g-3 > .col-md-6,
  .row.g-3 > .col-md-4,
  .row > .col-lg-6 {
    margin-bottom: 0;
  }
  
  .row.mb-4 {
    margin-bottom: 1.25rem !important;
  }
  
  /* Full-width buttons in button groups */
  .btn-list > *,
  .d-flex.gap-3 > .btn,
  .d-flex.justify-content-between > .btn {
    width: 100% !important;
    margin-bottom: 0.75rem;
  }
  
  .d-flex.justify-content-between {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  /* Ensure form footer buttons stack */
  .form-footer .row {
    flex-direction: column-reverse;
  }
  
  .form-footer .col,
  .form-footer .col-auto {
    width: 100%;
    margin-bottom: 0.75rem;
  }
  
  .form-footer .btn {
    width: 100% !important;
  }
  
  /* Tighter heading spacing on mobile */
  h2, h3 {
    margin-top: 1rem !important;
  }
  
  /* Reduce alert padding */
  .alert.mb-4 {
    margin-bottom: 1rem !important;
  }
}
