/* ── RedoSan Authenticity — Page-specific CSS ──
   This file contains CSS rules unique to this page.
   Shared/base styles are in ../../Style/style.css
   Loaded AFTER shared CSS so overrides work naturally. */

/* Input-mode tabs: site-template segmented buttons */
.face-input-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.face-tab-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  touch-action: manipulation;
}

.face-tab-btn:hover {
  background: var(--card);
  color: var(--primary);
  border-color: var(--primary);
}

.face-tab-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.face-tab-btn.is-active:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* Preview: keep aspect ratio, fit the card layout */
#face-preview {
  display: none;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 12px auto 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

/* Registry management + camera buttons: solid primary, never faded */
.btn-sm.face-mgmt-btn,
#face-cam-start,
#face-cam-stop,
#face-cam-capture {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-sm.face-mgmt-btn:hover,
#face-cam-start:hover,
#face-cam-stop:hover,
#face-cam-capture:hover {
  opacity: 1;
  background: var(--primary-dark);
  color: #fff;
  border: none;
}

/* Liveness mode select: match the site's compact select styling */
#face-liveness-mode {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

#face-liveness-mode:focus {
  border-color: var(--primary);
}

/* Progress overlay: blur the page while identifiers are generated */
.face-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(15, 15, 35, 0.35);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.face-progress-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.face-progress-card {
  width: min(92vw, 380px);
  padding: 28px 24px 22px;
  border-radius: 14px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #ddd);
  box-shadow: 0 18px 60px rgb(0, 0, 0, 0.35);
  text-align: center;
}

.face-progress-spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary, #6c5ce7),
    rgb(108, 92, 231, 0.15) 65%,
    var(--primary, #6c5ce7)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 7px),
    #000 calc(100% - 6px)
  );
  animation: face-spin 0.9s linear infinite;
}

@keyframes face-spin {
  to {
    transform: rotate(360deg);
  }
}

.face-progress-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #222);
  margin-bottom: 4px;
}

.face-progress-text {
  font-size: 0.82rem;
  color: var(--text-muted, #666);
  margin-bottom: 16px;
  min-height: 1.2em;
}

.face-progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--border, #e5e5e5);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
}

.face-progress-bar {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe, #6c5ce7);
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.35s ease;
  animation: face-shimmer 1.4s linear infinite;
}

.face-progress-bar.is-det {
  animation: none;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
}

@keyframes face-shimmer {
  to {
    background-position: -200% 0;
  }
}

.face-progress-pct {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted, #666);
  background: var(--card, #fff);
  border-radius: 4px;
  padding: 0 3px;
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .face-progress-spinner,
  .face-progress-bar {
    animation: none;
  }
}

/* ── Consent checkbox: comfortable touch target on mobile ── */
#face-consent-panel input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: none;
  margin-top: 2px;
  accent-color: #6c5ce7;
  cursor: pointer;
}

/* ── Consent list: RTL-safe, items stacked one below another ── */
.consent-list {
  font-size: 0.78rem;
  margin: 0 0 10px;
  padding-inline-start: 18px;
  padding-inline-end: 4px;
  line-height: 1.7;
  list-style-type: disc;
}

.consent-list li {
  margin-block-end: 6px;
}

/* ── Help card readability & flow (desktop EN copy renders small, and the
      shared pre-line rule forces ragged breaks with a wide right gutter) ── */
.help-card-body {
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.help-card-body li {
  margin-block-end: 4px;
}

.help-card-header {
  font-size: 1rem;
}
