/* Face scan / camera capture styles shared by identity-validation and the
   enrollment forms. Page CSS variables are referenced with fallbacks so the
   fragment also renders on pages that do not define them. */

    /* ===== CAMERA MODAL ===== */
    .camera-modal .modal-body {
      padding: 0;
      background: #000;
    }
    .camera-stage {
      position: relative;
      display: flex;
      justify-content: center;
      background: #000;
      overflow: hidden;
    }
    .camera-video {
      width: 100%;
      max-height: 400px;
      object-fit: cover;
      display: block;
      transform: scaleX(-1);
    }
    .camera-canvas {
      display: none;
    }
    .face-guide-canvas {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    .camera-status {
      position: absolute;
      top: 0.75rem;
      left: 0.75rem;
      right: 0.75rem;
      z-index: 6;
      display: flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.4rem 0.75rem;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.82);
      color: #f8fafc;
      font-size: 0.8rem;
      font-weight: 600;
      line-height: 1.3;
      backdrop-filter: blur(4px);
    }
    .camera-status .status-dot {
      flex: 0 0 8px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
    }
    .camera-status.is-checking { color: #fcd34d; }
    .camera-status.is-checking .status-dot { animation: fqPulse 1s ease-in-out infinite; }
    .camera-status.is-pass { color: #6ee7b7; }
    .camera-status.is-fail { color: #fca5a5; }
    .camera-status.is-error { color: #fca5a5; }
    .camera-status.is-unavailable { color: #cbd5e1; }
    .camera-status.is-starting { color: #cbd5e1; }
    @keyframes fqPulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.25; }
    }
    .camera-hint {
      text-align: center;
      color: var(--text-muted, #64748b);
      font-size: 0.8rem;
      padding: 0.65rem 1rem 0.25rem;
    }
    .camera-error {
      margin: 0.5rem 1rem;
      padding: 0.6rem 0.85rem;
      border-radius: 8px;
      background: rgba(239, 68, 68, 0.08);
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #b91c1c;
      font-size: 0.85rem;
      font-weight: 600;
    }
    .camera-override {
      display: none;
      text-align: center;
      padding: 0 0 1rem;
      cursor: pointer;
    }
    .camera-override:not([hidden]) {
      display: block;
    }
    /* Scoped to the modal: the enrollment pages already style their own
       .camera-btn upload buttons green, and those must keep their look. */
    .camera-modal .camera-btn.capture:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    .photo-check-status {
      display: flex;
      align-items: flex-start;
      gap: 0.45rem;
      margin-top: 0.6rem;
      padding: 0.55rem 0.75rem;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 600;
      line-height: 1.35;
    }
    .photo-check-status[hidden] {
      display: none;
    }
    .photo-check-status .fq-icon {
      flex: 0 0 auto;
      font-weight: 700;
    }
    .photo-check-status .fq-text {
      flex: 1 1 auto;
    }
    .photo-check-status.is-checking {
      background: rgba(245, 158, 11, 0.08);
      border: 1px solid rgba(245, 158, 11, 0.25);
      color: #92400e;
    }
    .photo-check-status.is-pass {
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid rgba(16, 185, 129, 0.25);
      color: #065f46;
    }
    .photo-check-status.is-fail {
      background: rgba(239, 68, 68, 0.08);
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #b91c1c;
    }
    .photo-check-status.is-unavailable {
      background: rgba(148, 163, 184, 0.1);
      border: 1px solid rgba(148, 163, 184, 0.3);
      color: #475569;
    }
    .photo-check-status.is-overridden {
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.25);
      color: #1e40af;
    }
    .fq-override {
      background: none;
      border: none;
      padding: 0;
      color: var(--accent-color, #2563eb);
      font-size: 0.8rem;
      font-weight: 700;
      text-decoration: underline;
      cursor: pointer;
    }
    .camera-controls {
      position: absolute;
      bottom: 1rem;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 1rem;
      z-index: 10;
    }
    .camera-modal .camera-btn {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      border: 3px solid white;
      background: rgba(255,255,255,0.2);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .camera-modal .camera-btn:hover {
      background: rgba(255,255,255,0.4);
    }
    .camera-modal .camera-btn.capture {
      background: var(--danger, #dc3545);
      border-color: var(--danger, #dc3545);
    }
    .camera-modal .camera-btn.capture:hover {
      background: #dc2626;
    }


    .btn-camera-option {
      background: #f8fafc;
      border: 1px solid var(--border-color, #e2e8f0);
      color: var(--text-secondary, #475569);
      padding: 0.5rem 1rem;
      border-radius: 8px;
      font-size: 0.875rem;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }
    .btn-camera-option:hover {
      border-color: var(--accent-color, #2563eb);
      color: var(--accent-color, #2563eb);
      background: rgba(37, 99, 235, 0.03);
    }
