/* Mon activité (activite.html) et page du rapport partagé (rapport.html) — charte « Fiche de chantier ».
   Les classes ops-* et les identifiants sont ceux d'operations.mjs et de shared-report.mjs. */
@font-face {
  font-family: "Archivo";
  src: url("./assets/fonts/archivo-wdth.woff2") format("woff2-variations"), url("./assets/fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --ink: #102D24; --ink-2: #33493F; --ink-3: #56675E; --ink-soft: #1D4436;
  --lime: #CFF57F; --lime-2: #BCE760; --lime-wash: #EDF7D0;
  --paper: #F4F2E9; --paper-2: #EBE8DA; --sheet: #FFF; --line: #D6D2C1; --line-soft: #E4E0D1;
  --warn: #A9401D; --warn-wash: #FAE7DE;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='1' y='1' width='18' height='18' rx='5' fill='%23CFF57F' stroke='%23102D24' stroke-width='1.6'/%3E%3Cpath d='m5.6 10.3 2.9 2.9 5.9-6.3' fill='none' stroke='%23102D24' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Archivo", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--lime); border-radius: 6px; }
[hidden] { display: none !important; }
.tick { display: inline-block; flex: none; width: 18px; height: 18px; background: var(--tick) center / contain no-repeat; }

/* ---------- En-tête ---------- */
.ops-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 1240px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 40px); background: rgba(244, 242, 233, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.ops-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 21px; font-weight: 800; font-stretch: 115%; letter-spacing: -.03em; }
.ops-brand img { width: auto; height: 40px; }
.ops-brand span { padding: 4px 7px 3px; border-radius: 5px; background: var(--lime); font-size: 11px; font-weight: 750; font-stretch: 75%; letter-spacing: .1em; text-transform: uppercase; }
.ops-header > div { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ops-header > div a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; text-decoration: none; font-size: 15px; font-weight: 600; }
.ops-header > div a:hover { background: rgba(16, 45, 36, .07); }

/* ---------- Page ---------- */
.ops-main { max-width: 1180px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 40px) 64px; }
.ops-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 700; font-stretch: 72%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.ops-eyebrow::before { content: ""; width: 18px; height: 18px; background: var(--tick) center / contain no-repeat; }
.ops-main > h1 { margin: 14px 0 12px; font-size: clamp(32px, 1.2rem + 2.6vw, 54px); line-height: 1.02; font-weight: 800; font-stretch: 110%; letter-spacing: -.03em; text-wrap: balance; }
.ops-lead { max-width: 56ch; margin: 0; font-size: clamp(17px, 1rem + .3vw, 19px); color: var(--ink-2); }
.ops-tabs { display: flex; gap: 4px; max-width: 560px; margin: 28px 0 22px; padding: 4px; border-radius: 12px; background: rgba(16, 45, 36, .055); }
.ops-tabs button { flex: 1; min-height: 46px; border: 1.5px solid transparent; border-radius: 9px; background: transparent; font-size: 15px; font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.ops-tabs button:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.ops-tabs button[aria-pressed="true"] { background: var(--lime); border-color: rgba(16, 45, 36, .25); color: var(--ink); }
#ops-status { margin: 0 0 12px; font-size: 14px; color: var(--ink-3); }
#ops-error { margin: 0 0 16px; padding: 14px 16px; border-left: 3px solid var(--warn); border-radius: 0 10px 10px 0; background: var(--warn-wash); color: var(--warn); font-weight: 600; line-height: 1.55; }

/* ---------- Boutons ---------- */
.ops-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .18s var(--ease-out), background-color .18s, border-color .18s, color .18s; }
.ops-button:hover { background: var(--ink-soft); transform: translateY(-1px); }
.ops-button:active { transform: scale(.98); }
.ops-button.secondary { background: var(--sheet); color: var(--ink); border-color: var(--ink); }
.ops-button.secondary:hover { background: var(--lime); }
.ops-button.lime { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.ops-button.lime:hover { background: var(--lime-2); }
.ops-button:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- Listes et cartes ---------- */
.ops-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin: 8px 0 20px; padding-bottom: 16px; border-bottom: 1.5px solid var(--ink); }
.ops-toolbar h2 { margin: 0; font-size: clamp(24px, 1rem + 1vw, 30px); line-height: 1.1; font-weight: 800; font-stretch: 108%; letter-spacing: -.02em; }
.ops-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ops-card, .ops-form, .ops-empty { min-width: 0; margin-bottom: 18px; padding: clamp(18px, 2.4vw, 26px); border: 1.5px solid var(--ink); border-radius: 16px; background: var(--sheet); box-shadow: 0 24px 48px -36px rgba(16, 45, 36, .5); }
.ops-cards .ops-card { margin-bottom: 0; }
.ops-card h3 { margin: 8px 0 10px; font-size: 21px; line-height: 1.2; font-weight: 750; font-stretch: 106%; letter-spacing: -.015em; overflow-wrap: anywhere; }
.ops-card p { margin: 6px 0; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.ops-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ops-empty { border-style: dashed; border-color: rgba(16, 45, 36, .45); background: transparent; box-shadow: none; text-align: center; color: var(--ink-2); }
.ops-meta { font-size: 13px; color: var(--ink-3); }
.ops-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--paper-2); font-size: 11.5px; font-weight: 750; font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ops-pill.final { background: var(--lime); color: var(--ink); }
.ops-pill.final::before { content: ""; width: 14px; height: 14px; background: var(--tick) center / contain no-repeat; }
.ops-site { margin-top: 14px; padding: 14px 0 0; border-top: 1px dashed var(--line); }

/* ---------- Formulaires ---------- */
.ops-form h2 { margin: 0 0 6px; font-size: clamp(22px, 1rem + .9vw, 28px); line-height: 1.12; font-weight: 800; font-stretch: 106%; letter-spacing: -.02em; }
.ops-form > .ops-help { margin: 0 0 20px; }
.ops-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.ops-form label { display: grid; gap: 7px; min-width: 0; font-size: 14px; font-weight: 650; }
.ops-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .ops-form textarea, .ops-form select { width: 100%; min-width: 0; min-height: 50px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #FBFAF5; color: var(--ink); font-size: 16px; font-weight: 500; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.ops-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, .ops-form textarea:hover, .ops-form select:hover { border-color: var(--ink-3); }
.ops-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, .ops-form textarea:focus, .ops-form select:focus { outline: none; border-color: var(--ink); background: var(--sheet); box-shadow: 0 0 0 4px var(--lime); }
.ops-form input[type="file"] { min-height: 50px; padding: 10px; border: 1.5px dashed var(--ink-3); border-radius: 10px; background: #FBFAF5; font-size: 14px; }
.ops-form textarea { resize: vertical; line-height: 1.6; }
.ops-form .wide { grid-column: 1 / -1; }
.ops-form .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.ops-help { font-size: 13.5px; font-weight: 400; line-height: 1.6; color: var(--ink-3); }

/* Cases à cocher des prestations : la case lime du logo */
.ops-checklist { margin: 18px 0; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.ops-check { display: flex !important; flex-direction: row; align-items: flex-start; gap: 12px !important; min-height: 52px; padding: 13px 0; border-bottom: 1px dashed var(--line); font-weight: 600; cursor: pointer; }
.ops-check:last-child { border-bottom: 0; }
.ops-check input { -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; min-height: 24px; margin: 0; border: 1.5px solid var(--ink); border-radius: 7px; background: var(--sheet); cursor: pointer; transition: background-color .15s; }
.ops-check input:checked { background: var(--tick) center / contain no-repeat; border-color: transparent; }
.ops-check input:focus-visible { box-shadow: 0 0 0 4px var(--lime); outline: 2px solid var(--ink); outline-offset: 2px; }

/* Photos et liens de partage */
.ops-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.ops-photo-grid figure { min-width: 0; margin: 0; overflow: hidden; border: 1.5px solid var(--line); border-radius: 12px; background: var(--sheet); }
.ops-photo-grid img { display: block; width: 100%; height: 160px; object-fit: cover; background: var(--paper-2); }
.ops-photo-grid figcaption { margin: 0; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ops-link-field { width: 100%; margin: 12px 0; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--lime-wash); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.ops-links { margin-top: 20px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.ops-links ul { margin: 0; padding: 0; list-style: none; }
.ops-links li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin: 0; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ops-footer { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.ops-footer a, .ops-footer button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Aperçu du rapport ---------- */
#report-dialog { width: min(95vw, 940px); max-height: 92dvh; padding: 0; border: 1.5px solid var(--ink); border-radius: 16px; color: var(--ink); background: var(--paper); }
#report-dialog::backdrop { background: rgba(16, 45, 36, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#report-dialog > header, #report-dialog > footer { position: sticky; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; background: var(--paper); }
#report-dialog > header { top: 0; border-bottom: 1px solid var(--line); }
#report-dialog > footer { bottom: 0; border-top: 1px solid var(--line); }
#report-dialog > header strong { font-size: 13px; font-weight: 800; font-stretch: 75%; letter-spacing: .12em; text-transform: uppercase; }
#report-preview { padding: clamp(10px, 2vw, 20px); }
#report-preview .service-report { border-radius: 6px; box-shadow: 0 24px 48px -30px rgba(16, 45, 36, .45); }
#report-close { min-width: 44px; min-height: 44px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--sheet); font-size: 24px; line-height: 1; cursor: pointer; }
#report-close:hover { background: var(--lime); }
#report-print-area { display: none; }

/* ---------- Rapport partagé : ce que reçoit le client ---------- */
.shared-body { min-height: 100dvh; display: flex; flex-direction: column; }
.shared-bar { position: sticky; top: 0; z-index: 10; background: rgba(244, 242, 233, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.shared-bar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; max-width: 900px; margin: 0 auto; padding: 12px clamp(14px, 3vw, 24px); }
.shared-label { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; font-weight: 750; font-stretch: 75%; letter-spacing: .12em; text-transform: uppercase; }
.shared-label span[lang] { color: var(--ink-3); }
.shared-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.shared-main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: clamp(14px, 3vw, 28px) clamp(10px, 3vw, 24px) 36px; }
#shared-status { margin: 24px 0; padding: 16px 18px; border: 1.5px dashed rgba(16, 45, 36, .4); border-radius: 12px; text-align: center; color: var(--ink-2); }
.shared-paper .service-report { border-radius: 8px; box-shadow: 0 30px 60px -36px rgba(16, 45, 36, .55), 0 0 0 1px var(--line-soft); }
.shared-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 18px 16px 26px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.shared-footer a { color: var(--ink); font-weight: 700; }

/* ---------- Téléphone ---------- */
@media (max-width: 680px) {
  body { font-size: 15.5px; }
  .ops-header { align-items: center; padding: 10px 14px; }
  .ops-brand { font-size: 0; gap: 0; }
  .ops-brand img { height: 32px; }
  .ops-brand span { display: none; }
  .ops-header > div { flex-wrap: nowrap; gap: 0; }
  .ops-header > div a { min-height: 44px; padding: 0 9px; font-size: 14px; white-space: nowrap; }
  .ops-tabs { max-width: none; }
  .ops-tabs button { font-size: 14px; }
  .ops-cards, .ops-form-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-form .wide { grid-column: auto; }
  .ops-toolbar { align-items: flex-start; }
  .ops-toolbar .ops-button { width: 100%; }
  .ops-card .actions .ops-button, .ops-form .actions .ops-button { flex: 1 1 auto; }
  .ops-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-photo-grid img { height: 120px; }
  .ops-link-field { font-size: 14px; }
  #report-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .shared-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: no-preference) {
  .ops-card { animation: ops-card-in .35s var(--ease-out) both; }
  @keyframes ops-card-in { from { opacity: 0; transform: translateY(10px); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #FFF; }
  .ops-header, .ops-main, #report-dialog, .shared-bar, .shared-footer, #shared-status { display: none !important; }
  #report-print-area { display: block; }
  .shared-main { max-width: none; margin: 0; padding: 0; }
  .shared-paper .service-report { box-shadow: none; border-radius: 0; }
}
