/* Raku Skin Scan — floating CTA (bubble + face scan avatar) */
.face-analyzer-fab {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.face-analyzer-fab:hover {
  transform: scale(1.04);
}

.face-analyzer-fab:active {
  transform: scale(0.98);
}

.face-analyzer-fab-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 44px;
  padding: 10px 18px;
  background: #fff;
  color: #1e293b;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.face-analyzer-fab-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.06));
}

.face-analyzer-fab-popup {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.face-analyzer-fab-popup.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.face-analyzer-fab-popup.is-hiding {
  opacity: 0;
  transform: translateY(-6px) scale(0.94);
}

.face-analyzer-fab-emoji {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.face-analyzer-fab-msg {
  letter-spacing: 0.01em;
}

.face-analyzer-fab-avatar {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  background: #e9d5ff;
}

.face-analyzer-fab-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: opacity 0.4s ease;
}

.face-analyzer-fab-avatar-img.is-fading {
  opacity: 0;
}

.face-analyzer-fab-scan-ring {
  position: absolute;
  inset: 14% 12% 18% 12%;
  border: 2px solid rgba(167, 139, 250, 0.85);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.45);
  pointer-events: none;
  animation: faFabRingPulse 2.4s ease-in-out infinite;
}

.face-analyzer-fab-scan-grid {
  position: absolute;
  left: 8%;
  top: 38%;
  width: 38%;
  height: 32%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.75;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 40%, transparent 100%);
}

@keyframes faFabRingPulse {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

.face-analyzer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1198;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.face-analyzer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.fa-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1199;
  width: min(920px, 94vw);
  max-height: min(90vh, 640px);
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  transition: opacity 0.28s ease, transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.fa-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.fa-modal.fa-modal--scan,
.fa-modal.fa-modal--results {
  width: min(720px, 96vw);
  max-height: min(92vh, 720px);
}

.fa-modal.fa-modal--scan {
  border-radius: 12px;
}

.fa-modal.fa-modal--scan .fa-modal-close {
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

.fa-modal.fa-modal--scan .fa-modal-close:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

.fa-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 18px;
}

.fa-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.fa-step {
  display: none;
  flex: 1;
  min-height: 0;
}

.fa-step.active {
  display: flex;
  flex-direction: column;
}

.fa-step-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 420px;
}

@media (max-width: 720px) {
  .fa-step-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .fa-split-visual {
    min-height: 200px !important;
    order: -1;
  }
}

.fa-split-content {
  padding: 48px 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fa-brand {
  text-align: center;
  margin-bottom: 28px;
}

.fa-brand-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 36px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.1;
}

.fa-brand-logo span {
  color: #5eb8d4;
  font-family: inherit;
}

.fa-brand-tag {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #94a3b8;
  margin-top: 4px;
}

.fa-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: #5eb8d4;
  margin: 0 0 8px;
}

.fa-title {
  font-size: 28px;
  font-weight: 800;
  color: #5eb8d4;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  line-height: 1.15;
}

.fa-title.dark {
  color: #1e3a5f;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.fa-desc {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  margin: 0 0 28px;
  max-width: 320px;
}

.fa-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 48px;
  border: none;
  border-radius: 6px;
  background: #5eb8d4;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  width: fit-content;
}

.fa-btn-primary:hover {
  background: #4aa3be;
  transform: translateY(-1px);
}

.fa-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fa-split-visual {
  position: relative;
  background: linear-gradient(135deg, #e8f4f8 0%, #d4ebe8 50%, #c5e0dc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.fa-phone-mock {
  position: relative;
  width: min(220px, 70%);
  aspect-ratio: 9/16;
  background: #111;
  border-radius: 28px;
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.fa-phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #1a1a2e;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  text-align: center;
}

.fa-phone-screen .scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: #00e5ff;
  box-shadow: 0 0 12px #00e5ff;
  animation: faScanLine 2s ease-in-out infinite;
}

@keyframes faScanLine {
  0%, 100% { top: 18%; }
  50% { top: 72%; }
}

.fa-phone-metrics {
  margin-top: auto;
  padding: 8px;
  width: 100%;
  font-size: 8px;
}

.fa-phone-metrics b {
  color: #5eb8d4;
  font-size: 11px;
}

.fa-visual-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1570172619644-dfd03ed5d881?w=600&q=80') center/cover;
  opacity: 0.35;
  filter: blur(2px);
}

.fa-instruction-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.fa-instruction-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

.fa-instruction-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e8f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5eb8d4;
  font-size: 20px;
}

.fa-step-loading {
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  min-height: 420px;
}

.fa-loading-logo {
  font-family: Georgia, serif;
  font-size: 42px;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.fa-loading-logo span {
  color: #5eb8d4;
}

.fa-loading-sub {
  font-size: 12px;
  letter-spacing: 0.25em;
  color: #5eb8d4;
  font-weight: 700;
  margin-bottom: 40px;
}

.fa-ai-chip {
  width: 72px;
  height: 72px;
  margin: 0 auto 32px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e8f4f8, #fff);
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #5eb8d4;
  animation: faPulse 1.5s ease-in-out infinite;
}

@keyframes faPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.fa-powered {
  font-size: 11px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fa-powered b {
  color: #64748b;
  letter-spacing: 0.05em;
}

.fa-step-scan {
  flex: 1;
  min-height: 480px;
  background: #0f172a;
  position: relative;
}

.fa-scan-video-wrap {
  position: absolute;
  inset: 0;
}

.fa-scan-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.fa-scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fa-scan-badge {
  margin-top: 20px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  border-radius: 4px;
  z-index: 3;
}

.fa-scan-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  font-size: 96px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.fa-scan-countdown.visible {
  opacity: 1;
}

.fa-scan-countdown.pop {
  transform: translate(-50%, -50%) scale(1.15);
}

.fa-scan-countdown.flash {
  font-size: 42px;
  letter-spacing: 0.2em;
  color: #5eb8d4;
}

.fa-step-scan.counting .fa-scan-actions {
  opacity: 0.4;
  pointer-events: none;
}

.fa-scan-face-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  height: 68%;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 50% 50% 42% 42%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38);
}

.fa-scan-line-live {
  position: absolute;
  left: 15%;
  right: 15%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  box-shadow: 0 0 20px #00e5ff;
  animation: faScanLine 2.2s ease-in-out infinite;
  opacity: 0;
}

.fa-step-scan.scanning .fa-scan-line-live {
  opacity: 1;
}

.fa-scan-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  display: flex;
  gap: 10px;
  justify-content: center;
  pointer-events: none;
}

.fa-scan-actions button {
  pointer-events: auto;
}

.fa-scan-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fa-scan-btn-capture {
  background: #5eb8d4;
  color: #fff;
}

.fa-scan-btn-outline {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.fa-step-results {
  padding: 24px 28px 28px;
  overflow-y: auto;
  max-height: min(90vh, 640px);
}

.fa-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.fa-result-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.fa-result-card b {
  display: block;
  font-size: 28px;
  color: #0e7490;
  margin-bottom: 4px;
}

.fa-result-card span {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.fa-status-msg {
  margin: 12px 0;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.fa-status-msg.visible {
  display: block;
}

.fa-status-msg.error {
  background: #fff1f2;
  color: #991b1b;
}

.fa-results-detail {
  margin-top: 12px;
}

.fa-result-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.fa-result-row b {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .face-analyzer-fab-bubble {
    min-width: 168px;
    padding: 8px 14px;
  }

  .face-analyzer-fab-popup {
    font-size: 13px;
  }

  .face-analyzer-fab-avatar {
    width: 64px;
    height: 64px;
  }

  .fa-split-content {
    padding: 36px 24px 24px;
  }
}
