/* ==========================================================================
   MasterLabs — css/dispositivos.css
   Marcos de dispositivo dibujados en CSS (sin imágenes de marca):
   tablet Android, teléfono Android, MacBook y monitor con Windows.
   Todo escala con el ancho del dispositivo (unidades cqw), así que basta con
   darle un ancho al contenedor .dv. Cada pantalla puede tener varios estados
   (.dv-state) que se alternan con una transición suave (js/dispositivos.js).
   ========================================================================== */

.dv {
  --rim: #5d636c;          /* canto metálico */
  --rim-hi: #9aa0a8;
  --bezel: #07080a;
  --app-bg: #0f1217;       /* fondo de la app Airnode */
  --app-nav: #1a1e27;      /* barra inferior de la app */
  --dv-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  container-type: inline-size;
  width: 100%;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Pantalla y estados ------------------------------------------------------ */

.dv-screen {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  background: var(--bezel);
  isolation: isolate;
}
.dv-state {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.035);
  filter: blur(8px);
  transition: opacity 0.9s var(--dv-ease), transform 1.3s var(--dv-ease), filter 0.9s var(--dv-ease);
  will-change: opacity, transform;
}
.dv-state.is-on { opacity: 1; transform: none; filter: none; }
.dv-state img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.dv-fill { display: flex; flex-direction: column; background: var(--app-bg); }
.dv-fill > .dv-crop { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.dv-fill > .dv-crop > img { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: top center; }

/* Reflejo sutil sobre el vidrio */
.dv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 42%);
}

/* Barra de estado de Android (se dibuja cuando la captura no la trae) */
.dv-sb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  color: #eceef1;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--sb-bg, var(--app-bg));
}
.dv-sb__r { display: inline-flex; align-items: center; gap: 0.35em; }
.dv-sb svg { height: 1em; width: auto; fill: currentColor; }
.dv-sb .bat { display: inline-grid; place-items: center; height: 1.05em; padding: 0 0.35em; border: 0.1em solid currentColor; border-radius: 0.3em; font-size: 0.8em; line-height: 1; }

/* Barra de gestos */
.dv-gest { position: relative; flex: none; background: var(--gest-bg, var(--app-nav)); }
.dv-gest::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 22%;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%);
}

/* --- Tablet Android (16:10) --------------------------------------------------- */

.dv--tablet .dv-body {
  position: relative;
  padding: 2.1cqw;
  border-radius: 3.8cqw;
  background: var(--bezel);
  box-shadow:
    0 0 0 0.28cqw var(--rim),
    0 0 0 0.42cqw #2a2e34,
    inset 0 0 0 0.12cqw rgba(255, 255, 255, 0.06);
}
.dv--tablet .dv-body::before { /* cámara frontal en el canto largo */
  content: "";
  position: absolute;
  top: 0.72cqw;
  left: 50%;
  width: 0.62cqw;
  height: 0.62cqw;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 35%, #3a4660 0 18%, #10141c 40%);
  box-shadow: 0 0 0 0.08cqw #1b1f27;
}
.dv--tablet .dv-body::after { /* botón de encendido */
  content: "";
  position: absolute;
  top: -0.62cqw;
  left: 8%;
  width: 5%;
  height: 0.3cqw;
  border-radius: 0.3cqw 0.3cqw 0 0;
  background: linear-gradient(var(--rim-hi), var(--rim));
}
.dv--tablet .dv-screen { aspect-ratio: 16 / 10; border-radius: 1.5cqw; }
.dv--tablet .dv-sb { height: 3.4cqw; padding: 0 2.3cqw; font-size: 1.15cqw; --sb-bg: #0e1419; }
.dv--tablet .dv-gest { height: 2.2cqw; --gest-bg: #0f1418; }
.dv--tablet .dv-gest::before { width: 13%; height: 16%; }

/* --- Teléfono Android (20:9) -------------------------------------------------- */

.dv--phone .dv-body {
  position: relative;
  padding: 2.6cqw;
  border-radius: 14cqw;
  background: var(--bezel);
  box-shadow:
    0 0 0 0.9cqw var(--rim),
    0 0 0 1.3cqw #25292f,
    inset 0 0 0 0.35cqw rgba(255, 255, 255, 0.05);
}
.dv--phone .dv-body::before, .dv--phone .dv-body::after { /* volumen y encendido */
  content: "";
  position: absolute;
  right: -2.2cqw;
  width: 1.1cqw;
  border-radius: 0 0.8cqw 0.8cqw 0;
  background: linear-gradient(90deg, var(--rim), var(--rim-hi));
}
.dv--phone .dv-body::before { top: 20%; height: 15%; }
.dv--phone .dv-body::after { top: 39%; height: 8%; }
.dv--phone .dv-screen { aspect-ratio: 1220 / 2702; border-radius: 11.5cqw; }
.dv--phone .dv-sb { position: relative; height: 9cqw; padding: 0 8cqw 0 9cqw; font-size: 3.7cqw; --sb-bg: #0f1217; }
.dv--phone .dv-sb::after { /* cámara perforada */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.8cqw;
  height: 3.8cqw;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 36% 34%, #33405a 0 16%, #05070a 42%);
  box-shadow: 0 0 0 0.35cqw #000;
}
.dv--phone .dv-gest { height: 5cqw; }

/* --- MacBook ------------------------------------------------------------------ */

.dv--mac .dv-lid {
  position: relative;
  width: 89%;
  margin: 0 auto;
  padding: 1.5cqw 1.5cqw 2.3cqw;
  border-radius: 3cqw 3cqw 0.5cqw 0.5cqw;
  background: var(--bezel);
  box-shadow:
    0 0 0 0.26cqw #b7bbc2,
    0 0 0 0.36cqw #7b8088,
    inset 0 0 0 0.1cqw rgba(255, 255, 255, 0.08);
}
.dv--mac .dv-screen { aspect-ratio: 1.54; border-radius: 1.1cqw 1.1cqw 0 0; }
.dv--mac .dv-notch { /* dentro de .dv-screen: unidades relativas a la pantalla */
  position: absolute;
  z-index: 6;
  top: 0;
  left: 50%;
  width: 11.5cqw;
  height: 2.6cqw;
  transform: translateX(-50%);
  border-radius: 0 0 1cqw 1cqw;
  background: var(--bezel);
}
.dv--mac .dv-notch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  width: 0.9cqw;
  height: 0.9cqw;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 35%, #2c3850 0 20%, #0b0e14 45%);
}
.dv--mac .dv-base {
  position: relative;
  height: 2.3cqw;
  margin-top: -0.05cqw;
  border-radius: 0.3cqw 0.3cqw 1.8cqw 1.8cqw / 0.3cqw 0.3cqw 1.6cqw 1.6cqw;
  background:
    linear-gradient(180deg, #e9ebee 0%, #c9ccd1 30%, #9ea3aa 78%, #6e737a 100%);
  box-shadow: inset 0 0.12cqw 0 rgba(255, 255, 255, 0.9), 0 1.2cqw 2.4cqw -1cqw rgba(0, 0, 0, 0.5);
}
.dv--mac .dv-base::before { /* hendidura para abrir la tapa */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 13%;
  height: 0.9cqw;
  transform: translateX(-50%);
  border-radius: 0 0 1cqw 1cqw;
  background: linear-gradient(180deg, #9ba0a7, #c3c7cc);
}

/* Escritorio de macOS (genérico, sin marcas) */
.dv-desk { position: absolute; inset: 0; overflow: hidden; }
.dv-desk--mac {
  background:
    radial-gradient(60% 70% at 18% 88%, rgba(34, 211, 238, 0.55), transparent 60%),
    radial-gradient(55% 60% at 88% 12%, rgba(99, 102, 241, 0.6), transparent 62%),
    radial-gradient(70% 80% at 70% 90%, rgba(14, 116, 144, 0.7), transparent 65%),
    linear-gradient(160deg, #0b1a3a 0%, #102a4c 45%, #0a2b36 100%);
}
.dv-menubar {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto 0;
  height: 2.6cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.6cqw;
  font-size: 1.02cqw;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 18, 34, 0.35);
  backdrop-filter: blur(12px);
}
.dv-menubar b { font-weight: 700; margin-right: 1.3cqw; }
.dv-menubar__l span { margin-right: 1.3cqw; }
.dv-menubar__r { display: inline-flex; align-items: center; gap: 1.1cqw; }
.dv-menubar svg { height: 1.1cqw; width: auto; fill: currentColor; }
.dv-dock {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0.9cqw;
  display: flex;
  gap: 0.75cqw;
  padding: 0.6cqw;
  transform: translateX(-50%);
  border-radius: 1.5cqw;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 0.07cqw rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
}
.dv-dock i, .dv-task i {
  position: relative;
  display: block;
  width: 3.6cqw;
  height: 3.6cqw;
  border-radius: 0.95cqw;
  background: var(--c, #64748b);
  box-shadow: inset 0 -0.3cqw 0.6cqw rgba(0, 0, 0, 0.18), inset 0 0.15cqw 0 rgba(255, 255, 255, 0.35);
}
.dv-dock i.is-app, .dv-task i.is-app { background: url("../iconos-logos-web/airnode/icono-airnode-128.webp") center / cover no-repeat; box-shadow: 0 0.15cqw 0.4cqw rgba(0, 0, 0, 0.3); }
.dv-dock i.is-app::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.5cqw;
  width: 0.34cqw;
  height: 0.34cqw;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
}

/* Ventana de macOS con la app */
.dv-win {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 2.4cqw 5cqw -1cqw rgba(0, 0, 0, 0.6), 0 0 0 0.07cqw rgba(255, 255, 255, 0.14);
}
.dv-win--mac { left: 50%; top: 4.6cqw; width: 58cqw; transform: translateX(-50%); border-radius: 0.95cqw; }
.dv-win--mac > img.is-raw { width: calc(100% + 0.4cqw); margin: -0.2cqw; } /* recorta el borde del escritorio de la captura */
.dv-titlebar {
  display: flex;
  align-items: center;
  gap: 0.55cqw;
  height: 3.35cqw;
  padding: 0 1.15cqw;
  font-size: 1.28cqw;
  font-weight: 500;
  color: #d5d8dc;
  background: #24292b;
}
.dv-titlebar i { width: 1.05cqw; height: 1.05cqw; border-radius: 50%; background: #ff5f57; }
.dv-titlebar i:nth-child(2) { background: #febc2e; }
.dv-titlebar i:nth-child(3) { background: #28c840; margin-right: 1.1cqw; }
.dv-win--mac .dv-titlebar { height: calc(58cqw * 60 / 1766); font-size: calc(58cqw * 26 / 1766); padding: 0 calc(58cqw * 20 / 1766); gap: calc(58cqw * 16 / 1766); }
.dv-win--mac .dv-titlebar i { width: calc(58cqw * 26 / 1766); height: calc(58cqw * 26 / 1766); }
.dv-win--mac .dv-titlebar i:nth-child(3) { margin-right: calc(58cqw * 24 / 1766); }

/* --- Monitor con Windows ------------------------------------------------------ */

.dv--pc .dv-monitor {
  position: relative;
  padding: 1cqw 1cqw 2.6cqw;
  border-radius: 1.3cqw;
  background: linear-gradient(180deg, #16181c, #0b0c0e);
  box-shadow: 0 0 0 0.18cqw #34383f, inset 0 0 0 0.08cqw rgba(255, 255, 255, 0.07);
}
.dv--pc .dv-monitor::after { /* led */
  content: "";
  position: absolute;
  bottom: 1.1cqw;
  right: 3%;
  width: 0.4cqw;
  height: 0.4cqw;
  border-radius: 50%;
  background: #5bd1f0;
  box-shadow: 0 0 0.6cqw #5bd1f0;
}
.dv--pc .dv-screen { aspect-ratio: 16 / 9; border-radius: 0.35cqw; }
.dv--pc .dv-neck {
  width: 8.5%;
  height: 7.5cqw;
  margin: 0 auto;
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  background: linear-gradient(90deg, #5c626b, #b3b8bf 45%, #858b93 60%, #4d525a);
}
.dv--pc .dv-foot {
  width: 27%;
  height: 1.2cqw;
  margin: -0.1cqw auto 0;
  border-radius: 0.6cqw 0.6cqw 1.2cqw 1.2cqw;
  background: linear-gradient(180deg, #c8ccd2, #7d838b);
  box-shadow: 0 1.4cqw 2.2cqw -0.8cqw rgba(0, 0, 0, 0.55);
}
.dv-desk--win {
  background:
    radial-gradient(38% 55% at 50% 58%, rgba(125, 211, 252, 0.9), transparent 70%),
    radial-gradient(60% 75% at 45% 70%, rgba(37, 99, 235, 0.85), transparent 72%),
    radial-gradient(50% 60% at 70% 30%, rgba(56, 189, 248, 0.45), transparent 70%),
    linear-gradient(180deg, #0a1a3f 0%, #0c2a6b 55%, #0a1f52 100%);
}
.dv-task {
  position: absolute;
  z-index: 3;
  inset: auto 0 0 0;
  height: 3cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55cqw;
  background: rgba(22, 26, 36, 0.82);
  box-shadow: inset 0 0.07cqw 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}
.dv-task i { width: 1.9cqw; height: 1.9cqw; border-radius: 0.45cqw; }
.dv-task i.is-start { background: linear-gradient(135deg, #7dd3fc, #2563eb); border-radius: 0.5cqw; }
.dv-task i.is-app::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.45cqw;
  width: 0.8cqw;
  height: 0.2cqw;
  border-radius: 1cqw;
  transform: translateX(-50%);
  background: #60cdff;
}
.dv-task__search {
  display: inline-flex;
  align-items: center;
  width: 9cqw;
  height: 1.9cqw;
  padding: 0 0.7cqw;
  border-radius: 1cqw;
  font-size: 0.78cqw;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}
.dv-task__clock {
  position: absolute;
  right: 1.1cqw;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.9cqw;
  font-size: 0.78cqw;
  line-height: 1.25;
  text-align: right;
  color: rgba(255, 255, 255, 0.92);
}
.dv-task__clock svg { height: 1cqw; width: auto; fill: currentColor; }
.dv-win--win { left: 50%; top: 2.2cqw; width: 45cqw; transform: translateX(-50%); border-radius: 0.5cqw; }

/* Navegador genérico */
.dv-win--browser { left: 50%; top: 1.9cqw; width: 45.5cqw; transform: translateX(-50%); border-radius: 0.55cqw; background: #0b1016; }
.dv-browser__tabs {
  display: flex;
  align-items: flex-end;
  height: 2.1cqw;
  padding: 0 0.6cqw;
  background: #1f2126;
}
.dv-browser__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45cqw;
  width: 15cqw;
  height: 1.65cqw;
  padding: 0 0.7cqw;
  border-radius: 0.5cqw 0.5cqw 0 0;
  font-size: 0.75cqw;
  color: #e6e7ea;
  background: #2d3036;
  white-space: nowrap;
  overflow: hidden;
}
.dv-browser__tab img { width: 0.95cqw; height: 0.95cqw; border-radius: 0.25cqw; }
.dv-browser__ctl { margin-left: auto; display: flex; gap: 1.3cqw; align-self: center; padding-right: 0.4cqw; }
.dv-browser__ctl svg { width: 0.75cqw; height: 0.75cqw; fill: none; stroke: #c9ccd1; stroke-width: 1.4; }
.dv-browser__bar {
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  height: 2.1cqw;
  padding: 0 0.8cqw;
  background: #2d3036;
}
.dv-browser__bar svg { height: 0.9cqw; width: auto; fill: none; stroke: #b9bcc2; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dv-browser__url {
  flex: 1;
  display: flex;
  align-items: center;
  height: 1.45cqw;
  padding: 0 0.8cqw;
  border-radius: 1cqw;
  font-size: 0.78cqw;
  color: #e6e7ea;
  background: #1c1e22;
}
.dv-browser__url em { font-style: normal; color: #8b8f96; }
.dv-browser__page { position: relative; overflow: hidden; aspect-ratio: 1566 / 1600; }
.dv-browser__page img { position: absolute; top: calc(-73 / 1566 * 100%); left: calc(-520 / 1566 * 100%); width: calc(2086 / 1566 * 100%); max-width: none; }

/* --- Tarjetas flotantes (recortes de diálogos reales) ------------------------- */

.dv-card { position: relative; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.dv-card img { display: block; width: 100%; }
.dv-card--pin { border-radius: 7% / 10%; background: #1a1f26; }
.dv-card--pin img { width: calc(566 / 560 * 100%); max-width: none; margin-left: calc(-6 / 560 * 100%); } /* la captura trae 6 px de fondo a la izquierda */
/* «¿Aceptar estos 11 archivos?»: recorte del diálogo con su avatar */
.dv-card--accept {
  aspect-ratio: 950 / 1600;
  overflow: visible;
  box-shadow: none;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}
.dv-card--accept .dv-card__in {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 950 1600' preserveAspectRatio='none'%3E%3Crect x='0' y='87' width='950' height='1513' rx='52'/%3E%3Ccircle cx='475' cy='88' r='80'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 950 1600' preserveAspectRatio='none'%3E%3Crect x='0' y='87' width='950' height='1513' rx='52'/%3E%3Ccircle cx='475' cy='88' r='80'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.dv-card--accept img { position: absolute; top: 0; left: calc(-172 / 950 * 100%); width: calc(1237 / 950 * 100%); max-width: none; }

@media (prefers-reduced-motion: reduce) {
  .dv-state { transition: opacity 0.3s linear; transform: none; filter: none; }
}
