/* ============================================
   BASE FORM STYLES - CENTRALIZED
   All form styling for the entire application
   ============================================ */

/**
 * Form Styles - Centralized Form Components
 * Modern, polished UI for Business dashboard forms (teams, locations, API settings)
 * Version: 2.0 - Complete redesign with enhanced visual design
 */

/* ============================================
   FORM CONTAINER & LAYOUT
   ============================================ */

.form-container {
  padding: 2rem 1.5rem;
  max-width: 56.25rem;
  margin: 0 auto;
}

/* ============================================
   FORM HEADER - ENHANCED
   ============================================ */

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

.form-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f1f1f;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  letter-spacing: -0.0312rem;
}

.form-header h1 i {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, #f7c000 0%, #e6b000 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f1f1f;
  font-size: 1.25rem;
  box-shadow: 0 0.25rem 1rem rgba(247, 192, 0, 0.25);
}

/* ============================================
   BACK LINK - ENHANCED
   ============================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #1f1f1f;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border: 0.125rem solid #e8e8e8;
  border-radius: 0.625rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-link:hover {
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #fff;
  transform: translateX(-0.25rem);
}

.back-link i {
  transition: transform 0.3s ease;
}

.back-link:hover i {
  transform: translateX(-0.125rem);
}

/* ============================================
   FORM CARD STRUCTURE - MODERN DESIGN
   ============================================ */

.form-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.08), 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.form-card:hover {
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.12), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.06);
}

/* ============================================
   FORM CARD HEADER - GRADIENT DESIGN
   ============================================ */

.form-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 0.125rem solid #e0e0e0;
  position: relative;
  overflow: hidden;
}

.form-card-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 12.5rem;
  height: 12.5rem;
  background: radial-gradient(
    circle,
    rgba(247, 192, 0, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.form-card-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f1f1f;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
  z-index: 1;
}

.form-card-header h2 i {
  color: #f7c000;
  font-size: 1.125rem;
}

/* ============================================
   STATUS BADGES - ENHANCED
   ============================================ */

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 3.125rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.0312rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.status-badge i {
  font-size: 0.875rem;
}

.status-badge.active {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

.status-badge.inactive {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
}

.status-badge.verified {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
}

.status-badge.not-verified {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
}

/* ============================================
   FORM CARD BODY - ENHANCED SPACING
   ============================================ */

.form-card-body {
  padding: 2rem;
  background: #fff;
}

.form-card-body .form-group {
  margin-bottom: 1.75rem;
}

.form-card-body .form-group:last-child {
  margin-bottom: 0;
}

/* Enhanced Label Styling */
.form-card-body label {
  font-weight: 700;
  color: #1f1f1f;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
  display: block;
  letter-spacing: 0.0187rem;
}

/* Enhanced Form Controls */
.form-card-body .form-control,
.form-card-body .form-select,
.form-card-body input[type="text"],
.form-card-body input[type="email"],
.form-card-body input[type="url"],
.form-card-body input[type="number"],
.form-card-body textarea,
.form-card-body select {
  border: 0.125rem solid #e8e8e8;
  border-radius: 0.625rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  width: 100%;
}

.form-card-body .form-control:focus,
.form-card-body .form-select:focus,
.form-card-body input:focus,
.form-card-body textarea:focus,
.form-card-body select:focus {
  border-color: #f7c000;
  box-shadow: 0 0 0 0.25rem rgba(247, 192, 0, 0.12);
  outline: none;
  transform: translateY(-0.0625rem);
}

/* Textarea Specific */
.form-card-body textarea {
  min-height: 7.5rem;
  resize: vertical;
}

/* Form Help Text */
.form-card-body .form-text,
.form-card-body .helptext {
  font-size: 0.8125rem;
  color: #666;
  margin-top: 0.5rem;
  display: block;
  line-height: 1.5;
}

/* ============================================
   FORM CARD FOOTER - MODERN ACTIONS
   ============================================ */

.form-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #fafafa;
  border-top: 0.125rem solid #f0f0f0;
}

/* ============================================
   FORM BUTTONS - ENHANCED DESIGN
   ============================================ */

.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: #fff;
  color: #555;
  border: 0.125rem solid #e8e8e8;
  border-radius: 0.625rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-cancel:hover {
  background: #f8f9fa;
  border-color: #d0d0d0;
  color: #1f1f1f;
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #f7c000 0%, #e6b000 100%);
  color: #1f1f1f;
  border: none;
  border-radius: 0.625rem;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0.25rem 1rem rgba(247, 192, 0, 0.3);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #e6b000 0%, #d4a000 100%);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.375rem 1.5rem rgba(247, 192, 0, 0.4);
}

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

/* ============================================
   FORM NOTES & ALERTS - MODERN GRADIENTS
   ============================================ */

.form-info-note {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 0.125rem solid #93c5fd;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(59, 130, 246, 0.1);
}

.form-info-note-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
}

.form-info-note-title i {
  font-size: 1.125rem;
}

.form-info-note-text {
  color: #1e3a8a;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.6;
}

.form-warning-note {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 0.125rem solid #fcd34d;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(245, 158, 11, 0.1);
}

.form-warning-note-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
}

.form-warning-note-title i {
  font-size: 1.125rem;
}

.form-warning-note-text {
  color: #92400e;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.6;
}

/* ============================================
   CHECKBOX & RADIO ENHANCEMENTS
   ============================================ */

.form-card-body .form-check {
  padding-left: 0;
  margin-bottom: 1rem;
}

.form-card-body .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 0.125rem solid #e8e8e8;
  margin-right: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-card-body .form-check-input:checked {
  background-color: #f7c000;
  border-color: #f7c000;
}

.form-card-body .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(247, 192, 0, 0.12);
}

.form-card-body .form-check-label {
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

/* ============================================
   SELECT2 INTEGRATION - ENHANCED
   ============================================ */

.select2-container--default .select2-selection--single {
  border: 0.125rem solid #e8e8e8;
  border-radius: 0.625rem;
  height: auto;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus
  .select2-selection--single {
  border-color: #f7c000;
  box-shadow: 0 0 0 0.25rem rgba(247, 192, 0, 0.12);
  outline: none;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 1.5;
  padding-left: 0;
  color: #1f1f1f;
  font-size: 0.9375rem;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 100%;
  right: 1rem;
}

.select2-dropdown {
  border: 0.125rem solid #f7c000;
  border-radius: 0.625rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background-color: #f7c000;
  color: #1f1f1f;
}

/* ============================================
   FIELD GROUPS & ROWS
   ============================================ */

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.field-group {
  background: #f8f9fa;
  border: 0.125rem solid #e8e8e8;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.field-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f1f1f;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-group-title i {
  color: #f7c000;
}

/* ============================================
   ERROR STATES
   ============================================ */

.form-card-body .is-invalid,
.form-card-body .error {
  border-color: #ef4444 !important;
}

.form-card-body .is-invalid:focus,
.form-card-body .error:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.12) !important;
}

.invalid-feedback,
.error-message {
  color: #dc2626;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.invalid-feedback::before,
.error-message::before {
  content: "⚠";
  font-size: 1rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

.form-card-body .loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.form-card-body .loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 0.1875rem solid #f7c000;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */

@media (max-width: 768px) {
  .form-container {
    padding: 1.5rem 1rem;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-header h1 {
    font-size: 1.5rem;
  }

  .form-header h1 i {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.125rem;
  }

  .form-card-header {
    padding: 1.25rem 1.5rem;
  }

  .form-card-body {
    padding: 1.5rem;
  }

  .form-card-footer {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
  }

  .btn-cancel,
  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE
   ============================================ */

@media (max-width: 480px) {
  .form-container {
    padding: 1rem;
  }

  .form-header h1 {
    font-size: 1.25rem;
  }

  .form-header h1 i {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }

  .form-card {
    border-radius: 0.75rem;
  }

  .form-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .form-card-body {
    padding: 1rem;
  }

  .form-card-footer {
    padding: 1rem;
  }

  .btn-cancel,
  .btn-submit {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .form-card,
  .btn-cancel,
  .btn-submit,
  .back-link,
  .form-control {
    transition: none;
  }
}

/* Focus visible for keyboard navigation */
.form-card-body .form-control:focus-visible,
.form-card-body .form-select:focus-visible,
.btn-submit:focus-visible,
.btn-cancel:focus-visible {
  outline: 0.1875rem solid #f7c000;
  outline-offset: 0.125rem;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-card {
    border: 0.125rem solid #1f1f1f;
  }

  .btn-submit {
    border: 0.125rem solid #1f1f1f;
  }
}