/*
 * Outils optométrie — styles (identité « papier », tokens de styles.css).
 * Page : convertisseur-dvo.html. Réutilisable pour les prochains outils.
 */

.tool-hero {
  max-width: var(--measure);
  margin: clamp(1.5rem, 4vw, 3rem) 0 var(--space-lg);
}

.tool-hero h1 {
  margin: 0.4rem 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #213338;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
}

.tool-lead {
  margin: 1rem 0 0;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.tool-lead strong {
  color: var(--teal);
}

/* ----- Disposition de l'outil ----- */
.dvo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: start;
}

.dvo-panel,
.dvo-output {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(36, 43, 36, 0.08);
  padding: clamp(20px, 3vw, 30px);
}

.panel-title {
  margin: 0 0 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal);
}

/* ----- Champs ----- */
.dvo-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 14px;
}

.dvo-field {
  display: grid;
  gap: 7px;
}

.dvo-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.dvo-input {
  position: relative;
  display: flex;
  align-items: center;
}

.dvo-input input {
  width: 100%;
  padding: 12px 30px 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.dvo-input .unit {
  position: absolute;
  right: 13px;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.dvo-range-field {
  margin-top: 22px;
}

.dvo-range {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dvo-range input[type="range"] {
  flex: 1;
  accent-color: var(--teal);
}

.dvo-range output {
  min-width: 64px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.field-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ----- Résultats ----- */
.dvo-rx {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.rx-cell {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(49, 111, 115, 0.06);
  text-align: center;
}

.rx-cell-wide {
  grid-column: 1 / -1;
}

.rx-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--muted);
}

.rx-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: #213338;
  font-variant-numeric: tabular-nums;
}

.dvo-meridians {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.dvo-meridians th,
.dvo-meridians td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.dvo-meridians thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.dvo-meridians tbody th {
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}

.dvo-meridians td {
  color: var(--ink);
}

.dvo-meridians tbody tr:last-child th,
.dvo-meridians tbody tr:last-child td {
  border-bottom: 0;
  font-weight: 600;
}

.dvo-flag {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.dvo-flag[data-level="warn"] {
  background: rgba(181, 121, 67, 0.12);
  color: #7c4f23;
}

.dvo-flag[data-level="ok"] {
  background: rgba(105, 124, 72, 0.12);
  color: #4c5a32;
}

/* ----- Note / méthode ----- */
.tool-note {
  max-width: var(--measure);
  margin: var(--space-lg) 0 var(--space-md);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.tool-note code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--ink);
  background: rgba(21, 39, 45, 0.05);
  padding: 1px 5px;
  border-radius: 6px;
}

.tool-disclaimer {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.dvo-reco {
  margin: 10px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(49, 111, 115, 0.07);
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 500;
}

.crumb {
  color: inherit;
  text-decoration: none;
}
.crumb:hover {
  color: var(--teal);
}

/* ----- Hub : grille d'outils ----- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
  gap: clamp(14px, 2vw, 22px);
  margin-bottom: var(--space-section);
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(20px, 2.6vw, 28px);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(36, 43, 36, 0.08);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

a.tool-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--teal) 40%, white);
  box-shadow: 0 26px 64px rgba(36, 43, 36, 0.13);
}

.tool-card h2 {
  margin: 4px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #213338;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.tool-card-tag {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(105, 124, 72, 0.14);
  color: #4c5a32;
}

.tool-card-cta {
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--teal);
}

.tool-card-soon {
  opacity: 0.72;
}
.tool-card-soon .tool-card-tag {
  background: rgba(21, 39, 45, 0.07);
  color: var(--muted);
}

/* ----- Référence : tables de conversion ----- */
.ref-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin-top: var(--space-md);
}

.ref-table-block {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-strong);
}

.ref-table-block h3 {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 12px 16px;
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.ref-table th,
.ref-table td {
  padding: 7px 16px;
  text-align: right;
  font-size: 0.9rem;
}

.ref-table thead th {
  position: sticky;
  top: 41px;
  background: #fffefb;
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ref-table tbody tr:nth-child(even) {
  background: rgba(21, 39, 45, 0.025);
}

.ref-table tbody td:last-child {
  color: var(--teal);
  font-weight: 600;
}

.ref-fallback {
  color: var(--muted);
  font-size: 0.9rem;
}

.ref-notes {
  margin-top: var(--space-lg);
  max-width: var(--measure);
}

.ref-notes h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: #213338;
  margin: 0 0 12px;
}

.ref-facts {
  margin: 0 0 16px;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}
.ref-facts li {
  margin-bottom: 7px;
}
.ref-facts strong {
  color: var(--ink);
}

@media (max-width: 760px) {
  .dvo {
    grid-template-columns: 1fr;
  }
}
