/* Design tokens ported verbatim from docs/prototype/gaona-deal-prototype.html
   (dark slate + coral palette, Inter). Keep these in sync with the landing's
   design system — see docs/product-spec.md "Visual consistency".
   The CSP forbids inline style attributes: every rule lives here. */
:root {
  --bg: #0f141e;
  --bg2: #161d2b;
  --surface: rgba(255, 255, 255, .04);
  --surface2: rgba(255, 255, 255, .065);
  --border: rgba(255, 255, 255, .09);
  --border2: rgba(255, 255, 255, .14);
  --accent: #ea5b3a;
  --accent-hi: #f47150;
  --accent-soft: rgba(234, 91, 58, .14);
  --text: #eef2f7;
  --muted: #9aa6b8;
  --dim: #6b7689;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .13);
  --gold: #e9b949;
  --gold-soft: rgba(233, 185, 73, .15);
  --r: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  background-image:
    radial-gradient(900px 500px at 80% -5%, rgba(234, 91, 58, .10), transparent 60%),
    radial-gradient(700px 500px at 0% 0%, rgba(60, 90, 160, .14), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

main.wrap {
  flex: 1;
  padding-bottom: 90px;
}

/* ---------- entrance: one staggered reveal on page load ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

main.wrap > * {
  animation: rise .45s cubic-bezier(.22, .8, .36, 1) backwards;
}

main.wrap > *:nth-child(2) { animation-delay: .06s; }
main.wrap > *:nth-child(3) { animation-delay: .12s; }
main.wrap > *:nth-child(4) { animation-delay: .18s; }
main.wrap > *:nth-child(5) { animation-delay: .24s; }
main.wrap > *:nth-child(n+6) { animation-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  main.wrap > * {
    animation: none;
  }

  * {
    transition: none !important;
  }
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(15, 20, 30, .82);
  border-bottom: 1px solid var(--border);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.logo {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: lowercase;
}

.logo-sm {
  font-size: 1.1rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: .9rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.sub {
  color: var(--muted);
  max-width: 640px;
}

/* ---------- type & hero ---------- */

.hero {
  padding-top: 44px;
}

.hero .pill {
  margin-bottom: 16px;
}

.eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 10px;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 14px;
}

/* ---------- pills, chips, badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-hi);
  background: var(--accent-soft);
  border: 1px solid rgba(234, 91, 58, .25);
  padding: 5px 12px;
  border-radius: 999px;
  align-self: flex-start;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.pill-green {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, .25);
}

.pill-green .dot {
  background: var(--green);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  font-size: .82rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
}

/* Lifecycle badges (admin table). One hue per state, soft fill + readable text. */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.b-borrador {
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  border: 1px solid var(--border);
}

.b-publicado {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, .25);
}

.b-archivado {
  background: transparent;
  color: var(--dim);
  border: 1px dashed var(--border2);
}

.b-disponible {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, .25);
}

.b-reservado {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(233, 185, 73, .3);
}

.b-vendido {
  background: var(--accent-soft);
  color: var(--accent-hi);
  border: 1px solid rgba(234, 91, 58, .25);
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
}

/* preview banner: the page is a draft view, say so in the prototype's
   mockbar voice */
.previewbar {
  background: var(--accent-soft);
  border: 1px solid rgba(234, 91, 58, .3);
  border-radius: 10px;
  color: #ffd9cc;
  font-size: .82rem;
  text-align: center;
  padding: .55rem 1rem;
  letter-spacing: .02em;
  margin-top: 20px;
}

.previewbar b {
  color: #fff;
}

/* ---------- vidriera ---------- */

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.deal-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .15s, background .15s, transform .15s;
}

.deal-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
}

.empty-state {
  margin-top: 48px;
  padding: 64px 22px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- track record ---------- */

.track-record {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.track-record .deal-card .b-vendido {
  align-self: flex-start;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.btn:hover {
  background: var(--accent-hi);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .1);
}

.btn-sm {
  padding: 7px 12px;
  font-size: .84rem;
  border-radius: 9px;
}

/* Destructive/terminal lifecycle moves (vendido, archivar): an outlined red,
   clearly cautionary against the orange --accent primary and the gray secondary. */
.btn-danger {
  background: transparent;
  color: #f0908c;
  border: 1px solid rgba(214, 69, 69, .5);
}

.btn-danger:hover {
  background: rgba(214, 69, 69, .14);
  border-color: rgba(214, 69, 69, .85);
}

/* The dashboard lifecycle button group sits below the editar/preview links. */
.lifecycle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  background: #0c111a;
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-error {
  color: var(--accent-hi);
  font-size: .8rem;
}

.field-hint {
  color: var(--dim);
  font-size: .8rem;
}

/* inline admin actions (publish button in a deal-table row) */
.inline-form {
  display: inline;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent-hi);
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ---------- auth ---------- */

.auth-card {
  max-width: 420px;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error {
  background: var(--accent-soft);
  border: 1px solid rgba(234, 91, 58, .3);
  color: var(--accent-hi);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
}

/* ---------- admin deal list ---------- */

.deal-admin {
  margin-top: 36px;
}

.deal-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.deal-table-card {
  padding: 6px 0;
  overflow-x: auto;
}

.deal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.deal-table th,
.deal-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.deal-table tbody tr:last-child td {
  border-bottom: none;
}

.deal-table th {
  color: var(--dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .06em;
}

.deal-table tbody tr {
  transition: background .12s;
}

.deal-table tbody tr:hover {
  background: var(--surface);
}

.deal-table .actions {
  white-space: nowrap;
}

.deal-table .actions a {
  color: var(--accent-hi);
  font-weight: 600;
}

.deal-table .actions a:hover {
  color: var(--text);
}

.session-row {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: .85rem;
  color: var(--dim);
}

/* ---------- admin deal form ---------- */

.deal-form-card {
  margin-top: 24px;
}

.deal-form-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deal-form-card h2 {
  margin-top: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-hi);
}

.deal-form-card h2:first-of-type {
  margin-top: 0;
}

/* two-column field grid; full-width fields opt out via .field-full */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.field-full {
  grid-column: 1 / -1;
}

.form-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.form-group legend {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 6px;
}

/* inner 3-up row for comparables / videos */
.form-row3 {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 12px;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

/* ---------- deal preview ---------- */

.thesis {
  margin-top: 28px;
  background: linear-gradient(160deg, rgba(234, 91, 58, .08), var(--surface));
  border-color: rgba(234, 91, 58, .2);
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 18px;
}

.num {
  background: #141b27;
  padding: 16px 14px;
}

.num-k {
  font-size: .72rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.num-v {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.num-v-accent {
  color: var(--accent-hi);
}

.bigwin {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.stat-v {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-k {
  font-size: .76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.comp {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.comp-price {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.comp-meta {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 4px;
}

.comp-tag {
  font-size: .78rem;
  color: var(--dim);
  margin-top: 8px;
}

.video-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-list a {
  color: var(--accent-hi);
  font-weight: 600;
}

.video-list a:hover {
  color: var(--text);
}

.ficha-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.ficha-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.ficha-row dt {
  color: var(--muted);
}

.ficha-row dd {
  font-weight: 600;
  text-align: right;
}

/* card vertical rhythm in the preview */
.deal-form-card,
.thesis,
main.wrap > section.card {
  margin-top: 24px;
}

/* ---------- gallery (admin manager + preview) ---------- */

.gallery-manager h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.photo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}

.photo-thumb,
.plano-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.photo-relabel {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}

.photo-relabel input {
  flex: 1 1 auto;
}

.photo-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.photo-controls form {
  margin: 0;
}

.photo-upload,
.plano-slot form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
}

.plano-slot {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* preview gallery: hero + thumbnail strip */
.gallery-hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.plano-img {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

/* ---------- Data Room (admin manager + preview) ---------- */

.dataroom-reminder {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--accent);
  background: var(--accent-soft, rgba(0, 0, 0, 0.04));
  font-weight: 600;
}

.dataroom-checklist {
  margin: 6px 0 18px;
  padding-left: 20px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.dataroom-checklist li {
  list-style: disc;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}

.doc-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
}

.doc-name {
  font-weight: 600;
}

.doc-size {
  font-size: 0.85rem;
}

.doc-star {
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
}

/* prototype's document chip: a small "page" block, CIRE-branded for análisis */
.doc-ic {
  width: 34px;
  height: 42px;
  border-radius: 5px;
  background: linear-gradient(160deg, #2a3548, #1c2433);
  border: 1px solid var(--border2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}

.doc-ic-cire {
  color: var(--accent-hi);
}

.doc-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}

.doc-meta input[type="text"] {
  flex: 1 1 auto;
}

.doc-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.doc-controls form,
.doc-meta {
  margin: 0;
}

.doc-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-preview-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-preview-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- vidriera cards (slice #6) ---------- */

.deal-card {
  padding: 0;
  overflow: hidden;
}

.deal-card-hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.deal-card:hover .deal-card-hero {
  transform: scale(1.03);
}

.deal-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 22px;
}

.deal-card-body .badge {
  align-self: flex-start;
}

.deal-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-hi);
}

/* ---------- buyer page (slice #6) ---------- */

/* photo mosaic: main photo spans two rows, the rest flow in 1fr cells
   (prototype's .gallery). Labels overlay bottom-left. */
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-auto-rows: 140px;
  grid-auto-flow: dense;
  gap: 8px;
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 24px;
}

.ph {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #232d3e, #161d2b);
}

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

.ph-main {
  grid-row: span 2;
}

.ph:only-child {
  grid-column: 1 / -1;
}

.ph-lbl {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: .7rem;
  background: rgba(0, 0, 0, .55);
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  backdrop-filter: blur(4px);
}

.thesis-title {
  margin-top: 12px;
}

.thesis .sub {
  margin-top: 6px;
  max-width: 760px;
}

.num-sub {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

.bigwin-note {
  margin-left: auto;
  align-self: center;
  font-size: .78rem;
  color: var(--dim);
  max-width: 240px;
}

.bigwin-note b {
  color: var(--text);
}

.btn-wa {
  background: #25d366;
  color: #06301a;
}

.btn-wa:hover {
  background: #3ddf75;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.video-embed {
  margin: 0;
}

.video-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  display: block;
}

.video-embed iframe,
.video-embed .video-facade {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* The click-to-play video facade: a thumbnail button events.js upgrades to the
   real iframe on click. Without JS the <noscript> iframe renders instead. */
.video-facade {
  position: relative;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #000;
}

/* a bottom scrim grounds the play button against bright thumbnails */
.video-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 11, 17, .55), transparent 45%);
  pointer-events: none;
}

.video-facade:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.video-facade:hover .video-thumb {
  transform: scale(1.04);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px; /* optical centering of the ▶ glyph */
  font-size: 1.6rem;
  color: #fff;
  background: rgba(8, 11, 17, .65);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  z-index: 1;
  transition: background .2s ease, transform .2s ease;
}

.video-facade:hover .video-play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .video-thumb,
  .video-play {
    transition: none;
  }
}

.video-embed figcaption {
  font-size: .88rem;
  font-weight: 600;
  margin-top: 8px;
}

/* The GTM <noscript> iframe must never be visible; the CSP forbids inline
   style=, so it carries this class instead. */
.gtm-noscript {
  display: none;
  visibility: hidden;
}

/* The admin Compartir box: per-channel tracked share links. */
.compartir .share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.compartir .share-row label {
  min-width: 130px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--muted);
}

.share-input {
  flex: 1;
  min-width: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  background: #0c111a;
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--muted);
}

.share-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
}

.map-embed {
  margin-bottom: 14px;
}

.map-embed iframe {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: 12px;
  display: block;
}

.ctacard {
  background: linear-gradient(160deg, var(--accent-soft), var(--surface));
  border-color: rgba(234, 91, 58, .2);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.zonaprop-link {
  color: var(--accent-hi);
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  color: var(--dim);
  font-size: .82rem;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  h1 {
    font-size: 1.9rem;
  }

  .num-grid,
  .comp-grid,
  .form-grid,
  .form-row3,
  .ficha-list,
  .docs {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 120px;
  }

  .ph-main {
    grid-column: span 2;
  }

  .bigwin-note {
    margin-left: 0;
    max-width: none;
  }

  .field-full {
    grid-column: auto;
  }

  .deal-admin-head {
    flex-wrap: wrap;
  }
}

/* ---------- buyer-page Data Room gate (slice #8) ---------- */

.dataroom-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* the buyer-page doc grid: two columns of document cards (collapses to one on
   narrow screens via the shared media query below) */
.docs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.docs .doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.docs .doc .doc-ic {
  flex-shrink: 0;
}

/* the unlocked list enters with a staggered rise — the gate's reward moment
   (the HTMX swap replaces the blurred placeholders with the real rows) */
.docs:not(.docs-locked) .doc {
  animation: doc-reveal .45s cubic-bezier(.2, .7, .3, 1) backwards;
}

.docs:not(.docs-locked) .doc:nth-child(2) { animation-delay: .05s; }
.docs:not(.docs-locked) .doc:nth-child(3) { animation-delay: .1s; }
.docs:not(.docs-locked) .doc:nth-child(4) { animation-delay: .15s; }
.docs:not(.docs-locked) .doc:nth-child(5) { animation-delay: .2s; }
.docs:not(.docs-locked) .doc:nth-child(6) { animation-delay: .25s; }
.docs:not(.docs-locked) .doc:nth-child(7) { animation-delay: .3s; }
.docs:not(.docs-locked) .doc:nth-child(n+8) { animation-delay: .35s; }

@keyframes doc-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs:not(.docs-locked) .doc {
    animation: none;
  }
}

.docs .doc-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.docs .doc-size {
  font-size: 0.78rem;
}

.docs .doc-star {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--gold);
  white-space: nowrap;
}

.docs .doc-lock {
  margin-left: auto;
}

.doc-open {
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.doc-open:hover {
  border-color: rgba(234, 91, 58, .35);
  background: rgba(255, 255, 255, .085);
  transform: translateY(-1px);
}

.doc-open:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* locked state: the placeholder rows are blurred and inert — decoration only,
   the real gate is the cookie + the server. The placeholder names are generic. */
.docs-locked {
  filter: blur(6px) saturate(.8);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* the gate is THE conversion moment — it carries the same coral treatment as
   the CTA card so the eye reads "this is the action on this page" */
.gate {
  margin-top: 16px;
  background: linear-gradient(160deg, rgba(234, 91, 58, .10), var(--surface2));
  border: 1px solid rgba(234, 91, 58, .2);
  border-radius: 10px;
  padding: 16px;
}

.gate h3 {
  margin-bottom: 4px;
}

.gate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.gate-form input[type="text"],
.gate-form input[type="email"] {
  flex: 1;
  min-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.gate-form input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate-continuar {
  margin-top: 12px;
}

.gate-other {
  margin-top: 12px;
}

.gate-other summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  transition: color .15s ease;
}

.gate-other summary:hover {
  color: var(--text);
}

.gate-other[open] summary {
  margin-bottom: 10px;
}

/* honeypot: kept in the DOM (a bot fills it) but removed from view and layout.
   Not display:none — some bots skip those; off-screen positioning is more
   robust while staying invisible to humans. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- admin stats (issue #11) ---------- */
/* Per-deal funnel, leads table, and top-content lists. Ported from the
   prototype's stats view; the design tokens are shared. The funnel bar widths
   are expressed as fixed utility classes (.funnel-w-*) rather than inline
   style= attributes — the CSP forbids inline styles. */

.stats-section {
  margin-top: 32px;
}

.stats-section h2 {
  margin-bottom: 12px;
}

.stats-section h3 {
  margin-bottom: 8px;
}

.funnel .step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
}

.funnel .step:first-child {
  margin-top: 0;
}

.funnel .lab {
  width: 180px;
  font-size: .86rem;
  color: var(--muted);
}

.funnel .barwrap {
  flex: 1;
  background: var(--bg);
  border-radius: 7px;
  overflow: hidden;
  height: 30px;
  border: 1px solid var(--border);
}

.funnel .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  min-width: 1.6rem;
  white-space: nowrap;
  transition: width .2s ease;
}

/* Fixed funnel bar widths (snapped to 5% steps in the view layer) — CSP-safe
   alternative to an inline width. */
.funnel-w-0   { width: 0; }
.funnel-w-5   { width: 5%; }
.funnel-w-10  { width: 10%; }
.funnel-w-15  { width: 15%; }
.funnel-w-20  { width: 20%; }
.funnel-w-25  { width: 25%; }
.funnel-w-30  { width: 30%; }
.funnel-w-35  { width: 35%; }
.funnel-w-40  { width: 40%; }
.funnel-w-45  { width: 45%; }
.funnel-w-50  { width: 50%; }
.funnel-w-55  { width: 55%; }
.funnel-w-60  { width: 60%; }
.funnel-w-65  { width: 65%; }
.funnel-w-70  { width: 70%; }
.funnel-w-75  { width: 75%; }
.funnel-w-80  { width: 80%; }
.funnel-w-85  { width: 85%; }
.funnel-w-90  { width: 90%; }
.funnel-w-95  { width: 95%; }
.funnel-w-100 { width: 100%; }

/* The leads table reuses the admin deal-table chrome (.deal-table); this only
   tweaks the engagement-summary cell width so long phrases wrap gracefully. */
.stats-table td {
  vertical-align: middle;
}

/* Top-content lists: a label on the left, a count on the right. Single column
   inside each card (the two cards already sit side by side in .grid2). */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dlist .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.dlist .row:last-child {
  border-bottom: none;
}

.dlist .row span:first-child {
  color: var(--muted);
}

.dlist .row b {
  font-weight: 600;
  white-space: nowrap;
}

/* The análisis-CIRE star on a top document. */
.star {
  color: var(--gold);
  margin-left: 4px;
}

@media (max-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr;
  }

  .funnel .lab {
    width: 120px;
  }
}

/* ---------- photo lightbox (buyer + track-record galleries) ---------- */
/* Progressive enhancement: lightbox.js intercepts the gallery anchors (which
   without JS open the full-size image directly) and opens a native <dialog>.
   All presentation lives here — the CSP forbids inline styles. */

.ph-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.lightbox[open] {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(9, 12, 18, .94);
  backdrop-filter: blur(6px);
}

.lightbox-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 94vw;
}

.lightbox-img {
  max-width: 94vw;
  max-height: 84dvh;
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  animation: lightbox-in .18s ease;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
  color: var(--muted);
  font-size: .85rem;
}

.lightbox-caption.is-empty {
  display: none;
}

.lightbox-btn {
  position: fixed;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: rgba(15, 20, 30, .72);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.lightbox-btn:hover {
  background: var(--accent);
  border-color: var(--accent-hi);
  transform: scale(1.06);
}

.lightbox-prev {
  left: 18px;
  top: 50%;
  translate: 0 -50%;
}

.lightbox-next {
  right: 18px;
  top: 50%;
  translate: 0 -50%;
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  translate: -50% 0;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .06em;
  background: rgba(15, 20, 30, .72);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
}

.lightbox-single .lightbox-prev,
.lightbox-single .lightbox-next,
.lightbox-single .lightbox-counter {
  display: none;
}

@media (max-width: 760px) {
  .lightbox-btn {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}
