/*
 * LATRACTION — tools.css
 * Styles spécifiques aux outils gratuits /outils/
 * Importer APRÈS shared.css
 * =========================================================
 */

/* ─── HERO OUTIL ─────────────────────────────────────────── */
.tool-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tool-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none' stroke='rgba(255,255,255,.05)' stroke-width='1'/%3E%3C/svg%3E");
  opacity: .4;
}

.tool-hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 100px;
  padding: .35rem 1rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.tool-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: .75rem;
  line-height: 1.2;
}

.tool-hero p {
  font-size: 1.1rem;
  opacity: .88;
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

/* ─── ZONE OUTIL ─────────────────────────────────────────── */
.tool-section {
  padding: 56px 0;
  background: var(--bg-light);
}

.tool-wrapper {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.tool-wrapper-inner { padding: 2.5rem; }

/* ─── STEPS / QUESTIONNAIRE ──────────────────────────────── */
.tool-step {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tool-step:last-child { border-bottom: none; margin-bottom: 0; }

.tool-step-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: .5rem;
}

.tool-step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

/* Radios & Checkboxes stylés */
.radio-group,
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.radio-option,
.check-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
  background: var(--bg-white);
  user-select: none;
  min-height: 44px;
}

.radio-option:hover,
.check-option:hover {
  border-color: var(--primary);
  background: rgba(37,99,235,.04);
}

.radio-option input,
.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.radio-option.selected,
.check-option.selected {
  border-color: var(--primary);
  background: rgba(37,99,235,.07);
  color: var(--primary);
  font-weight: 600;
}

/* Select stylé */
.tool-select {
  width: 100%;
  padding: .75rem 2.5rem .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text-dark);
  background: var(--bg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center;
  appearance: none;
  outline: none;
  transition: border-color .2s;
  min-height: 44px;
}

.tool-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Input number */
.tool-number {
  width: 100%;
  max-width: 200px;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  outline: none;
  transition: border-color .2s;
  min-height: 44px;
}

.tool-number:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Bouton calculer */
.btn-calculate {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all .25s;
  margin-top: 2rem;
  min-height: 54px;
}

.btn-calculate:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ─── RÉSULTAT ────────────────────────────────────────────── */
.tool-result {
  display: none;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.tool-result.visible { display: block; }

.result-score-bar {
  background: var(--bg-light);
  border-radius: var(--radius-xl);
  height: 12px;
  margin: .75rem 0 .4rem;
  overflow: hidden;
}

.result-score-fill {
  height: 100%;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

.result-score-fill.score-low    { background: linear-gradient(90deg, #ef4444, #f97316); }
.result-score-fill.score-medium { background: linear-gradient(90deg, #f59e0b, #10b981); }
.result-score-fill.score-high   { background: linear-gradient(90deg, #10b981, #2563eb); }

.result-card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-left: 4px solid var(--primary);
  margin-bottom: 1.5rem;
}

.result-card.result-good   { border-left-color: #10b981; background: #f0fdf4; }
.result-card.result-medium { border-left-color: #f59e0b; background: #fffbeb; }
.result-card.result-low    { border-left-color: #ef4444; background: #fef2f2; }

.result-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .75rem;
}

.result-card p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: .75rem;
}

.result-card ul {
  padding-left: 1.25rem;
  color: var(--text-light);
  line-height: 1.8;
}

.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-stat {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
}

.result-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.result-stat-label {
  font-size: .78rem;
  color: var(--text-light);
  margin-top: .3rem;
}

/* CTA résultat */
.result-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  text-align: center;
  color: #fff;
  margin-top: 1.5rem;
}

.result-cta h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.result-cta p {
  font-size: .9rem;
  opacity: .85;
  margin-bottom: 1rem;
}

.result-cta .btn {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

.result-cta .btn:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

/* Disclaimer */
.result-disclaimer {
  margin-top: 1.25rem;
  padding: .75rem 1rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  font-size: .78rem;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  border: 1px solid var(--border);
}

/* ─── SLIDER ─────────────────────────────────────────────── */
.tool-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.tool-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dark);
}

.tool-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  appearance: none;
  background: var(--border);
  outline: none;
  accent-color: var(--primary);
  cursor: pointer;
  min-height: 44px;
  padding: 19px 0;
}

/* ─── DROP ZONE (Compresseur image) ──────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg-light);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(37,99,235,.04);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-icon { font-size: 2.5rem; margin-bottom: .75rem; }

.drop-zone-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: .35rem;
}

.drop-zone-sub {
  font-size: .82rem;
  color: var(--text-light);
}

/* Preview avant/après */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.preview-pane {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-pane-label {
  padding: .5rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-light);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.preview-pane img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fff;
}

.preview-pane-meta {
  padding: .6rem .75rem;
  font-size: .82rem;
  color: var(--text-light);
}

.preview-pane-meta strong { color: var(--text-dark); }

/* ─── GÉNÉRATEUR ML ──────────────────────────────────────── */
.ml-output {
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text-dark);
  white-space: pre-wrap;
  font-family: 'Georgia', serif;
  max-height: 540px;
  overflow-y: auto;
}

.ml-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

/* ─── CTA RETOUR CONTEXTUALISÉ ───────────────────────────── */
.tool-back-cta {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.tool-back-cta h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .5rem;
}

.tool-back-cta p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

/* ─── RESPONSIVE OUTILS ──────────────────────────────────── */
@media (max-width: 640px) {
  .tool-wrapper-inner { padding: 1.5rem; }
  .preview-grid { grid-template-columns: 1fr; }
  .radio-group,
  .check-group { flex-direction: column; }
  .radio-option,
  .check-option { width: 100%; }
  .result-stat-grid { grid-template-columns: 1fr 1fr; }
  .ml-actions { flex-direction: column; }
  .ml-actions .btn { width: 100%; }
}
