/* ==========================================================================
   JC SERVICE — Maquette V5 & Spécifications V3.0
   Palette officielle :
   - Bleu nuit  : #14263D
   - Orange     : #FF6500 (et #C84B00 pour contraste AA sur fond clair/texte blanc)
   - Blanc      : #FFFFFF
   - Gris clair : #F0F4F7
   ========================================================================== */

:root {
  --navy: #14263D;
  --navy-deep: #0D1A2B;
  --navy-soft: #1E3654;
  --orange: #FF6500;
  --orange-accessible: #C94A00;
  --orange-soft: #FFF3EB;
  --white: #FFFFFF;
  --light-bg: #F0F4F7;
  --border: #D8E1EA;
  --text: #14263D;
  --text-muted: #47586E;
  --danger: #C5221F;
  --danger-bg: #FCE8E6;
  --success: #137333;
  --success-bg: #E6F4EA;
  --warning-bg: #FEF7E0;
  --warning-text: #8A5300;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(20, 38, 61, 0.07);
  --shadow-md: 0 8px 24px rgba(20, 38, 61, 0.12);
  --container-max: 1180px;
  --target-size: 44px;
  --mobile-bar-height: 4.25rem;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
  scroll-padding-bottom: calc(var(--mobile-bar-height) + env(safe-area-inset-bottom, 0px) + 1rem);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: var(--text);
  background-color: var(--white);
  overflow-wrap: break-word;
  padding-bottom: calc(var(--mobile-bar-height) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  body:not(.has-driver-bar) {
    padding-bottom: 0;
  }
}

/* Media never overflows its column */
img, svg, video, canvas {
  max-inline-size: 100%;
  block-size: auto;
}

:where(a, code) {
  overflow-wrap: anywhere;
}

h1, h2, h3 {
  text-wrap: balance;
  margin-block-start: 0;
  color: var(--navy);
  line-height: 1.2;
}

p, li {
  text-wrap: pretty;
}

/* Accessible focus ring (WCAG 2.4.7 / 2.4.11) */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* Minimum 44px touch targets per CDC p.11 & form-factor-adaptation */
:where(
  button,
  select,
  textarea,
  input:not([type="checkbox"], [type="radio"], [type="hidden"]),
  [role="button"],
  nav a,
  .btn,
  label:has(input[type="checkbox"], input[type="radio"])
) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

:where([role="button"], nav a, .btn, label:has(input[type="checkbox"], input[type="radio"])) {
  display: inline-flex;
  align-items: center;
}

:where(nav, nav ul, .toolbar) {
  flex-wrap: wrap;
}

:where(.toolbar > :not(button, input, select, textarea, a, [role="button"], label)) {
  min-inline-size: 0;
}

/* Visually hidden utility (validate-input-after-interaction) */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 999;
  background: var(--navy);
  color: var(--white);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
}

.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

/* Demo / Preprod Banner */
.demo-strip {
  background: var(--navy-deep);
  color: #DCE6F2;
  font-size: 0.8125rem;
  padding: 0.35rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-strip strong {
  color: #FF9852;
}

/* Header (Bloc 1 Maquette V5) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4.25rem;
}

.brand-logo {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
  padding-block: 0.25rem;
}

.brand-logo-main {
  font-size: 1.55rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
}

.brand-jc {
  color: var(--navy);
}

.brand-service {
  color: var(--orange);
}

.brand-sub {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-top: 0.18rem;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
}

.desktop-nav a:hover {
  background: var(--light-bg);
}

.desktop-nav a[aria-current="page"] {
  background: var(--light-bg);
  font-weight: 800;
}

.desktop-nav .nav-suivi {
  border: 1.5px solid var(--border);
  gap: 0.45rem;
}

.desktop-nav .nav-sos {
  background: var(--orange);
  color: var(--navy-deep);
  font-weight: 800;
  gap: 0.45rem;
  padding-inline: 1.05rem;
}

.desktop-nav .nav-sos:hover {
  background: #FF7A24;
}

.menu-toggle-btn {
  background: var(--light-bg);
  border: 1px solid var(--border);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  gap: 0.4rem;
}

@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
  }
  .menu-toggle-btn {
    display: none;
  }
}

/* Mobile Navigation Drawer (<dialog> + scroll-snap per navigation-drawer guide) */
.Drawer {
  --drawer-width: min(21em, 82dvw, 100dvw - 24px);
  --drawer-backdrop: 0;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}

.Drawer::backdrop {
  background: #08121E;
  opacity: calc(var(--drawer-backdrop) * 0.6);
}

.Drawer-scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.Drawer-scroller::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .Drawer-scroller {
    scroll-behavior: smooth;
  }
}

.Drawer-scroller::after {
  content: "";
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}

.Drawer-sheet {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100svh;
  background: var(--navy);
  color: var(--white);
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none;
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

@supports (animation-timeline: scroll()) {
  .Drawer {
    timeline-scope: --drawer-fade;
    animation: fade-drawer-backdrop linear both;
    animation-timeline: --drawer-fade;
  }
  .Drawer-scroller {
    scroll-timeline: --drawer-fade x;
  }
  @property --drawer-backdrop {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
  }
  @keyframes fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 0.85rem;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.drawer-links {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.drawer-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  width: 100%;
}

.drawer-links a:hover,
.drawer-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
}

/* Buttons */
.btn {
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn-orange {
  background: var(--orange);
  color: var(--navy-deep);
  border-color: var(--orange);
}

.btn-orange:hover {
  background: #FF781F;
  border-color: #FF781F;
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-navy:hover {
  background: var(--navy-soft);
}

.btn-light {
  background: var(--white);
  color: var(--navy);
  border-color: var(--border);
}

.btn-light:hover {
  background: var(--light-bg);
}

.btn-outline-light {
  background: rgba(20, 38, 61, 0.65);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Hero Section (Bloc 2 Maquette V5) */
.hero-v5 {
  position: relative;
  background-color: var(--navy);
  color: var(--white);
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 1.5rem 0 1.25rem;
}

.hero-copy h1 {
  color: var(--white);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  margin-bottom: 0.55rem;
}

.hero-loc {
  color: #FF8533;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.hero-sub {
  color: #E8EFF7;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  margin: 0 0 1.25rem;
}

.hero-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

@media (max-width: 400px) {
  .hero-ctas {
    grid-template-columns: 1fr;
  }
}

.hero-phone-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  justify-content: center;
  background: rgba(13, 26, 43, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
}

.hero-phone-bar:hover {
  border-color: var(--orange);
}

.hero-visual {
  position: relative;
  margin-inline: -1rem;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.illustration-badge {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  background: rgba(13, 26, 43, 0.82);
  color: #DCE6F2;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(340px, 46%) 1fr;
    gap: 1.5rem;
    min-block-size: 380px;
  }
  .hero-copy {
    padding: 2.75rem 0;
  }
  .hero-visual {
    margin-inline: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-block: 1.25rem;
    box-shadow: var(--shadow-md);
  }
}

/* Engagements Strip (Bloc 3 Maquette V5) */
.engagements-bar {
  background: var(--light-bg);
  border-bottom: 1px solid var(--border);
}

.engagements-list {
  list-style: none;
  margin: 0;
  padding: 0.9rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.engagements-list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  color: var(--navy);
  padding-inline: 0.35rem;
  border-right: 1px solid var(--border);
}

.engagements-list li:last-child {
  border-right: 0;
}

@media (max-width: 560px) {
  .engagements-list li {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
  }
}

/* Services 4 Photo Cards (Bloc 4 Maquette V5) */
.section-block {
  padding-block: 2.25rem;
}

.section-block.alt-bg {
  background: var(--light-bg);
}

.section-title {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.services-grid-v5 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (min-width: 900px) {
  .services-grid-v5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.service-card-v5 {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.service-card-v5:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow-md);
}

.service-card-v5 img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--navy);
}

.service-card-label {
  padding: 0.8rem 0.65rem;
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.92rem, 1.5vw, 1.02rem);
  background: var(--white);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-cta-center {
  margin-top: 1.35rem;
  display: flex;
  justify-content: center;
}

.btn-pill-more {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn-pill-more span {
  color: var(--orange-accessible);
}

.btn-pill-more:hover {
  border-color: var(--orange);
}

/* Comment ça marche (Bloc 5 Maquette V5) */
.steps-v5 {
  list-style: none;
  margin: 0;
  padding: 1.15rem;
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.step-v5-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--white);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.step-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange-accessible);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 900;
}

@media (min-width: 768px) {
  .steps-v5 {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
  }
  .step-arrow {
    color: var(--orange-accessible);
    font-size: 1.35rem;
    font-weight: 900;
  }
}

@media (max-width: 767px) {
  .step-arrow {
    display: none;
  }
}

/* Zones Normandy Banner & Footer (Bloc 6 Maquette V5) */
.zones-banner-v5 {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-block-size: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  margin-bottom: 1.25rem;
}

.zones-banner-v5 img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.zones-pill-link {
  position: relative;
  z-index: 2;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  padding: 0.75rem 1.65rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-md);
  gap: 0.5rem;
}

.zones-pill-link:hover {
  border-color: var(--orange);
}

.local-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.local-chip {
  text-decoration: none;
  background: var(--light-bg);
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.local-chip:hover {
  border-color: var(--orange);
  background: var(--white);
}

.site-footer {
  background: var(--navy-deep);
  color: #D7E2EE;
  padding: 2rem 0 2.25rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.site-footer h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.65rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.site-footer a {
  color: #D7E2EE;
  text-decoration: none;
  font-size: 0.92rem;
  min-block-size: 36px;
  display: inline-flex;
  align-items: center;
}

.site-footer a:hover {
  color: #FF9852;
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 0.85rem;
  color: #9FB2C8;
}

/* Fixed Mobile Bottom Bar (Bloc 7 Maquette V5 + iOS safe area) */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--white);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -4px 16px rgba(20, 38, 61, 0.1);
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 0.4rem;
  padding-top: 0.4rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
}

.mobile-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--navy);
  font-weight: 800;
  font-size: 0.78rem;
  border-radius: 10px;
  padding: 0.35rem 0.25rem;
  min-block-size: 48px;
  gap: 0.15rem;
}

.mobile-bar-item.is-sos {
  background: var(--orange);
  color: var(--navy-deep);
}

@media (min-width: 900px) {
  .mobile-bottom-bar {
    display: none;
  }
}

/* Forms & Validation (:user-invalid per validate-input-after-interaction) */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.field label {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.field input:not([type="checkbox"], [type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid #94A3B8;
  border-radius: var(--radius-sm);
}

.field textarea {
  min-block-size: 92px;
  resize: vertical;
}

.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

:is(input:not([type="checkbox"], [type="radio"]), select, textarea):user-valid {
  border-color: var(--success);
}

/* Alerts & Badges */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--navy);
  background: var(--light-bg);
  margin-bottom: 1rem;
}

.alert-urgent {
  background: var(--warning-bg);
  border-left-color: var(--orange);
  color: #5F3700;
}

.alert-danger {
  background: var(--danger-bg);
  border-left-color: var(--danger);
  color: #7A1210;
}

.alert-success {
  background: var(--success-bg);
  border-left-color: var(--success);
  color: #0D5224;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--light-bg);
  color: var(--navy);
}

.badge-urgent {
  background: #FFE5D4;
  color: #9A3400;
}

.badge-ok {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warn {
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* Stepper for 3-step SOS form */
.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.35rem;
  list-style: none;
  padding: 0;
}

.stepper li {
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--light-bg);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  text-align: center;
  border: 1.5px solid var(--border);
}

.stepper li[aria-current="step"] {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.stepper li.is-done {
  background: var(--success-bg);
  color: var(--success);
  border-color: #A8DAB5;
}

/* Native Modal Dialogs (light-dismiss-a-dialog) */
dialog.modal-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  width: min(92vw, 560px);
  color: var(--navy);
  box-shadow: var(--shadow-md);
}

dialog.modal-dialog::backdrop {
  background-color: rgba(13, 26, 43, 0.55);
  backdrop-filter: blur(2px);
}

/* Responsive Tables (@container per responsive-table guide) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 78vh);
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
}

.table-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-wrapper thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--navy);
  color: var(--white);
}

.table-wrapper thead th {
  color: var(--white);
  font-weight: 700;
  white-space: nowrap;
}

.table-wrapper tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--white);
  font-weight: 800;
  z-index: 1;
}

@container (width < 640px) {
  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
  }
  .table-wrapper thead {
    display: none;
  }
  .table-wrapper tr {
    margin: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .table-wrapper tbody th {
    position: sticky;
    inset-block-start: 0;
    background: var(--light-bg);
    z-index: 2;
  }
  .table-wrapper td[data-label]::before {
    content: attr(data-label) " : ";
    font-weight: 700;
    color: var(--text-muted);
  }
}

/* Slot Pills & Tabs */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}

.slot-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  justify-content: center;
}

.slot-btn[aria-pressed="true"] {
  background: var(--navy);
  color: var(--white);
  border-color: var(--orange);
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: var(--light-bg);
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 800;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.tab-btn[aria-selected="true"] {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Status timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.6rem;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--light-bg);
  color: var(--text-muted);
}

.timeline li.is-active {
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  border-color: var(--orange);
}

.timeline li.is-passed {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
}

/* Signature pad */
.signature-canvas {
  border: 2px dashed #64748B;
  border-radius: var(--radius-sm);
  background: #FAFAFA;
  touch-action: none;
  cursor: crosshair;
  width: 100%;
  max-width: 440px;
  height: 160px;
}
