/* BuscoDorsal · capa visual común para los tres buscadores de evento. */
:root {
  --bd-panel: rgba(7, 17, 31, .94);
  --bd-panel-soft: rgba(15, 23, 42, .88);
  --bd-line: rgba(148, 163, 184, .25);
  --bd-text: #f8fafc;
  --bd-muted: #a8b3c7;
  --bd-accent: #38bdf8;
  --bd-radius: 16px;
}

body .wrapper {
  width: min(100%, 1540px) !important;
  margin-inline: auto !important;
}

body .sticky-header {
  border-bottom: 1px solid var(--bd-line) !important;
}

body .sticky-header .header-inner {
  width: min(100% - 24px, 1120px) !important;
  margin-inline: auto !important;
  padding: 14px 0 16px !important;
}

body #searchDock:has(.search-box)::before,
body:not(:has(#searchDock .search-box)) .sticky-header .header-inner::before {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 9px;
  padding: 5px 10px;
  border: 1px solid rgba(56, 189, 248, .48);
  border-color: color-mix(in srgb, var(--bd-accent) 48%, transparent);
  border-radius: 999px;
  background: rgba(56, 189, 248, .12);
  background: color-mix(in srgb, var(--bd-accent) 12%, transparent);
  color: #dff6ff;
  font: 800 11px/1.2 system-ui, sans-serif;
  letter-spacing: .09em;
}

body.public-flickr-mode:not(.public-face-mode) #searchDock:has(.search-box)::before,
body.public-flickr-mode:not(.public-face-mode):not(:has(#searchDock .search-box)) .sticky-header .header-inner::before {
  content: "BÚSQUEDA POR DORSAL";
}

body.public-face-mode #searchDock:has(.search-box)::before,
body.public-face-mode:not(:has(#searchDock .search-box)) .sticky-header .header-inner::before {
  content: "DORSAL + BÚSQUEDA POR FOTO";
}

body.private-download-mode #searchDock:has(.search-box)::before,
body.private-download-mode:not(:has(#searchDock .search-box)) .sticky-header .header-inner::before {
  content: "ACCESO PRIVADO CON CÓDIGO";
  --bd-accent: #a78bfa;
  border-color: rgba(167, 139, 250, .58);
  background: rgba(167, 139, 250, .14);
}

body.private-download-mode .search-box {
  border-color: rgba(167, 139, 250, .30) !important;
}

body #searchDock:has(.search-box) {
  padding: 8px 12px 10px !important;
  box-sizing: border-box !important;
}

body .sticky-header .event-logo {
  display: block !important;
  width: min(240px, 52vw) !important;
  max-width: min(240px, 52vw) !important;
  height: clamp(76px, 9vw, 104px) !important;
  min-height: clamp(76px, 9vw, 104px) !important;
  max-height: 104px !important;
  margin: 6px auto 8px !important;
  object-fit: contain !important;
}

body .sticky-header .header-inner > p,
body .sticky-header .subtitle {
  margin: 4px auto 8px !important;
}

body .search-box {
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  width: min(100%, 920px) !important;
  max-width: 920px !important;
  margin: 12px auto 0 !important;
  padding: 16px !important;
  border: 1px solid var(--bd-line) !important;
  border-radius: var(--bd-radius) !important;
  background: var(--bd-panel) !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22) !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 0 !important;
}

body .search-box > .access-panel,
body .search-box > div:has(.face-action-grid),
body .search-box > div:has(#bd-simple-face-actions),
body .search-box > .selected-strip {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body .search-box > div:has(.face-action-grid),
body .search-box > div:has(#bd-simple-face-actions) {
  min-height: 58px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  contain: layout !important;
}

body .search-input {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body .search-input input {
  width: 100% !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
}

body .search-buttons {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(106px, 1fr)) !important;
  gap: 10px !important;
  margin: 0 !important;
}

body .search-buttons button,
body #bd-simple-face-actions button,
body .face-action-grid button {
  min-height: 50px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  transition: transform .15s ease, border-color .15s ease, background .15s ease !important;
}

body .search-buttons button:hover,
body #bd-simple-face-actions button:hover,
body .face-action-grid button:hover {
  transform: translateY(-1px) !important;
}

body #bd-simple-face-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: min(100%, 690px) !important;
  min-height: 50px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  position: static !important;
  transform: none !important;
  contain: layout !important;
}

body #bd-simple-face-actions button {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

html.bd-multi-capture-open body #bd-simple-face-actions {
  display: none !important;
  min-height: 0 !important;
}

body .face-action-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 110px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  transform: none !important;
  contain: layout !important;
}

body .face-action-grid button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Un evento del tipo dorsal no muestra controles faciales heredados. */
body.public-flickr-mode:not(.public-face-mode) .search-box > div:has(.face-action-grid) {
  display: none !important;
  min-height: 0 !important;
}

/* Buscador público por dorsal: misma jerarquía visual que los flujos actuales. */
body.public-flickr-mode:not(.public-face-mode) .sticky-header .header-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

body.public-flickr-mode:not(.public-face-mode) .sticky-header .header-inner > p,
body.public-flickr-mode:not(.public-face-mode) .sticky-header .subtitle {
  display: none !important;
}

body.public-flickr-mode:not(.public-face-mode) .search-box {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: clamp(15px, 2.3vw, 24px) !important;
  border-color: rgba(56, 189, 248, .32) !important;
  background:
    radial-gradient(circle at 50% 0, rgba(56, 189, 248, .10), transparent 48%),
    linear-gradient(145deg, rgba(7, 17, 31, .97), rgba(10, 24, 43, .94)) !important;
}

body.public-flickr-mode:not(.public-face-mode) .search-input {
  max-width: 720px !important;
  margin-inline: auto !important;
}

body.public-flickr-mode:not(.public-face-mode) .search-buttons {
  width: min(100%, 520px) !important;
  margin-inline: auto !important;
}

body.public-flickr-mode:not(.public-face-mode) #results {
  width: min(calc(100% - 24px), 1160px);
  margin: 22px auto 0;
  box-sizing: border-box;
}

body.public-flickr-mode:not(.public-face-mode) #resultsText {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(calc(100% - 16px), 760px);
  box-sizing: border-box;
  margin: 0 auto 18px !important;
  padding: 13px 16px;
  border: 1px solid rgba(56, 189, 248, .42);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 47, 73, .94), rgba(15, 23, 42, .96));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
  color: #e0f2fe !important;
  font: 750 14px/1.4 system-ui, sans-serif;
}

body.public-flickr-mode:not(.public-face-mode) #resultsText::before {
  content: "🔎";
  flex: 0 0 auto;
  font-size: 18px;
}

body.public-flickr-mode:not(.public-face-mode) .idle-photo-card {
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, .24);
  border-radius: 15px;
  background: rgba(7, 17, 31, .92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body.public-flickr-mode:not(.public-face-mode) .idle-photo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, .72);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34);
}

body.public-flickr-mode:not(.public-face-mode) .idle-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body.bd-biometric-disabled .search-box > div:has(.face-action-grid),
body.bd-biometric-disabled .search-box > div:has(#bd-simple-face-actions) {
  display: none !important;
  min-height: 0 !important;
}

body .access-panel {
  border: 1px solid var(--bd-line) !important;
  border-radius: 12px !important;
  background: var(--bd-panel-soft) !important;
}

body #results {
  min-height: 190px;
}

body #resultsText,
body .processing-notice {
  max-width: 980px;
  margin-inline: auto !important;
}

body.bd-no-bib-search #bd-bib-block,
body.bd-no-bib-search .search-box > .search-input,
body.bd-no-bib-search .search-box > .search-buttons,
body.bd-no-bib-search #searchDock .search-input,
body.bd-no-bib-search #searchDock .search-buttons,
body.bd-no-bib-search #quickSearchBtn,
body.bd-no-bib-search .bd-guide-method-bib {
  display: none !important;
}

body.bd-no-bib-search .bd-guide-methods {
  grid-template-columns: minmax(0, 1fr) !important;
}

body .bd-selfie-suggestions {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(calc(100% - 24px), 760px);
  box-sizing: border-box;
  margin: 12px auto 20px;
  padding: 17px 18px;
  border: 1px solid rgba(45, 212, 191, .72);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(6, 78, 59, .97), rgba(8, 47, 73, .97));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #ecfeff;
  text-align: left;
  font-family: system-ui, sans-serif;
}

body .bd-selfie-suggestions-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(45, 212, 191, .18);
  font-size: 22px;
}

body .bd-selfie-suggestions-copy { min-width: 0; }

body .bd-selfie-suggestions strong {
  display: block;
  margin: 1px 0 8px;
  color: #99f6e4;
  font: 900 16px/1.25 system-ui, sans-serif;
}

body .bd-selfie-suggestions ul {
  margin: 0;
  padding-left: 19px;
  color: #e6fffb;
  font: 650 13px/1.48 system-ui, sans-serif;
}

body .bd-selfie-suggestions li + li { margin-top: 5px; }

body .bd-face-result-guidance {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 4px 0 12px;
  padding: 14px 15px;
  border: 1px solid #38bdf8;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 47, 73, .96), rgba(15, 23, 42, .96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  color: #e0f2fe;
  text-align: left;
  font: 600 .92rem/1.45 system-ui, sans-serif;
}

body .bd-face-result-guidance strong { color: #7dd3fc; font-size: 1rem; }

body .bd-search-status-card {
  grid-column: 1 / -1;
  width: min(calc(100% - 20px), 700px);
  box-sizing: border-box;
  margin: 16px auto !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(56, 189, 248, .58);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(8, 47, 73, .95), rgba(15, 23, 42, .96));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  color: #dff6ff !important;
  text-align: center;
  font: 750 14px/1.45 system-ui, sans-serif;
}

body .bd-search-status-card.is-error {
  border-color: rgba(248, 113, 113, .72);
  background: linear-gradient(135deg, rgba(127, 29, 29, .96), rgba(54, 13, 20, .97));
  color: #fee2e2 !important;
}

body .bd-search-feedback {
  position: fixed;
  z-index: 2147483000;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(calc(100% - 28px), 560px);
  box-sizing: border-box;
  padding: 14px 16px;
  border: 2px solid #38bdf8;
  border-radius: 16px;
  background: rgba(7, 17, 31, .98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .52);
  color: #f8fafc;
  font-family: system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

body .bd-search-feedback.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
body .bd-search-feedback.is-warning { border-color: #fbbf24; background: rgba(69, 26, 3, .98); }
body .bd-search-feedback.is-error { border-color: #f87171; background: rgba(69, 10, 10, .98); }
body .bd-search-feedback.is-success { border-color: #34d399; background: rgba(6, 78, 59, .98); }

body .bd-search-feedback-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  font: 950 22px/1 system-ui, sans-serif;
}

body .bd-search-feedback > span:last-child { min-width: 0; }
body .bd-search-feedback strong,
body .bd-search-feedback small { display: block; }
body .bd-search-feedback strong { margin-bottom: 2px; font: 900 15px/1.25 system-ui, sans-serif; }
body .bd-search-feedback small { color: inherit; font: 650 13px/1.4 system-ui, sans-serif; }

body #results.bd-results-arrived {
  animation: bdResultsArrived 1.1s ease;
  scroll-margin-top: 20px;
}

@keyframes bdResultsArrived {
  0%, 100% { filter: none; }
  45% { filter: drop-shadow(0 0 18px rgba(56, 189, 248, .38)); }
}

@media (max-width: 720px) {
  body .sticky-header .header-inner {
    width: min(100% - 16px, 1120px) !important;
    padding-top: 10px !important;
  }

  body .search-box {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body .search-box > * {
    grid-column: 1 !important;
  }

  body .search-buttons,
  body #bd-simple-face-actions,
  body .face-action-grid {
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
  }

  body #bd-simple-face-actions,
  body .face-action-grid {
    min-height: 112px !important;
  }

  body .search-buttons button,
  body #bd-simple-face-actions button,
  body .face-action-grid button {
    font-size: 13px !important;
  }

  body .bd-selfie-suggestions {
    width: calc(100% - 16px);
    gap: 10px;
    padding: 14px 13px;
  }

  body .bd-selfie-suggestions-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  body .bd-selfie-suggestions strong { font-size: 14px; }
  body .bd-selfie-suggestions ul { font-size: 12px; line-height: 1.45; }

  body .bd-search-feedback {
    top: 10px;
    width: calc(100% - 18px);
    padding: 12px 13px;
  }

  body.public-flickr-mode:not(.public-face-mode) #results {
    width: calc(100% - 16px);
    margin-top: 16px;
  }

  body.public-flickr-mode:not(.public-face-mode) #resultsText {
    width: 100%;
    padding: 12px 13px;
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  body .search-buttons,
  body #bd-simple-face-actions,
  body .face-action-grid {
    grid-template-columns: 1fr !important;
  }

  body #bd-simple-face-actions,
  body .face-action-grid {
    min-height: 220px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .search-buttons button,
  body #bd-simple-face-actions button,
  body .face-action-grid button {
    transition: none !important;
  }
}
