/* Foto Tamu — face detection camera UI */

.face-camera-section {
  text-align: center;
}

.face-camera-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 32px rgba(26, 35, 126, 0.25);
}

@supports not (aspect-ratio: 3 / 4) {
  .face-camera-wrapper {
    height: 360px;
  }
}

.face-camera-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.face-camera-wrapper canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
  z-index: 2;
}

/* Overlay panduan wajah (oval hijau + sudut + banner) */
.face-guide-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.face-guide-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  height: 80%;
  transform: translate(-50%, -54%);
}

.face-guide-oval {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.face-guide-oval--outer {
  inset: 0;
  border: 4px solid #22c55e;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.52);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.face-guide-oval--inner {
  inset: 7%;
  border: 2px dashed rgba(255, 255, 255, 0.88);
}

.face-guide-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid #22c55e;
  transition: border-color 0.25s ease;
}

.face-guide-corner.tl {
  top: 20%;
  left: 20%;
  border-right: none;
  border-bottom: none;
  border-radius: 4px 0 0 0;
}

.face-guide-corner.tr {
  top: 20%;
  right: 20%;
  border-left: none;
  border-bottom: none;
  border-radius: 0 4px 0 0;
}

.face-guide-corner.bl {
  bottom: 26%;
  left: 20%;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 4px;
}

.face-guide-corner.br {
  bottom: 26%;
  right: 20%;
  border-left: none;
  border-top: none;
  border-radius: 0 0 4px 0;
}

.face-guide-ear {
  position: absolute;
  top: 36%;
  width: 11%;
  height: 20%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 45% 45% 38% 38%;
}

.face-guide-ear.left {
  left: -5%;
  transform: rotate(-8deg);
}

.face-guide-ear.right {
  right: -5%;
  transform: rotate(8deg);
}

.face-guide-banner {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 92%;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #34d399 0%, #16a34a 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.face-guide-overlay.is-detected .face-guide-oval--outer,
.face-guide-overlay.is-detected .face-guide-corner {
  border-color: #fbbf24;
}

.face-guide-overlay.is-detected .face-guide-banner {
  background: linear-gradient(180deg, #fcd34d 0%, #d97706 100%);
}

.face-guide-overlay.is-aligned .face-guide-oval--outer,
.face-guide-overlay.is-aligned .face-guide-corner {
  border-color: #22c55e;
  animation: face-guide-pulse 1.4s ease-in-out infinite;
}

.face-guide-overlay.is-aligned .face-guide-oval--outer {
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.4), 0 0 18px rgba(34, 197, 94, 0.45);
}

@keyframes face-guide-pulse {
  0%, 100% { border-color: #22c55e; }
  50% { border-color: #86efac; }
}

.face-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.face-status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.face-status-badge.status-searching {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.face-status-badge.status-searching .status-dot {
  background: #dc2626;
  animation: blink 1s infinite;
}

.face-status-badge.status-detected {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.face-status-badge.status-detected .status-dot {
  background: #f59e0b;
}

.face-status-badge.status-ready {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.face-status-badge.status-ready .status-dot {
  background: #22c55e;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.face-preview-wrap {
  display: none;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #22c55e;
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2);
}

.face-camera-stage .face-preview-wrap {
  margin-top: 0;
}

.face-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-camera-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0;
}

.face-camera-submit {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0;
}

/* Tombol pill — sudut melengkung elegan */
.face-camera-section .btn,
.face-camera-loading .btn {
  border-radius: 50px !important;
  min-width: 110px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.face-camera-section .btn:hover,
.face-camera-loading .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  opacity: 0.95;
}

.face-camera-section .btn:active,
.face-camera-loading .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.face-camera-section .btn:focus,
.face-camera-loading .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.face-camera-section .btn i,
.face-camera-loading .btn i {
  margin-right: 0.35rem;
}

.face-camera-section .btn-outline-secondary {
  border: 2px solid #adb5bd !important;
  background: #fff;
  color: #6c757d;
}

.face-camera-section .btn-outline-secondary:hover {
  background: #f8f9fa;
  color: #495057;
}

.face-camera-actions .btn-sm,
.face-camera-submit .btn {
  min-width: 100px;
}

.face-camera-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #94a3b8;
  z-index: 5;
  font-size: 0.85rem;
}

.face-camera-loading .spinner-border {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
  .face-camera-actions .btn,
  .face-camera-submit .btn {
    flex: 1 1 calc(50% - 0.5rem);
  }
}
