/* Pro Face Report: the front photo check (templates/photo_check/,
   static/js/photoCheck.js). The scan animation from /free_analysis on
   attractivenessai.com without its log, shown in the widget itself in place
   of the review step's content, plus the "Photo verified" and error states.
   Loaded on /pro-face-report only. */

/* Hidden by its hidden attribute until photoCheck.js shows it. */
.az-check {
  --az-blue: #0ea5e9;
  --az-blue-dark: #0284c7;
  --az-blue-light: #38bdf8;
  display: flex;
  flex-direction: column;
  animation: azReadyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Header */
.az-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}


.az-header-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--az-blue-light), var(--az-blue-dark));
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.4);
}

.az-header-icon svg {
  width: 24px;
  height: 24px;
  animation: azSpin 3.5s linear infinite;
}

@keyframes azSpin {
  to { transform: rotate(360deg); }
}

.az-header-text { display: flex; flex-direction: column; line-height: 1.3; }

.az-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.az-header-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
}

/* Photo with scanner */
.az-photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 300px;
  max-width: 100%;
  height: 375px;
  margin: 0 auto 18px;
  border-radius: 22px;
  overflow: hidden;
  background: #0a1a38;
  border: 2px solid rgba(14, 165, 233, 0.45);
  box-shadow:
    0 16px 34px rgba(2, 132, 199, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.az-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.az-photo-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Compact feature callout, mirroring the native app's facemesh readout. */
.az-feature-card {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  max-width: calc(100% - 40px);
  padding: 7px 9px;
  border: 1px solid rgba(56, 189, 248, 0.72);
  border-radius: 9px;
  color: #fff;
  background: rgba(5, 15, 32, 0.82);
  box-shadow: 0 6px 18px rgba(2, 8, 23, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transform: translateX(-50%);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.az-feature-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.az-feature-label {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.az-feature-metric {
  overflow: hidden;
  margin-top: 2px;
  color: #bae6fd;
  font-size: 0.61rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.az-feature-mark {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(186, 230, 253, 0.32);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: azFeatureSpin 0.8s linear infinite;
}

@keyframes azFeatureSpin {
  to { transform: rotate(360deg); }
}

/* Targeting corners */
.az-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--az-blue-light);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  z-index: 3;
}
.az-corner.tl { top: 11px; left: 11px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.az-corner.tr { top: 11px; right: 11px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.az-corner.bl { bottom: 11px; left: 11px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.az-corner.br { bottom: 11px; right: 11px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

/* On-photo ANALYZING HUD */
.az-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
  z-index: 4;
}

.az-hud-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.az-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--az-blue-light);
  box-shadow: 0 0 6px 1px rgba(56, 189, 248, 0.8);
  animation: azBlink 1.1s ease-in-out infinite;
}

@keyframes azBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.az-hud-label {
  margin-left: 8px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.az-hud-pct {
  margin-left: auto;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.az-hud-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.az-hud-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--az-blue), var(--az-blue-light));
}

/* ── "Results ready" state, shown once the scan completes ── */
.az-header-icon .az-icon-done {
  display: none;
}

.az-check.is-ready .az-header-icon {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.35);
}

.az-check.is-ready .az-header-icon .az-icon-scan {
  display: none;
}

.az-check.is-ready .az-header-icon .az-icon-done {
  display: block;
  animation: azPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.az-check.is-ready .az-header-title {
  color: #047857;
}

.az-check.is-ready .az-photo-wrap {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow:
    0 16px 34px rgba(5, 150, 105, 0.26),
    0 8px 20px rgba(0, 0, 0, 0.18);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.az-check.is-ready .az-corner {
  border-color: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.az-check.is-ready .az-hud-dot {
  background: #34d399;
  box-shadow: 0 0 6px 1px rgba(52, 211, 153, 0.8);
  animation: none;
}

.az-check.is-ready .az-hud-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.az-check.is-ready .az-feature-card {
  border-color: rgba(52, 211, 153, 0.78);
  background: rgba(4, 47, 46, 0.84);
}

.az-check.is-ready .az-feature-metric {
  color: #a7f3d0;
}

.az-check.is-ready .az-feature-mark {
  border: 0;
  animation: none;
}

.az-check.is-ready .az-feature-mark::before {
  content: '\2713';
  display: block;
  color: #34d399;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 12px;
}

.az-ready-check {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3), 0 12px 28px rgba(5, 150, 105, 0.45);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}

.az-ready-check svg {
  width: 28px;
  height: 28px;
}

.az-check.is-ready .az-ready-check {
  animation: azPop 0.5s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes azPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
/* Continue and Try again are the widget's own buttons (.pfr-btn), each
   shown only in its state. */
.az-check .az-action {
  display: none;
  gap: 8px;
  margin-top: 16px;
}

.az-check .az-action svg {
  width: 17px;
  height: 17px;
}

.az-check.is-ready .az-continue-btn,
.az-check.is-error .az-retry-btn {
  display: inline-flex;
  animation: azReadyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes azReadyIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Error state, when the photo does not pass the check ── */
.az-header-icon .az-icon-error {
  display: none;
}

.az-check.is-error .az-header-icon {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.3);
}

.az-check.is-error .az-header-icon .az-icon-scan {
  display: none;
}

.az-check.is-error .az-header-icon .az-icon-error {
  display: block;
  animation: azPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.az-check.is-error .az-header-title {
  color: #be123c;
}

.az-check.is-error .az-photo-wrap {
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow:
    0 16px 34px rgba(225, 29, 72, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.18);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.az-check.is-error .az-corner {
  border-color: #fb7185;
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.7);
}

.az-check.is-error .az-hud-dot {
  background: #fb7185;
  box-shadow: 0 0 6px 1px rgba(251, 113, 133, 0.8);
  animation: none;
}

.az-check.is-error .az-hud-bar-fill {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

/* "CHECK FAILED" stands alone: 100% says nothing there, and it keeps the
   label on one line in the smaller error-state photo. */
.az-check.is-error .az-hud-pct {
  display: none;
}

.az-check.is-error .az-hud-label {
  white-space: nowrap;
}

.az-check.is-error .az-feature-card {
  display: none;
}

.az-error {
  display: none;
  padding: 14px 16px;
  border: 1px solid rgba(244, 63, 94, 0.22);
  border-radius: 16px;
  background: #fff1f2;
  color: #881337;
  text-align: left;
}

.az-check.is-error .az-error {
  display: block;
  animation: azReadyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.az-error-title {
  margin: 0 0 6px;
  color: #9f1239;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.az-error-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.az-error-list {
  margin: 8px 0 8px;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 767.98px) {
  .az-header-title { font-size: 1.12rem; }
  .az-photo-wrap {
    width: min(270px, 72vw);
    height: auto;
    aspect-ratio: 4 / 5;
  }
  .az-check.is-error .az-photo-wrap { width: min(200px, 54vw); }
  .az-feature-card { top: 10px; min-width: 124px; padding: 6px 8px; }
}

/* Short phones (iPhone SE and the like): the error still fits unscrolled. */
@media (max-width: 767.98px) and (max-height: 700px) {
  .az-check.is-error .az-photo-wrap { width: min(160px, 44vw); }
}

/* The email step's "Your photos passed the quality checks"
   (templates/photo_check/passed.html), in the page's own green (--ok). */
.az-passed {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(26, 154, 92, 0.28);
  border-radius: 0.7rem;
  background: #e9f6ef;
  color: var(--ok, #1a9a5c);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  animation: azReadyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.az-passed-tick {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  color: #fff;
  background: var(--ok, #1a9a5c);
  animation: azPop 0.45s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.az-passed-tick svg {
  width: 0.95rem;
  height: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  .az-header-icon svg,
  .az-feature-mark,
  .az-hud-dot,
  .az-check,
  .az-check .az-action,
  .az-passed,
  .az-passed-tick {
    animation: none;
  }
}
