/* ============================================================
   app.css — Design System FIRST OPTIC v2.0
   Variables CSS, typographie, scrollbars, utilitaires globaux
   ============================================================ */

/* ─── GOOGLE FONTS IMPORT ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── DESIGN TOKENS CSS ───────────────────────────────────── */
:root {
  /* Couleurs primaires */
  --fo-primary:          #1D4ED8;
  --fo-primary-hover:    #2563EB;
  --fo-navy:             #0A192F;
  --fo-navy-hover:       #0D2137;
  --fo-tertiary:         #1E293B;

  /* Accent */
  --fo-accent:           #0EA5E9;

  /* Statuts */
  --fo-success:          #059669;
  --fo-success-bg:       #D1FAE5;
  --fo-success-text:     #065F46;
  --fo-warning:          #D97706;
  --fo-warning-bg:       #FEF3C7;
  --fo-warning-text:     #92400E;
  --fo-danger:           #DC2626;
  --fo-danger-hover:     #EF4444;
  --fo-danger-bg:        #FEE2E2;
  --fo-danger-text:      #991B1B;
  --fo-info:             #2563EB;
  --fo-info-bg:          #DBEAFE;
  --fo-info-text:        #1E40AF;

  /* Surfaces Light Mode */
  --fo-background:       #F8FAFC;
  --fo-background-gray:  #F1F5F9;
  --fo-surface:          #FFFFFF;
  --fo-lines:            #E2E8F0;
  --fo-lines-input:      #CBD5E1;

  /* Textes */
  --fo-text-primary:     #0F172A;
  --fo-text-secondary:   #475569;
  --fo-text-disabled:    #94A3B8;
  --fo-text-on-dark:     #F8FAFC;

  /* Espacement (rythme 4px) */
  --fo-space-1:          4px;
  --fo-space-2:          8px;
  --fo-space-3:          12px;
  --fo-space-4:          16px;
  --fo-space-6:          24px;
  --fo-space-8:          32px;

  /* Rayons */
  --fo-radius-sm:        4px;
  --fo-radius:           8px;
  --fo-radius-lg:        12px;
  --fo-radius-full:      9999px;

  /* Transitions */
  --fo-transition:       all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --fo-transition-color: color 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Ombres */
  --fo-shadow-card:      0 1px 3px 0 rgba(10, 25, 47, 0.06), 0 1px 2px -1px rgba(10, 25, 47, 0.06);
  --fo-shadow-dialog:    0 4px 12px 0 rgba(10, 25, 47, 0.08);
  --fo-shadow-appbar:    0 1px 2px 0 rgba(10, 25, 47, 0.12);
}

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fo-text-primary);
  background-color: var(--fo-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── SCROLLBAR PREMIUM ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--fo-background-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--fo-lines-input);
  border-radius: var(--fo-radius-full);
  transition: var(--fo-transition-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fo-text-disabled);
}

/* ─── POLICE MONOSPACE (VALEURS CLINIQUES) ────────────────── */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

/* ─── LOADING BLAZOR (requis par le framework) ────────────── */
.loading-progress {
  position: relative;
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 20vh auto 1rem auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--fo-lines);
  stroke-width: 0.5rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--fo-primary);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--fo-text-secondary);
  inset: calc(20vh + 3.5rem) 0 auto 0;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Chargement...");
}

/* ─── BLAZOR ERROR UI ─────────────────────────────────────── */
#blazor-error-ui {
  background: var(--fo-danger-bg);
  border-top: 2px solid var(--fo-danger);
  color: var(--fo-danger-text);
  bottom: 0;
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/* ─── VALIDATION FORMULAIRES ──────────────────────────────── */
.valid.modified:not([type=checkbox]) {
  outline: 1px solid var(--fo-success);
}

.invalid {
  outline: 1px solid var(--fo-danger);
}

.validation-message {
  color: var(--fo-danger);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

/* ─── MUDBLAZOR OVERRIDES GLOBAUX ─────────────────────────── */

/* AppBar avec branding Navy */
.mud-appbar {
  box-shadow: var(--fo-shadow-appbar) !important;
}

/* Drawer premium (sidebar) */
.mud-drawer {
  box-shadow: 2px 0 8px 0 rgba(10, 25, 47, 0.08) !important;
}

/* Navbar items — état actif */
.mud-nav-item.active > .mud-nav-link {
  background-color: rgba(29, 78, 216, 0.12) !important;
  color: #3B82F6 !important;
  font-weight: 600;
}

.mud-nav-item.active > .mud-nav-link .mud-nav-link-icon {
  color: #3B82F6 !important;
}

/* Table hover row */
.mud-table-row:hover {
  background-color: rgba(29, 78, 216, 0.04) !important;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chips status */
.fo-chip-success {
  background-color: var(--fo-success-bg) !important;
  color: var(--fo-success-text) !important;
}

.fo-chip-warning {
  background-color: var(--fo-warning-bg) !important;
  color: var(--fo-warning-text) !important;
}

.fo-chip-danger {
  background-color: var(--fo-danger-bg) !important;
  color: var(--fo-danger-text) !important;
}

.fo-chip-info {
  background-color: var(--fo-info-bg) !important;
  color: var(--fo-info-text) !important;
}

/* ─── UTILITAIRES TYPOGRAPHIE ─────────────────────────────── */
.fo-text-primary    { color: var(--fo-text-primary) !important; }
.fo-text-secondary  { color: var(--fo-text-secondary) !important; }
.fo-text-disabled   { color: var(--fo-text-disabled) !important; }
.fo-text-on-dark    { color: var(--fo-text-on-dark) !important; }

.fo-fw-400 { font-weight: 400; }
.fo-fw-500 { font-weight: 500; }
.fo-fw-600 { font-weight: 600; }
.fo-fw-700 { font-weight: 700; }

/* ─── UTILITAIRES SURFACES ────────────────────────────────── */
.fo-surface {
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-lines);
  border-radius: var(--fo-radius);
}

.fo-surface-elevated {
  background-color: var(--fo-surface);
  border: 1px solid var(--fo-lines);
  border-radius: var(--fo-radius);
  box-shadow: var(--fo-shadow-card);
}

/* ─── ANIMATIONS GLOBALES ─────────────────────────────────── */
@keyframes fo-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fo-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fo-pulse-brand {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.fo-fade-in {
  animation: fo-fade-in 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fo-slide-in {
  animation: fo-slide-in 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ─── PAGES — LAYOUT STANDARD ─────────────────────────────── */
.fo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--fo-space-6);
}

.fo-page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--fo-navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fo-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fo-text-secondary);
  padding: 0 16px;
}

/* ─── SEARCH BAR ──────────────────────────────────────────── */
.fo-search-bar {
  border: 1px solid var(--fo-lines);
  border-radius: var(--fo-radius);
  padding: var(--fo-space-3) var(--fo-space-4);
  background-color: var(--fo-surface);
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fo-search-bar:focus-within {
  border-color: var(--fo-primary);
}

/* ─── CARD INTERACTIVE ────────────────────────────────── */
.fo-card-interactive {
  cursor: pointer;
  transition: var(--fo-transition-color);
}

.fo-card-interactive:hover {
  border-color: var(--fo-primary) !important;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.08) !important;
}

/* ─── COMPOSANTS SEARCH ───────────────────────────────── */
.fo-search-focus:focus-within {
  border-color: var(--fo-primary) !important;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fo-search-field .mud-input-slot {
  padding-left: 0;
}

/* ─── MUD OVERRIDES COMPLÉMENTAIRES ──────────────────── */

/* Supprimer les ombres sur les boutons MudFab et MudIconButton */
.mud-button-root:not(.mud-button-fab) {
  letter-spacing: normal !important;
}

/* Style snackbar */
.mud-snackbar {
  border-radius: var(--fo-radius) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
}

/* Style dialog */
.mud-dialog {
  border-radius: var(--fo-radius-lg) !important;
  box-shadow: var(--fo-shadow-dialog) !important;
}

.mud-dialog-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 16px !important;
}

/* Overline text dans NavMenu */
.mud-nav-menu .mud-typography-overline {
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
}

/* Table header styling */
.mud-table-head .mud-table-cell {
  background-color: var(--fo-background-gray) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fo-text-secondary);
}

/* Pagination French style */
.mud-table-pagination .mud-input {
  font-size: 13px !important;
}

/* ─── LOADING BLUR OVERLAY ────────────────────────── */
.fo-loading-blur {
  filter: blur(3px);
  opacity: 0.5;
  transition: filter 200ms ease, opacity 200ms ease;
  user-select: none;
  pointer-events: none;
}

/* ─── KPI CARDS & GRID ────────────────────────────── */
.fo-kpi-row-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.fo-kpi-row-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.fo-kpi-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

@media (max-width: 1400px) {
  .fo-kpi-row-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .fo-kpi-row-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fo-kpi-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .fo-kpi-row-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fo-kpi-row-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fo-kpi-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .fo-kpi-row-6 {
    grid-template-columns: 1fr;
  }
  .fo-kpi-row-5 {
    grid-template-columns: 1fr;
  }
  .fo-kpi-row-4 {
    grid-template-columns: 1fr;
  }
}

.fo-kpi-card {
  background: var(--fo-surface);
  border: 1px solid var(--fo-lines);
  border-radius: var(--fo-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  height: 100%;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--fo-shadow-card);
}

.fo-kpi-card:hover {
  border-color: var(--fo-lines-input);
  box-shadow: 0 2px 8px rgba(10, 25, 47, 0.06);
  transform: translateY(-1px);
}

.fo-kpi-card--clickable {
  cursor: pointer;
  user-select: none;
}

.fo-kpi-card--clickable:hover {
  border-color: #F87171;
  background: #FFFBFB;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
  transform: translateY(-2px);
}

.fo-kpi-card--clickable:active {
  transform: translateY(0);
}

.fo-kpi-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fo-kpi-card__icon-wrap {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fo-kpi-card__icon-wrap--primary { background: #DBEAFE; color: #1D4ED8; }
.fo-kpi-card__icon-wrap--success { background: #D1FAE5; color: #059669; }
.fo-kpi-card__icon-wrap--warning { background: #FEF3C7; color: #D97706; }
.fo-kpi-card__icon-wrap--danger  { background: #FEE2E2; color: #DC2626; }
.fo-kpi-card__icon-wrap--info    { background: #E0F2FE; color: #0284C7; }
.fo-kpi-card__icon-wrap--purple  { background: #EDE9FE; color: #7C3AED; }

.fo-kpi-card__icon-wrap .mud-icon-root {
  color: inherit !important;
  font-size: 18px !important;
}

.fo-kpi-card__label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--fo-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fo-kpi-card__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fo-navy);
  line-height: 1.2;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fo-kpi-card__value--primary { color: #1D4ED8; }
.fo-kpi-card__value--success { color: #059669; }
.fo-kpi-card__value--warning { color: #D97706; }
.fo-kpi-card__value--danger  { color: #DC2626; }
.fo-kpi-card__value--info    { color: #0284C7; }
.fo-kpi-card__value--purple  { color: #7C3AED; }

.fo-kpi-card__subtext {
  font-size: 11px;
  color: var(--fo-text-secondary);
  font-weight: 500;
}

/* ─── FULLSCREEN CAMERA DIALOG ────────────────────────────── */
.camera-fullscreen-dialog,
.mud-dialog.camera-fullscreen-dialog {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000000 !important;
  color: #FFFFFF !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 1500 !important;
}

.mud-dialog.camera-fullscreen-dialog .mud-dialog-content {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.mud-dialog-container:has(.camera-fullscreen-dialog) {
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  z-index: 1500 !important;
}

/* Ensure no dark overlay covers the fullscreen camera */
.mud-overlay:has(+ .mud-dialog-container .camera-fullscreen-dialog),
.mud-dialog-provider:has(.camera-fullscreen-dialog) .mud-overlay {
  display: none !important;
  pointer-events: none !important;
}

.camera-shutter-btn {
  width: 68px !important;
  height: 68px !important;
  border-radius: 50% !important;
  border: 4px solid #FFFFFF !important;
  background: rgba(255, 255, 255, 0.2) !important;
  transition: transform 0.15s ease, background 0.15s ease !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.6) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.camera-shutter-btn:active {
  transform: scale(0.9) !important;
  background: #FFFFFF !important;
}

.camera-shutter-btn .mud-icon-root {
  font-size: 28px !important;
  color: #FFFFFF !important;
}




/* ─── DATE PICKER & DATE RANGE PICKER FIXES ───────────────── */

/* Wrapper pour les MudDateRangePicker dans les barres d'outils flex :
   cibler uniquement l'élément racine .mud-picker (car MudBlazor propage Class aux sous-éléments) */
.mud-picker.fo-daterange-picker-wrap {
  width: 290px;
  min-width: 270px;
  max-width: 100%;
  flex: 0 0 auto;
}

/* Optimisation de l'espacement interne des inputs de date / période pour éviter toute troncature */
.mud-picker .mud-input.mud-input-outlined.mud-input-adorned-end {
  padding-right: 8px;
  padding-inline-end: 8px;
}

.mud-picker .mud-input > input.mud-input-root,
.mud-picker .mud-input > input.mud-input-root-outlined {
  min-width: 82px;
  width: 100%;
  flex: 1 1 0%;
  padding-left: 10px;
  padding-inline-start: 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mud-picker .mud-range-input-separator {
  margin: 0 3px !important;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: auto !important;
  min-width: 0 !important;
}

.mud-picker .mud-range-input-separator .mud-icon-root {
  font-size: 16px !important;
}

.mud-picker .mud-range-input-separator + input.mud-input-root-outlined {
  padding-left: 2px !important;
  padding-inline-start: 2px !important;
}

.mud-picker .mud-input-adornment-end {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto;
  margin-left: 2px;
  margin-inline-start: 2px;
}

.mud-picker .mud-input-adornment-end .mud-icon-button {
  padding: 6px;
}

/* Affichage complet du calendrier dans le popover (sans contrainte de largeur ni coupure) */
.mud-popover.mud-picker-popover-paper,
.mud-picker-popover-paper {
  width: auto !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100vh - 64px) !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.mud-picker-container {
  width: auto !important;
  max-width: 100%;
}

/* En-tête du calendrier compact et adapté aux libellés de dates en français */
.mud-picker-toolbar.mud-picker-datepicker-toolbar {
  height: auto !important;
  min-height: 64px !important;
  padding: 10px 16px !important;
  justify-content: center;
}

.mud-picker-datepicker-toolbar .mud-button-year {
  font-size: 0.85rem !important;
  line-height: 1.3 !important;
}

.mud-picker-datepicker-toolbar .mud-button-date {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word;
}

/* Corps du calendrier : affichage complet des 6 semaines sans rognage en bas */
.mud-picker-content {
  min-height: auto !important;
  padding-bottom: 8px !important;
  overflow: visible !important;
}

.mud-picker-view {
  margin-top: 8px !important;
}

.mud-picker-calendar-header-switch {
  margin-top: 2px !important;
  margin-bottom: 4px !important;
}

.mud-picker-calendar-transition {
  margin-top: 6px !important;
  min-height: 222px !important;
}

@media (max-width: 660px) {
  .mud-picker-calendar-content:not(.mud-picker-calendar-content-1) {
    grid-template-columns: 1fr !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FACE ID — Fullscreen Camera Overlay, Oval Guide, Enrollment & Proof Thumbs
   ═══════════════════════════════════════════════════════════════════════════ */
.fo-face-camera-dialog {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.fo-face-camera-dialog .mud-dialog-content {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100dvh !important;
}

.fo-fs-camera-backdrop {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fo-fs-camera-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000000;
    overflow: hidden;
}

@media (min-width: 768px) {
    .fo-fs-camera-backdrop {
        background: rgba(15, 23, 42, 0.90);
        backdrop-filter: blur(6px);
        padding: 1.5rem;
        box-sizing: border-box;
    }

    .fo-fs-camera-stage {
        width: min(92vw, 720px);
        height: min(90dvh, 680px);
        border-radius: 20px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
}

.fo-fs-camera-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.fo-face-video-mirror {
    transform: scaleX(-1);
}

.fo-fs-oval-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    padding-bottom: 4.5rem;
}

.fo-fs-oval-ring {
    width: min(64vw, 260px);
    height: min(82vw, 340px);
    max-height: 52dvh;
    border-radius: 50%;
    border: 4px solid #ef4444;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.50);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fo-fs-oval-ring.state-warn {
    border-color: #f59e0b;
}

.fo-fs-oval-ring.state-ready {
    border-color: #22c55e;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42), 0 0 28px rgba(34, 197, 94, 0.55);
}

.fo-fs-camera-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
}

.fo-fs-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.62);
    color: #ffffff;
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fo-fs-icon-btn:disabled {
    opacity: 0.5;
}

.fo-fs-camera-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.48) 65%, rgba(0, 0, 0, 0) 100%);
}

.fo-fs-status-pill {
    max-width: 92%;
    background: rgba(15, 23, 42, 0.84);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}

.fo-fs-shutter-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.fo-fs-shutter-btn:active {
    transform: scale(0.92);
}

.fo-fs-shutter-btn:disabled {
    opacity: 0.5;
}

.fo-fs-shutter-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    display: block;
}

.fo-face-camera-status-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.72);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    z-index: 4;
}

.fo-face-instruction-pill {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(15, 23, 42, 0.86);
    color: #ffffff;
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
    z-index: 3;
}

.fo-face-instruction-pill--success {
    background: rgba(22, 163, 74, 0.92);
}

.fo-face-instruction-pill--error {
    background: rgba(220, 38, 38, 0.92);
}

.fo-face-shutter-flash {
    position: absolute;
    inset: 0;
    background: #ffffff;
    animation: foFaceShutterFlash 0.35s ease-out forwards;
    pointer-events: none;
    z-index: 5;
}

@keyframes foFaceShutterFlash {
    0% { opacity: 0.9; }
    100% { opacity: 0; }
}

.fo-captured-photo-card {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: #0b1120;
    border-radius: 12px;
    display: block;
}

.fo-enroll-slot-filled {
    height: 108px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #22c55e;
    background: #0f172a;
    position: relative;
}

.fo-enroll-slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fo-enroll-slot-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.fo-enroll-slot-empty {
    height: 108px;
    width: 100%;
    border-radius: 10px;
    border: 2px dashed #cbd5e1;
    background: #ffffff;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.fo-enroll-slot-empty:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.fo-proof-thumb-btn {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    background: #0f172a;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fo-proof-thumb-btn--danger {
    border-color: #ef4444;
}

.fo-proof-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fo-enrolled-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
}

.fo-enrolled-photo-card {
    background: #ffffff;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.fo-enrolled-photo-thumb {
    position: relative;
    height: 108px;
    background: #0f172a;
    overflow: hidden;
}

.fo-enrolled-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.fo-enrolled-photo-placeholder {
    width: 100%;
    height: 100%;
    background: #f0fdf4;
    color: #15803d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
}

.fo-enrolled-photo-loading {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fo-enrolled-photo-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 2px 4px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.fo-enrolled-photo-actions .mud-input-control {
    margin: 0 !important;
}
