/* OnlyPhone – page de suivi des réparations */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #16181c;
  --graphite: #2b2e34;
  --brass: #c9a06c;
  --brass-hi: #e6cfa8;
  --brass-ink: #8a6232;
  --brass-tint: #f8f1e7;
  --glass: #f3f4f6;
  --white: #fff;
  --text: #16181c;
  --muted: #555a63;
  --line: rgba(22, 24, 28, .12);
  --on-dark: #f3f4f6;
  --on-dark-muted: #aab0ba;
  --green: #1e7f4f;
  --green-bg: #e4f3ea;
  --red: #b3261e;
  --red-bg: #fce8e6;
  --amber: #744600;
  --amber-bg: #fdf1dc;
  --wa: #177245;
  --f-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --f-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--glass); color: var(--text);
  font: 400 1.0625rem/1.55 var(--f-text); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; margin: 0; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--brass-ink); text-underline-offset: .2em; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brass-ink); outline-offset: 3px; border-radius: 6px; }
.top :focus-visible { outline-color: var(--brass-hi); }
::selection { background: var(--brass-hi); color: var(--ink); }

.wrap { width: 100%; max-width: 720px; margin-inline: auto; padding-inline: 16px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 10px; background: var(--brass); color: var(--ink); font-weight: 600; }
.skip:focus { top: 12px; }

.top { background: radial-gradient(120% 140% at 80% 0%, #2f3238, var(--ink) 60%); color: var(--on-dark); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none; font: 700 1.125rem/1 var(--f-display); letter-spacing: -.02em; }
.brand img { border-radius: 10px; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-dark-muted); font-size: .9375rem; font-weight: 600; text-decoration: none; }
.top-link:hover { color: var(--on-dark); }

.main { flex: 1; display: grid; gap: 16px; align-content: start; padding-top: 24px; padding-bottom: 40px; }
.main:focus { outline: none; }
.card { padding: 24px 20px; border-radius: 24px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(22, 24, 28, .05), 0 18px 40px -28px rgba(22, 24, 28, .35); }
@media (min-width: 560px) { .card { padding: 32px 32px; } }
.eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-ink); margin-bottom: 8px; }
h1 { font-size: clamp(1.875rem, 6vw, 2.5rem); font-weight: 750; }
.lead { margin-top: 10px; color: var(--muted); }
.help { margin-top: 18px; font-size: .9375rem; color: var(--muted); }

.form { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 560px) { .form { grid-template-columns: 1fr 1fr; } .form .btn, .form .error { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #868b94; border-radius: 14px; background: var(--white);
  font: 600 1.125rem/1.2 var(--f-text); letter-spacing: .04em; text-transform: uppercase; color: var(--text);
}
.field input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; color: #6b7079; }
.field input:focus { border-color: var(--brass-ink); outline: 2px solid var(--brass-ink); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.error { padding: 10px 14px; border-radius: 12px; background: var(--red-bg); color: #8c1d18; font-size: .9375rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid transparent; font: 600 1rem/1.2 var(--f-text); text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: var(--brass-hi); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--graphite); }
.btn-line { border-color: #868b94; background: var(--white); color: var(--text); }
.btn-line:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: var(--white); }
.btn-wa:hover { background: #135e39; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .9375rem; }
.btn.is-busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Résultat */
.result { display: grid; gap: 16px; }
.hello { color: var(--muted); font-weight: 600; }
.device { margin-top: 4px; font-size: clamp(1.625rem, 5.5vw, 2.25rem); font-weight: 750; }
.num { margin-top: 6px; color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.status {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px 18px; border-radius: 18px;
  background: var(--glass);
}
.status-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #4f79a8; box-shadow: 0 0 0 6px rgba(79, 121, 168, .18); }
.status.is-ok { background: var(--green-bg); }
.status.is-ok .status-dot { background: var(--green); box-shadow: 0 0 0 6px rgba(30, 127, 79, .18); animation: pulse 1.6s ease-in-out infinite; }
.status.is-warn { background: var(--amber-bg); }
.status.is-warn .status-dot { background: #c27c0e; box-shadow: 0 0 0 6px rgba(194, 124, 14, .2); }
.status.is-bad { background: var(--red-bg); }
.status.is-bad .status-dot { background: var(--red); box-shadow: 0 0 0 6px rgba(179, 38, 30, .16); }
.status.is-done .status-dot { background: #868b94; box-shadow: 0 0 0 6px rgba(134, 139, 148, .18); }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(30, 127, 79, .08); } }
.status-label { font: 700 1.25rem/1.2 var(--f-display); letter-spacing: -.015em; }
.status-sub { font-size: .9375rem; color: var(--muted); margin-top: 2px; }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; }
.step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.step::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--white); border: 2px solid #c3c6cc; color: var(--muted); font-weight: 700; position: relative; z-index: 1;
}
.step::after { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: #c3c6cc; }
.step:first-child::after { display: none; }
.step.is-done::before { content: "✓"; background: var(--ink); border-color: var(--ink); color: var(--white); }
.step.is-done::after, .step.is-now::after { background: var(--ink); }
.step.is-now { color: var(--text); }
.step.is-now::before { background: var(--brass); border-color: var(--brass); color: var(--ink); box-shadow: 0 0 0 5px rgba(201, 160, 108, .3); }

.facts { display: grid; gap: 8px; margin: 20px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

h2 { font-size: 1.375rem; font-weight: 700; }
.quote-lines { width: 100%; margin-top: 14px; border-collapse: collapse; }
.quote-lines td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.quote-lines td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.quote-lines tr.total td { border-bottom: 0; font-weight: 800; font-size: 1.125rem; padding-top: 12px; }
.quote-state { margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.quote-state.is-ok { background: var(--green-bg); color: #17603c; }
.quote-state.is-bad { background: var(--red-bg); color: #8c1d18; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.confirm { display: grid; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--brass-tint); }
.pay { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--brass-tint); font-weight: 600; }
.pay strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.history { display: grid; margin: 14px 0 0; padding: 0; list-style: none; }
.event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 16px; }
.event::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.event:last-child::before { display: none; }
.event-dot { width: 12px; height: 12px; margin: 5px 0 0 3px; border-radius: 50%; background: var(--brass); }
.event:not(:first-child) .event-dot { background: #c3c6cc; }
.event-title { font-weight: 700; }
.event-text { color: #3a3e45; white-space: pre-line; overflow-wrap: anywhere; }
.event-when { font-size: .875rem; color: var(--muted); }

.contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.contact-addr { margin-top: 10px; color: var(--muted); font-size: .9375rem; }
.again { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.foot { padding: 20px 0 28px; color: var(--muted); font-size: .875rem; text-align: center; }

@media (max-width: 479px) {
  .step { font-size: .6875rem; }
  .step::before { width: 28px; height: 28px; }
  .step::after { top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); }
  .quote-actions .btn, .contact .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
