/* ==================================================================
   Bulletproof WiFi: the Ubiquiti UniFi page (poc-0.25.0)
   Loaded on ubiquiti-unifi.html only, after site.css. The premium range gets a darker, more technical look than the
   Cudy pages: night bands with a fine grid, Ubiquiti's product photos on dark and the configurator built from the
   shop's own pieces (panels, options, steppers, the summary and the bar at the bottom of a phone).
   ================================================================== */
.page-unifi {
  --uf-night: #120822;
  --uf-deep: #1C0D36;
  --uf-grid: rgba(201, 166, 245, 0.09);
  --uf-rule: rgba(233, 219, 251, 0.16);
  --uf-6: #C9A6F5;  /* the 6 GHz band in the drawing: lilac */
  --uf-5: #FFB38A;  /* the 5 GHz band: peach */
}

/* the fine grid behind the dark bands, fading out towards the edges */
.uf-hero::before, .uf-dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--uf-grid) 1px, transparent 1px), linear-gradient(90deg, var(--uf-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 30%, #000 10%, transparent 80%);
  mask-image: radial-gradient(70% 70% at 70% 30%, #000 10%, transparent 80%);
}
.uf-dark::before {
  -webkit-mask-image: radial-gradient(60% 60% at 50% 35%, #000 10%, transparent 80%);
  mask-image: radial-gradient(60% 60% at 50% 35%, #000 10%, transparent 80%);
}

/* ---------- hero ---------- */
.uf-hero {
  position: relative; overflow: hidden; color: var(--white); padding-top: var(--s5);
  background: radial-gradient(90% 80% at 78% 22%, #4A1D86 0%, var(--uf-deep) 48%, var(--uf-night) 100%);
}
.uf-hero .container { position: relative; }
.uf-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s4); align-items: center; }
.uf-hero__copy { min-width: 0; }
/* the Ubiquiti and UniFi logos over the heading (Chris, 11 November), from Ubiquiti's own brand files in white */
.uf-brands { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.uf-brands img { display: block; width: auto; }
.uf-brands__ubiquiti { height: 30px; }
.uf-brands__unifi { height: 23px; }
.uf-brands__rule { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.35); }
.uf-hero .eyebrow { color: var(--peach); display: block; margin-bottom: var(--s2); }
.uf-hero h1 { color: var(--white); font-size: var(--fs-hero); font-weight: 700; letter-spacing: -0.025em; line-height: 1.02; }
.uf-hero h1 .peach { color: var(--peach); display: block; margin-top: 0.12em; }
.uf-hero__lede { color: var(--lilac-soft); font-size: var(--fs-md); margin-top: var(--s3); max-width: 50ch; }
.uf-hero__art { position: relative; }
.uf-hero__art::before { /* the soft light the routers stand in */
  content: ""; position: absolute; left: 4%; right: 4%; top: 18%; bottom: 4%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(155, 106, 230, 0.42), transparent);
}
.uf-hero__art img { position: relative; width: 100%; height: auto; }

/* the four numbers along the bottom of the hero */
.uf-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--s4); border-top: 1px solid var(--uf-rule); }
.uf-specs li { display: grid; gap: 0.15rem; align-content: start; padding: var(--s3) var(--s2) var(--s4); border-left: 1px solid var(--uf-rule); }
.uf-specs li:first-child { border-left: 0; padding-left: 0; }
.uf-specs b { font-family: var(--font-display); font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 700; color: var(--white); line-height: 1.1; letter-spacing: -0.01em; }
.uf-specs span { font-size: var(--fs-sm); color: var(--lilac-soft); line-height: 1.4; }

/* ---------- the dark band: how the units talk ---------- */
.uf-dark { position: relative; overflow: hidden; background: var(--uf-night); color: var(--white); padding-block: var(--s5); } /* s6 until poc-0.27.1 */
.uf-dark .container { position: relative; }
.uf-dark h2, .uf-dark h3 { color: var(--white); }
.uf-dark p { color: var(--lilac-soft); }
.uf-dark .eyebrow { color: var(--peach); }

/* the drawing: a satellite, the router and a satellite, each link drawn as two lines with light running along them */
.uf-mesh {
  display: grid; align-items: start; max-width: 960px; margin: 0 auto var(--s5);
  grid-template-columns: minmax(0, 1fr) minmax(64px, 1.1fr) minmax(0, 1.2fr) minmax(64px, 1.1fr) minmax(0, 1fr);
}
.uf-mesh__unit { display: grid; justify-items: center; text-align: center; gap: 0.15rem; min-width: 0; }
/* every photo sits in a box of the same height, so the lines meet each one halfway up */
.uf-mesh__unit img { width: 100%; max-width: 150px; height: 190px; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5)); }
.uf-mesh__unit--main img { max-width: 190px; }
.uf-mesh__unit b { font-family: var(--font-display); color: var(--white); font-size: 1.05rem; line-height: 1.2; }
.uf-mesh__unit span { font-size: var(--fs-sm); color: var(--lilac-soft); line-height: 1.35; }
.uf-mesh__link { display: grid; gap: 1.9rem; margin-top: calc(95px - 1.05rem); }
.uf-band { position: relative; display: block; height: 3px; border-radius: 3px; }
.uf-band--6 { background: linear-gradient(90deg, transparent, var(--uf-6) 14%, var(--uf-6) 86%, transparent); }
.uf-band--5 { background: linear-gradient(90deg, transparent, var(--uf-5) 14%, var(--uf-5) 86%, transparent); }
.uf-band em {
  position: absolute; left: 50%; bottom: 0.6rem; transform: translateX(-50%); white-space: nowrap;
  font-style: normal; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; color: var(--uf-6);
}
.uf-band--5 em { bottom: auto; top: 0.6rem; color: var(--uf-5); }
.uf-band::after {
  content: ""; position: absolute; inset: -2px 0; border-radius: 6px;
  background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.95) 50%, transparent 100%) no-repeat;
  background-size: 34% 100%; animation: uf-run 2.6s linear infinite;
}
.uf-band--5::after { animation-direction: reverse; animation-delay: -1.3s; }
@keyframes uf-run { from { background-position: -60% 0; } to { background-position: 160% 0; } }

.uf-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.uf-points > div { display: grid; gap: 0.5rem; align-content: start; padding-top: var(--s3); border-top: 1px solid var(--uf-rule); }
.uf-points h3 { font-size: 1.15rem; }
.uf-points p { font-size: 1rem; }
.uf-fine { margin-top: var(--s4); text-align: center; font-size: var(--fs-sm); }
.uf-dark .uf-fine { color: rgba(233, 219, 251, 0.62); }

/* ---------- 5G failover ---------- */
.uf-fail { display: grid; gap: var(--s2); margin-block: 0.4rem; }
.uf-fail li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.uf-fail__n { width: 40px; height: 40px; border-radius: 12px; background: var(--uf-deep); color: var(--peach); font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; }
.uf-fail b { font-family: var(--font-display); font-size: 1.08rem; color: var(--violet-deep); }
.uf-fail p { font-size: 0.98rem; }
.uf-photo {
  display: grid; justify-items: center; gap: 0.4rem; padding: var(--s3); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  background: radial-gradient(75% 65% at 50% 42%, #44197A 0%, var(--uf-deep) 55%, var(--uf-night) 100%);
}
.uf-photo img { width: min(380px, 100%); height: auto; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.55)); }
.uf-photo figcaption { font-size: var(--fs-sm); color: var(--lilac-soft); padding-bottom: 0.4rem; }

/* ---------- how it works: four steps ---------- */
.uf-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }

/* ---------- the configurator ---------- */
.uf-build-band { background: linear-gradient(180deg, var(--white) 0, var(--mist) 220px); }
.uf-build { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s3) var(--s4); align-items: start; }
.uf-build__main { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-width: 0; }
.uf-summary { grid-column: 2; grid-row: 1 / span 2; }
.uf-details { grid-column: 1; grid-row: 2; }

/* router cards: three across, each with its photo in a box of the same height */
.uf-routers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.uf-router { grid-template-rows: auto auto auto 1fr; }
.uf-router__photo { display: grid; place-items: center; height: 132px; margin: -0.2rem -0.35rem 0.2rem; border-radius: var(--r-sm); background: radial-gradient(80% 80% at 50% 45%, #FFFFFF 0%, var(--mist) 100%); }
.uf-router__photo img { height: 124px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(62, 23, 112, 0.18)); }
.uf-router .option__name { font-size: 1.1rem; line-height: 1.2; text-wrap: balance; }
.uf-router .option__tag { margin-top: -0.1rem; }
.uf-router .option__price { font-size: 1.4rem; }

/* questions */
.uf-q { display: grid; gap: 0.55rem; }
.uf-q .label { margin-bottom: 0; }
.uf-q .hint:empty { display: none; }
.uf-q + .uf-q { padding-top: var(--s3); border-top: 1px solid var(--mist); }
.uf-note { display: block; margin-top: 0.15rem; padding: 0.6rem 0.8rem; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 0.9rem; }
.uf-note--warn { background: var(--warn-soft); color: var(--warn); }

/* the satellites row: photo, name and price, stepper */
.uf-sat { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: var(--s2); align-items: center; padding: 0.9rem 1.1rem; border: 2px solid var(--lilac-soft); border-radius: var(--r-md); }
.uf-sat__photo { width: 88px; height: 64px; object-fit: contain; }
.uf-sat h3 { font-size: 1.08rem; }
.uf-sat p { font-size: 0.93rem; }

/* the summary */
.uf-summary__photos { display: flex; align-items: flex-end; justify-content: center; gap: 0.35rem; min-height: 96px; padding: 0.6rem; border-radius: var(--r-md); background: radial-gradient(80% 90% at 50% 40%, #44197A 0%, var(--uf-night) 100%); }
.uf-summary__photos img { height: 84px; width: auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5)); }
.uf-summary__photos img.is-small { height: 56px; }
.uf-summary__photos small { color: var(--lilac-soft); font-weight: 700; font-size: 0.85rem; align-self: center; }
.uf-summary .line span { min-width: 0; }
.uf-summary .line--total b { font-size: 1.5rem; }
.uf-summary__note { font-size: 0.9rem; }

/* the details form and its answer */
.uf-details form { display: grid; gap: var(--s2); }
.uf-details .btn[disabled] { opacity: 0.7; }
.uf-sent { font-size: 1rem; }
.uf-sent strong { font-family: var(--font-display); font-size: 1.15rem; }

/* ---------- the routers compared ---------- */
.uf-table-wrap { max-width: 960px; margin: 0 auto; overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--shadow-soft); background: var(--white); }
.uf-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.97rem; }
.uf-table th, .uf-table td { padding: 0.85rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--lilac-soft); }
.uf-table thead th { background: var(--uf-deep); color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.uf-table tbody th { color: var(--ink); font-weight: 650; width: 24%; }
.uf-table td { color: var(--ink-soft); }
.uf-table tr:last-child th, .uf-table tr:last-child td { border-bottom: 0; }
.uf-table tr:last-child td { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--violet-deep); }

/* ---------- smaller screens ---------- */
@media (max-width: 1020px) {
  .uf-build { grid-template-columns: minmax(0, 1fr); }
  .uf-build__main, .uf-summary, .uf-details { grid-column: 1; grid-row: auto; }
  .uf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uf-points { gap: var(--s3); }
}

@media (max-width: 860px) {
  .uf-hero { padding-top: var(--s3); }
  .uf-hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .uf-hero__art { max-width: 560px; }
  .uf-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s3); }
  .uf-specs li { padding: var(--s2) 0; border-left: 0; }
  .uf-specs li:nth-child(even) { padding-left: var(--s2); border-left: 1px solid var(--uf-rule); }
  .uf-specs li:nth-child(n+3) { border-top: 1px solid var(--uf-rule); }
  .uf-dark { padding-block: var(--s3); } /* a section's room on phones and tablets, as everywhere since poc-0.27.2 */
  .uf-fine { margin-top: var(--s3); }
  .uf-mesh { margin-bottom: var(--s3); }
  .uf-points { grid-template-columns: minmax(0, 1fr); }
  .uf-routers { grid-template-columns: minmax(0, 1fr); }
  /* on a phone each router card puts its photo beside the words */
  .uf-router { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: none; column-gap: 0.9rem; row-gap: 0.25rem; align-items: start; }
  .uf-router__photo { grid-column: 1; grid-row: 1 / span 4; height: 96px; margin: 0; }
  .uf-router__photo img { height: 88px; }
  .uf-router > :not(.uf-router__photo):not(input) { grid-column: 2; }
  /* room for the estimate bar at the bottom of the page, and the WhatsApp button steps aside while the bar shows */
  main.page-unifi ~ .site-footer { padding-bottom: calc(var(--s4) + 4.75rem); }
  body.uf-bar-on .wa-float { opacity: 0; transform: translateY(16px); pointer-events: none; }
}

@media (max-width: 560px) {
  .uf-steps { grid-template-columns: minmax(0, 1fr); }
  /* on a phone the drawing shows the router and one satellite */
  .uf-mesh { grid-template-columns: minmax(0, 1.1fr) minmax(84px, 1fr) minmax(0, 1fr); margin-bottom: var(--s3); }
  .uf-mesh > :nth-child(1), .uf-mesh > :nth-child(2) { display: none; }
  .uf-mesh__unit img { height: 132px; max-width: 104px; }
  .uf-mesh__unit--main img { max-width: 132px; }
  .uf-mesh__link { margin-top: calc(66px - 1.05rem); }
  .uf-mesh__unit b { font-size: 0.95rem; }
  .uf-mesh__unit span { font-size: 0.8rem; }
  .uf-sat { grid-template-columns: 64px minmax(0, 1fr); row-gap: 0.6rem; padding: 0.85rem 0.95rem; }
  .uf-sat__photo { width: 64px; height: 48px; }
  .uf-sat .stepper { grid-column: 1 / -1; }
  .uf-photo { padding: var(--s2); }
  /* the routers compared: each feature becomes a heading over its three answers, so nothing scrolls sideways */
  .uf-table { min-width: 0; font-size: 0.92rem; }
  .uf-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .uf-table tbody tr { border-bottom: 1px solid var(--lilac-soft); }
  .uf-table tbody tr:last-child { border-bottom: 0; }
  .uf-table th, .uf-table td { border-bottom: 0; padding: 0.2rem 0.75rem 0.75rem; }
  .uf-table thead th { padding: 0.75rem; font-size: 0.92rem; line-height: 1.25; }
  .uf-table thead th:first-child { display: none; }
  .uf-table tbody th { grid-column: 1 / -1; width: auto; padding: 0.75rem 0.75rem 0.15rem; font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet); }
}
