/* ========== FORM POLISH ========== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #101820;
  font-size: 0.95rem;
}

.form-group .required::after {
  content: ' *';
  color: var(--orange);
}

.form-group input,
.form-group textarea,
.form-group select {
  font-family: 'Poppins', system-ui, sans-serif;
  border: 1px solid var(--gray-200);
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  min-height: 44px;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11, 93, 59, 0.1);
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
  border-color: #dc2626;
}

.form-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-success {
  color: var(--green);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== BUTTON SYSTEM ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: var(--orange);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #D95D00;
  box-shadow: 0 10px 25px rgba(242, 104, 4, 0.3);
  transform: translateY(-2px);
}

/* Secondary Button */
.btn-secondary {
  background: var(--green);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--green-dark);
  box-shadow: 0 10px 25px rgba(11, 93, 59, 0.3);
  transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(11, 93, 59, 0.08);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--green);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(11, 93, 59, 0.08);
}

/* Danger Button */
.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

/* Loading State */
.btn.loading {
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== BADGE SYSTEM ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: rgba(242, 104, 4, 0.15);
  color: var(--orange);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-error {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.badge-warning {
  background: rgba(242, 104, 4, 0.15);
  color: #F26804;
}

.badge-neutral {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ========== ALERTS ========== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.95rem;
}

.alert-success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.alert-error {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #F26804;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border-color: var(--green);
  color: #164e63;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* ========== SEARCH POLISH ========== */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--green);
  background: white;
  box-shadow: 0 0 0 3px rgba(11, 93, 59, 0.1);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
  font-family: 'Poppins', system-ui, sans-serif;
}

.search-box input::placeholder {
  color: var(--gray-600);
}

.search-box svg {
  color: var(--green);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--gray-50);
  border-radius: 0.75rem;
  border: 1px dashed var(--gray-200);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #101820;
  margin-bottom: 0.5rem;
}

.empty-state-description {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  max-width: 300px;
}

/* ========== LOADING STATES ========== */
@keyframes skeleton-loading {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 1000px 100%;
  animation: skeleton-loading 2s infinite;
  border-radius: 0.375rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0.375rem;
}

.skeleton-card {
  height: 300px;
  border-radius: 0.75rem;
}

/* ========== SPACING UTILITIES ========== */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* ========== RESPONSIVE GRID ========== */
.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2-cols { grid-template-columns: repeat(2, 1fr); }
}

.grid-3-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-3-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3-cols { grid-template-columns: repeat(3, 1fr); }
}

.grid-4-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-4-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-4-cols { grid-template-columns: repeat(4, 1fr); }
}

/* ========== ACCESSIBILITY ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  .btn {
    border: 2px solid currentColor;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    border: 2px solid var(--gray-700);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
