/* ========== Base ========= */
#fcw {
  --fcw-bg: #ffffff;
  --fcw-border: #e5e7eb;
  --fcw-border-strong: #d1d5db;
  --fcw-accent: #2563eb;
  --fcw-accent-soft: rgba(37, 99, 235, 0.06);
  --fcw-text-main: #111827;
  --fcw-text-muted: #6b7280;
  --fcw-radius-lg: 16px;
  --fcw-radius-md: 12px;
  --fcw-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.1);
  --fcw-shadow-subtle: 0 8px 20px rgba(15, 23, 42, 0.08);
  --fcw-transition-fast: 150ms ease-out;
  box-sizing: border-box;
  max-width: 780px;
  margin: 1.5rem auto;
  padding: 1.5rem 1.75rem 1.25rem;
  background: var(--fcw-bg);
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.03);
  box-shadow: var(--fcw-shadow-soft);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* reset inside */
#fcw * {
  box-sizing: border-box;
  font-family: inherit;
}

/* ========== Header ========= */
#fcw .fcw-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

#fcw .fcw-title {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--fcw-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#fcw .fcw-title span.icon {
  font-size: 1.1rem;
}

#fcw .fcw-subtitle {
  font-size: 0.85rem;
  color: var(--fcw-text-muted);
}

/* ========== Grid / Zones ========= */
#fcw .grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

#fcw .zone {
  position: relative;
  border-radius: var(--fcw-radius-lg);
  padding: 1rem;
  border: 1px dashed var(--fcw-border-strong);
  background: #f9fafb;
  transition: border-color var(--fcw-transition-fast),
    box-shadow var(--fcw-transition-fast),
    background var(--fcw-transition-fast),
    transform var(--fcw-transition-fast);
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

#fcw .zone:hover {
  border-color: var(--fcw-accent);
  background: #f3f4ff;
  box-shadow: var(--fcw-shadow-subtle);
  transform: translateY(-1px);
}

#fcw .zone.drag {
  border-style: solid;
  border-color: var(--fcw-accent);
  background: #ebf2ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

#fcw .zone label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: var(--fcw-text-main);
}

/* little badge under label */
#fcw .zone label::after {
  content: "PNG, JPG · up to 10MB";
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--fcw-text-muted);
}

/* Right zone: Choose image + Start Live in one line */
#fcw .fcw-zone2-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

#fcw .fcw-zone2-actions button {
  flex: 0 0 auto;
  width: auto;
}

#fcw .fcw-zone2-actions button.main::before {
  content: none;
}

/* ========== Zone button ========= */
#fcw .zone button {
  /* width: 100%; */
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background var(--fcw-transition-fast),
    border-color var(--fcw-transition-fast),
    transform var(--fcw-transition-fast),
    box-shadow var(--fcw-transition-fast);
}

#fcw .zone button::before {
  content: "📁";
  font-size: 0.95rem;
}

#fcw .zone button:hover {
  background: #eef2ff;
  border-color: var(--fcw-accent);
  transform: translateY(-0.5px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

#fcw .zone button:focus-visible {
  outline: 2px solid var(--fcw-accent);
  outline-offset: 2px;
}

/* ========== Preview & Meta ========= */
#fcw .zone img {
  display: none;
  width: 100%;
  object-fit: cover;
  border-radius: var(--fcw-radius-md);
  margin-top: 0.7rem;
  max-height: 210px;
}

#fcw .meta {
  font-size: 0.78rem;
  color: var(--fcw-text-muted);
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* ========== Main button & helpers ========= */
#fcw .fcw-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.compare-face-btn {
  padding: 10px;
}
#fcw button.main {
  margin-top: 0;
  /* width: 100%; */
  /* padding: 0.9rem 1rem; */
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--fcw-accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
  transition: background var(--fcw-transition-fast),
    box-shadow var(--fcw-transition-fast),
    transform var(--fcw-transition-fast);
}

#fcw button.main:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

#fcw button.main:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* Score explanation */
#fcw .fcw-score-help {
  font-size: 0.75rem;
  color: var(--fcw-text-muted);
  text-align: center;
}

/* Missing image hint */
#fcw .fcw-missing-hint {
  font-size: 0.75rem;
  color: #f97316;
  text-align: center;
  min-height: 1.1em;
}

/* Spinner */
#fcw #spinner {
  display: none;
  width: 26px;
  height: 26px;
  border: 3px solid var(--fcw-accent);
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  margin: 0.1rem auto 0;
}

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

/* ========== Banner ========= */
#fcw #banner {
  display: none;
  margin: 0.7rem 0 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  font-weight: 550;
  font-size: 0.87rem;
  text-align: center;
}

#fcw .good {
  background: #dcfce7;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.1);
}

#fcw .bad {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.1);
}

/* ========== Result CTA (ProFaceFinder) – directly under result ========= */
#fcw .fcw-result-cta {
  margin-top: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--fcw-radius-md);
  background: #f8fafc;
  border: 1px solid var(--fcw-border);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

#fcw .fcw-result-cta p {
  margin: 0 0 0.5rem;
  color: var(--fcw-text-main);
}

#fcw .fcw-result-cta a.fcw-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--fcw-accent);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background var(--fcw-transition-fast), transform var(--fcw-transition-fast);
}

#fcw .fcw-result-cta a.fcw-cta-link:hover {
  background: #1d4ed8;
  transform: translateY(-0.5px);
}

/* ========== History table ========= */
#fcw .fcw-history-wrap {
  margin-top: 1.2rem;
  border-radius: var(--fcw-radius-lg);
  background: #f9fafb;
  padding: 0.75rem 0.85rem 0.4rem;
  border: 1px solid #e5e7eb;
}

#fcw .fcw-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

#fcw .fcw-history-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}

#fcw .fcw-history-sub {
  font-size: 0.7rem;
  color: #9ca3af;
}

#fcw table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

#fcw th,
#fcw td {
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid #e5e7eb;
}

#fcw th {
  background: #f3f4f6;
  text-align: left;
  font-weight: 600;
  color: #4b5563;
}

#fcw tbody tr:last-child td {
  border-bottom: none;
}

#fcw td:nth-child(2) {
  text-align: center;
}

/* Pill for similarity */
#fcw .fcw-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.1rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-weight: 550;
  font-size: 0.72rem;
  background: #eef2ff;
  color: #1d4ed8;
}

#fcw .fcw-pill.match {
  background: #dcfce7;
  color: #166534;
}

#fcw .fcw-pill.borderline {
  background: #fef9c3;
  color: #92400e;
}

#fcw .fcw-pill.nomatch {
  background: #fee2e2;
  color: #b91c1c;
}

/* Editable label cell */
#fcw td.fcw-label-cell {
  cursor: text;
}

/* Empty state row */
#fcw tr.fcw-empty td {
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
  padding: 0.6rem 0.2rem;
}

/* ========== Footer / privacy ========= */
#fcw .fcw-footer {
  margin-top: 0.75rem;
  text-align: center;
}

#fcw .fcw-inline-links {
  font-size: 0.8rem;
  margin: 0.4rem 0 0.15rem;
}

#fcw .fcw-inline-links a {
  color: #4b5563;
  text-decoration: none;
}

#fcw .fcw-inline-links a:hover {
  color: var(--fcw-accent);
}

#fcw .fcw-privacy {
  font-size: 0.72rem;
  color: var(--fcw-text-muted);
}

/* ========== Responsive tweaks ========= */
@media (max-width: 640px) {
  #fcw {
    padding: 1.2rem 1.1rem 1rem;
    margin: 1rem auto;
  }

  #fcw .fcw-title {
    font-size: 1rem;
  }

  #fcw .zone {
    min-height: 170px;
  }

  #fcw .fcw-history-wrap {
    padding-inline: 0.65rem;
  }

  #fcw table th,
  #fcw table td {
    padding-inline: 0.1rem;
  }
}
