/* Charte Les Echos � G�ocodeur Flourish */

:root {
  --echos-rouge: #B00005;
  --echos-rouge-hover: #8F0004;
  --echos-noir: #1A1515;
  --echos-blanc: #FFFFFF;
  --echos-gris-clair: #F5F4F4;
  --echos-gris-bordure: #D9D6D6;
  --echos-gris-texte: #4A4545;
  --echos-vert-fond: #EDF7ED;
  --echos-vert-texte: #1B5E20;
  --echos-orange-fond: #FFF8E6;
  --echos-orange-texte: #7A4F01;
  --echos-rouge-fond: #FDEDED;
  --font-titre: 'Merriweather', Georgia, serif;
  --font-calibre: 'Calibre', 'Source Sans 3', system-ui, sans-serif;
  --font-corps: var(--font-calibre);
}

@font-face {
  font-family: 'Calibre';
  src: url('/static/assets/fonts/Calibre-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Calibre';
  src: url('/static/assets/fonts/Calibre-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-corps);
  font-size: 17px;
  line-height: 1.5;
  color: var(--echos-noir);
  background-image: url('/static/assets/texture.png');
  background-repeat: repeat;
  background-size: 1250px auto;
  margin: 0;
}

.font-titre {
  font-family: var(--font-titre);
}

/* Parcours en 3 �tapes */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--echos-gris-clair);
  border-radius: 8px;
  margin-bottom: 1.75rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
  color: var(--echos-gris-texte);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--echos-gris-bordure);
  color: var(--echos-noir);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.step-active .step-num {
  background: var(--echos-rouge);
  color: var(--echos-blanc);
}

.step-done .step-num {
  background: var(--echos-noir);
  color: var(--echos-blanc);
}

/* Sections */
.section-card {
  background: var(--echos-blanc);
  border: 1px solid var(--echos-gris-bordure);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-titre);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--echos-noir);
}

.section-help {
  font-size: 16px;
  color: var(--echos-gris-texte);
  margin: 0 0 1rem;
}

/* Champs */
textarea {
  width: 100%;
  min-height: 180px;
  padding: 1rem;
  font-family: var(--font-calibre);
  font-size: 17px;
  line-height: 1.6;
  border: 2px solid var(--echos-gris-bordure);
  border-radius: 8px;
  resize: vertical;
  color: var(--echos-noir);
  background: var(--echos-blanc);
}

textarea:focus {
  outline: none;
  border-color: var(--echos-rouge);
  box-shadow: 0 0 0 3px rgba(176, 0, 5, 0.12);
}

textarea::placeholder {
  color: #8A8484;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-calibre);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, color 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--echos-rouge);
  color: var(--echos-blanc);
  border-color: var(--echos-rouge);
}

.btn-primary:hover:not(:disabled) {
  background: var(--echos-rouge-hover);
  border-color: var(--echos-rouge-hover);
}

.btn-secondary {
  background: var(--echos-blanc);
  color: var(--echos-noir);
  border-color: var(--echos-noir);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--echos-gris-clair);
}

.btn-dark {
  background: var(--echos-noir);
  color: var(--echos-blanc);
  border-color: var(--echos-noir);
}

.btn-dark:hover:not(:disabled) {
  background: #2f2828;
  border-color: #2f2828;
}

.btn-link {
  width: auto;
  min-height: auto;
  padding: 0.25rem 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--echos-rouge);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: var(--echos-rouge-hover);
}

/* Barre de progression */
.progress-wrap {
  margin-top: 1rem;
}

.progress-bar {
  height: 8px;
  background: var(--echos-gris-bordure);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--echos-rouge);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 16px;
  color: var(--echos-gris-texte);
}

/* Messages */
.message {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 16px;
  margin-top: 1rem;
}

.message-info {
  background: var(--echos-gris-clair);
  border-left: 4px solid var(--echos-noir);
}

.message-warning {
  background: var(--echos-orange-fond);
  border-left: 4px solid var(--echos-orange-texte);
  color: var(--echos-orange-texte);
}

.message-error {
  background: var(--echos-rouge-fond);
  border-left: 4px solid var(--echos-rouge);
  color: var(--echos-noir);
}

.message-success {
  background: var(--echos-vert-fond);
  border-left: 4px solid var(--echos-vert-texte);
  color: var(--echos-vert-texte);
}

/* Tableau simplifi� */
.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--echos-gris-bordure);
  border-radius: 8px;
  background: var(--echos-blanc);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-calibre);
  font-size: 14px;
}

.results-table th {
  background: var(--echos-blanc);
  font-family: var(--font-titre);
  text-align: left;
  padding: 0.35rem 0.5rem;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid var(--echos-gris-bordure);
  white-space: nowrap;
}

.results-table td {
  padding: 0.3rem 0.5rem;
  border-top: 1px solid var(--echos-gris-bordure);
  vertical-align: middle;
  line-height: 1.25;
}

.results-table .cell-status {
  width: 1%;
  white-space: nowrap;
}

.results-table .cell-query {
  max-width: 8rem;
  word-break: break-word;
}

.row-found { background: transparent; }
.row-ambiguous { background: transparent; }
.row-not-found { background: transparent; }

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  border: none;
  min-height: 1.35rem;
}

.status-ok { background: var(--echos-vert-fond); color: var(--echos-vert-texte); }
.status-check { background: var(--echos-orange-fond); color: var(--echos-orange-texte); }
.status-ko { background: var(--echos-rouge-fond); color: #B71C1C; }

.precision-label {
  font-size: 12px;
  color: var(--echos-gris-texte);
}

select.homonym-select {
  width: 100%;
  max-width: 100%;
  margin-top: 0.2rem;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-calibre);
  font-size: 12px;
  border: 1px solid var(--echos-gris-bordure);
  border-radius: 4px;
  background: var(--echos-blanc);
}

select.homonym-select:focus {
  outline: none;
  border-color: var(--echos-rouge);
}

/* D�tails techniques repliables */
details.tech-details {
  margin-top: 1rem;
  font-size: 15px;
}

details.tech-details summary {
  cursor: pointer;
  color: var(--echos-gris-texte);
  font-weight: 600;
  padding: 0.5rem 0;
}

details.tech-details summary:hover {
  color: var(--echos-noir);
}

/* Carte � compacte, ne domine pas l'�cran */
.map-panel {
  display: flex;
  flex-direction: column;
  background: var(--echos-gris-clair);
  border-left: 1px solid var(--echos-gris-bordure);
  align-self: start;
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.map-panel-compact {
  width: 100%;
}

.map-header {
  padding: 1rem 1.25rem;
  background: var(--echos-blanc);
  border-bottom: 1px solid var(--echos-gris-bordure);
}

.map-header-compact {
  padding: 0.65rem 1rem;
}

.map-header-compact h2 {
  font-size: 0.95rem;
  margin: 0;
}

.map-header-compact p {
  font-size: 13px;
  margin: 0.15rem 0 0;
}

.map-header h2 {
  font-family: var(--font-titre);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.map-header p {
  margin: 0;
  font-size: 15px;
  color: var(--echos-gris-texte);
}

#map {
  height: 240px;
  min-height: 200px;
  flex: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 1rem 1.5rem;
  background: var(--echos-noir);
  color: var(--echos-blanc);
  font-size: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 9999;
  text-align: center;
  line-height: 1.4;
}

.toast.visible {
  opacity: 1;
}

/* Marqueurs carte */
.marker-echos {
  background: var(--echos-rouge);
  border: 3px solid var(--echos-blanc);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Flourish instructions */
.flourish-box {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 1023px) {
  .map-panel {
    border-left: none;
    border-top: 1px solid var(--echos-gris-bordure);
    position: relative;
    max-height: none;
  }

  #map {
    height: 220px;
  }
}

textarea.is-example {
  color: #8A8484;
}

textarea:not(.is-example) {
  color: var(--echos-noir);
}

.main-panel .intro {
  font-size: 15px;
  color: var(--echos-gris-texte);
  margin: 0 0 1rem;
}

.input-block .btn-primary {
  margin-top: 0.75rem;
}

.results-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--echos-gris-bordure);
}

.results-block h2 {
  font-family: var(--font-titre);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.copy-hint {
  margin: 0.75rem 0 0;
  font-size: 15px;
  color: var(--echos-gris-texte);
}

.header-compact {
  margin-bottom: 1.25rem;
}

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

.header-compact p {
  font-size: 15px;
  margin-top: 0.25rem;
}
