/* ============================================================================
   CHEWCAST — Composants UI réutilisables
   ============================================================================ */

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-card);
}
.card-lien {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.card-lien:hover {
  border-color: var(--accent);
}
.card-lien:active {
  transform: scale(0.98);
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap-min);
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { background: var(--surface); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-principal {
  background: var(--accent);
  border-color: var(--accent);
  color: #080d18;
  font-weight: 700;
}
.btn-principal:hover { background: #e89a1a; border-color: #e89a1a; }
.btn-principal:active { background: #c07808; }

.btn-secondaire {
  background: transparent;
  border-color: var(--accent2);
  color: var(--accent2);
}
.btn-secondaire:hover { background: rgba(30, 200, 176, 0.1); }

.btn-accent-sm {
  background: var(--accent2);
  color: #080d18;
  font-weight: 600;
}
.btn-muted-sm {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-muted-sm:hover { background: var(--border); }

.btn-danger {
  background: transparent;
  border-color: var(--accent3);
  color: var(--accent3);
}
.btn-danger:hover { background: rgba(224, 85, 85, 0.1); }

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}
.btn-groupe {
  display: flex;
  gap: var(--gutter);
}
.btn-groupe > .btn { flex: 1; }

/* --- Pills / badges --- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill-accent {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 135, 10, 0.1);
}
.pill-accent2 {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(30, 200, 176, 0.1);
}
.pill-danger {
  border-color: var(--accent3);
  color: var(--accent3);
  background: rgba(224, 85, 85, 0.1);
}
.pills-groupe {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* --- Formulaires --- */
.champ {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.champ label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.champ input,
.champ select,
.champ textarea {
  min-height: var(--tap-min);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.champ input:focus,
.champ select:focus,
.champ textarea:focus {
  border-color: var(--accent);
}
.champ input::placeholder,
.champ textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
.champ textarea {
  min-height: 80px;
  resize: vertical;
}
.champ select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235e7490' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.champ-row {
  display: flex;
  gap: var(--gutter);
}
.champ-row > .champ { flex: 1; margin-bottom: 0; }

/* --- Multi-select (checkboxes stylisées) --- */
.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.multi-select label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.multi-select label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(212, 135, 10, 0.1);
  color: var(--accent);
}
.multi-select input[type="checkbox"] {
  display: none;
}

/* --- Wizard steps --- */
.wizard-barre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0;
}
.wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  border: 2px solid var(--border);
  color: var(--muted);
  background: transparent;
  transition: all 0.2s;
}
.wizard-step-actif .wizard-step-num {
  border-color: var(--accent);
  color: #080d18;
  background: var(--accent);
}
.wizard-step-fait .wizard-step-num {
  border-color: var(--accent2);
  color: #080d18;
  background: var(--accent2);
}
.wizard-step-ligne {
  width: 32px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
}
.wizard-step-fait + .wizard-step-ligne,
.wizard-step-actif + .wizard-step-ligne {
  background: var(--accent);
}

/* --- Alertes --- */
.alerte {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.alerte-info {
  background: rgba(30, 200, 176, 0.1);
  border: 1px solid var(--accent2);
  color: var(--accent2);
}
.alerte-danger {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid var(--accent3);
  color: var(--accent3);
}
.alerte-avert {
  background: rgba(212, 135, 10, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* --- Badge météo --- */
.badge-meteo {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.badge-meteo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 60px;
}
.badge-meteo-valeur {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}
.badge-meteo-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* --- Grille de données (label + valeur) --- */
.grille-donnees {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.donnee {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Séparateur --- */
.sep {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* --- Loading spinner --- */
.chargement {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.chargement::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 10px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Courbe marée (styles SVG) --- */
.courbe-maree {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.courbe-maree svg {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Score conditions --- */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.score-excellent { background: rgba(30, 200, 176, 0.15); color: var(--accent2); }
.score-bon       { background: rgba(30, 200, 176, 0.08); color: var(--accent2); }
.score-moyen     { background: rgba(212, 135, 10, 0.1);  color: var(--accent); }
.score-mauvais   { background: rgba(224, 85, 85, 0.1);   color: var(--accent3); }

/* --- Vide / placeholder --- */
.etat-vide {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}
.etat-vide-icone {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}
