/* ==================================================================
   BLUESTIFT - FORMS SYSTEM v5.0
   Modern form inputs with glassmorphism
   Accessible and user-friendly
   ================================================================== */

/* FORM GROUP */
.form-group {
  margin-bottom: 20px;
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: white; /* BLANC */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* GLASS INPUT - BLANC */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea,
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: white; /* BLANC */
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus,
.form-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* TEXTAREA */
textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* SELECT */
select,
select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

select option {
  background: #1a1a1a;
  color: white;
}

/* CHECKBOX & RADIO */
.form-checkbox,
.form-radio {
  width: 20px;
  height: 20px;
  margin-right: var(--space-2);
  cursor: pointer;
}

.form-check-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--color-text);
}

/* INPUT STATES */
.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input.error {
  border-color: var(--color-error);
}

.form-input.success {
  border-color: var(--color-success);
}

/* FORM FEEDBACK */
.form-error {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.form-success {
  color: var(--color-success);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.form-hint {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

/* INPUT ICON */
.form-input-icon {
  position: relative;
}

.form-input-icon input {
  padding-left: var(--space-10);
}

.form-input-icon i {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
}

/* SEARCH INPUT */
.form-search {
  position: relative;
}

.form-search input {
  padding-left: var(--space-10);
  border-radius: var(--radius-full);
}

.form-search i {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

/* STAR RATING SYSTEM */
.star-rating {
  display: flex;
  gap: 8px;
  font-size: 2.5rem;
  margin: 10px 0;
  justify-content: center;
}

.star {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3); /* Étoiles blanches transparentes par défaut */
  transition: all 0.2s ease;
  user-select: none;
}

.star:hover {
  color: #fbbf24; /* Jaune au hover */
  transform: scale(1.15);
}

.star.active {
  color: #fbbf24; /* Jaune pour les étoiles sélectionnées */
}

/* Effet hover: toutes les étoiles avant celle survolée */
.star-rating:hover .star {
  color: rgba(255, 255, 255, 0.3);
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
  color: rgba(255, 255, 255, 0.3);
}

.star-rating .star:hover,
.star-rating:has(.star:hover) .star:has(~ .star:hover),
.star-rating:has(.star:nth-child(5):hover) .star:nth-child(-n+5),
.star-rating:has(.star:nth-child(4):hover) .star:nth-child(-n+4),
.star-rating:has(.star:nth-child(3):hover) .star:nth-child(-n+3),
.star-rating:has(.star:nth-child(2):hover) .star:nth-child(-n+2),
.star-rating:has(.star:nth-child(1):hover) .star:nth-child(1) {
  color: #fbbf24;
}

/* DARK MODE */
body.dark-theme .form-input {
  background: var(--glass-bg-dark);
  border-color: var(--glass-border-dark);
  color: var(--color-text-dark);
}

body.dark-theme .form-input:focus {
  border-color: var(--color-primary-start);
}

body.dark-theme .star {
  color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .star:hover,
body.dark-theme .star.active {
  color: #fbbf24;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .form-input {
    font-size: var(--font-size-base);
  }

  .star-rating {
    font-size: 2rem;
    gap: 6px;
  }
}