/* ============================================================
   B2 Sistemas — Seção 03 · App B2 Gestor (partials/gestor.html)
   Painel destacado + mockup de celular 100% CSS
   ============================================================ */

.gestor {
  position: relative;
  padding-block: calc(var(--section-pad) * 0.5);
  overflow: clip;
}

/* ---------- Painel-atmosfera ---------- */

.gestor-panel {
  position: relative;
  isolation: isolate;
  background: linear-gradient(170deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: clip;
  padding: clamp(48px, 7vh, 84px) clamp(28px, 5.5vw, 84px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow-card);
}

/* Grid técnico mascarado atrás do celular */
.gestor-grid {
  z-index: 0;
  opacity: 0.85;
  -webkit-mask-image: radial-gradient(ellipse 72% 92% at 74% 42%, black 22%, transparent 74%);
  mask-image: radial-gradient(ellipse 72% 92% at 74% 42%, black 22%, transparent 74%);
}

/* Único glow da seção, atrás do celular */
.gestor-glow {
  z-index: 0;
  top: 4%;
  right: -150px;
  width: 620px;
  height: 620px;
  opacity: 0.48;
}

/* ---------- Layout 2 colunas ---------- */

.gestor-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(44px, 6vw, 88px);
  align-items: center;
}

/* ---------- Coluna de texto ---------- */

.gestor-copy {
  min-width: 0;
}

.gestor-copy h2 {
  margin-top: 18px;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.03em;
}

.gestor-lead {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 1.06rem;
  max-width: 52ch;
}

/* Módulos oficiais */

.gestor-modules {
  list-style: none;
  margin: clamp(30px, 4.5vh, 44px) 0 0;
  padding: 0;
}

.gestor-module {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-block: 18px;
}

.gestor-module + .gestor-module {
  border-top: 1px solid var(--line);
}

.gestor-module-chip {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: rgba(252, 157, 19, 0.08);
  border: 1px solid var(--line-brand);
  color: var(--brand-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gestor-module-chip svg {
  width: 23px;
  height: 23px;
}

.gestor-module-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* "QR" em Schibsted: o Q display da Bricolage tem cauda horizontal
   que aparenta sublinhado (parece link) — aqui não. */
.gestor .gestor-qr {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gestor-module-body p {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* CTA + nota técnica */

.gestor-cta {
  margin-top: clamp(30px, 4.5vh, 42px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.gestor-cta-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 24ch;
}

.gestor-cta-note::before {
  content: "// ";
  color: var(--brand);
}

/* ---------- Coluna do mockup ---------- */

.gestor-visual {
  position: relative;
  min-width: 0;
  display: flex;
  justify-content: center;
  /* invade levemente o padding do painel (composição controlada) */
  margin-block: clamp(-36px, -3vh, 0px);
  margin-right: clamp(-40px, -2.5vw, 0px);
}

.gestor-scene {
  position: relative;
  width: 300px;
}

.gestor-rotor {
  transform: rotate(-4deg);
}

.gestor-float {
  animation: gestor-bob 6s ease-in-out infinite;
  will-change: transform;
}

@keyframes gestor-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}

/* ----- Frame do celular ----- */

.gestor-phone {
  position: relative;
  width: 300px;
  height: 620px;
  padding: 10px;
  border-radius: 44px;
  background: linear-gradient(155deg, var(--bg-3) 0%, var(--bg-1) 45%, var(--bg-3) 100%);
  border: 1px solid var(--line-strong);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.09),
    inset 0 -1px 1px rgba(0, 0, 0, 0.55),
    var(--shadow-pop);
}

/* Botões físicos laterais */
.gestor-phone-btn {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gestor-phone-btn-power { right: -4px; top: 150px; height: 68px; }
.gestor-phone-btn-vol-a { left: -4px; top: 118px; height: 40px; }
.gestor-phone-btn-vol-b { left: -4px; top: 166px; height: 40px; }

/* ----- Tela ----- */

.gestor-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 34px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  overflow: hidden;
}

/* luz ambiente no topo da tela */
.gestor-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(252, 157, 19, 0.07), transparent 60%);
  pointer-events: none;
}

/* reflexo de vidro */
.gestor-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 26%);
  pointer-events: none;
}

/* Dynamic island */
.gestor .ph-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 86px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 7px;
}

.gestor .ph-lens {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.9) 62%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Status bar */
.gestor .ph-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 24px 0;
  color: var(--ink-1);
}

.gestor .ph-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.gestor .ph-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gestor .ph-status-icons svg {
  display: block;
  height: 11px;
}

.gestor .ph-status-icons svg:nth-child(1) { width: 15px; }
.gestor .ph-status-icons svg:nth-child(2) { width: 14px; }
.gestor .ph-status-icons svg:nth-child(3) { width: 23px; }

/* Header do app */
.gestor .ph-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px 0;
}

.gestor .ph-id { min-width: 0; }

.gestor .ph-hello {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-2);
}

.gestor .ph-app {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink-1);
}

.gestor .ph-app-2 { color: var(--brand); }

.gestor .ph-bell {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.gestor .ph-bell svg {
  width: 16px;
  height: 16px;
}

.gestor .ph-bell-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg-0);
}

/* Card de destaque (gradiente da marca, texto escuro) */
.gestor .ph-hero {
  position: relative;
  margin: 15px 22px 0;
  padding: 13px 15px 11px;
  border-radius: 17px;
  background: var(--grad-brand);
  color: #1A1000;
  box-shadow: 0 12px 26px -12px rgba(252, 157, 19, 0.5);
  overflow: hidden;
}

.gestor .ph-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 90% at 100% 0%, rgba(255, 255, 255, 0.26), transparent 55%);
  pointer-events: none;
}

.gestor .ph-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  line-height: 1;
  opacity: 0.82;
}

.gestor .ph-hero-top svg {
  width: 13px;
  height: 13px;
}

.gestor .ph-hero-main {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 7px;
}

.gestor .ph-hero-num {
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.gestor .ph-hero-caption {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

.gestor .ph-hero-meta {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid rgba(26, 16, 0, 0.18);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  opacity: 0.78;
}

/* Grade 2x2 de módulos */
.gestor .ph-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 14px 22px 0;
}

.gestor .ph-mod {
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gestor .ph-mod.is-hot {
  border-color: var(--line-brand);
  background:
    linear-gradient(180deg, rgba(252, 157, 19, 0.1), rgba(252, 157, 19, 0.03)),
    var(--bg-2);
}

.gestor .ph-mod svg {
  width: 17px;
  height: 17px;
  color: var(--brand-2);
}

.gestor .ph-mod-name {
  display: block;
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--ink-1);
}

.gestor .ph-mod-meta {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  line-height: 1.3;
  color: var(--ink-3);
}

/* Notificações */
.gestor .ph-notifs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 15px 22px 0;
}

.gestor .ph-notifs-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.gestor .ph-notifs-head span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.gestor .ph-notifs-head b {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-2);
}

.gestor .ph-notif {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 8px;
  padding: 9px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.gestor .ph-notif-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--ink-3);
}

.gestor .ph-notif-dot.is-live {
  background: var(--brand-2);
  box-shadow: 0 0 9px 1px rgba(252, 157, 19, 0.65);
}

.gestor .ph-notif-body {
  min-width: 0;
  display: block;
}

.gestor .ph-notif-body strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-1);
}

.gestor .ph-notif-body span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gestor .ph-when {
  flex: none;
  margin-left: auto;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

/* Tab bar */
.gestor .ph-tabbar {
  position: relative;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 9px 30px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}

.gestor .ph-tab {
  width: 40px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}

.gestor .ph-tab svg {
  width: 18px;
  height: 18px;
}

.gestor .ph-tab.is-active {
  position: relative;
  color: var(--brand-2);
}

.gestor .ph-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

.gestor .ph-fab {
  width: 46px;
  height: 46px;
  margin-top: -26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #1A1000;
  border: 5px solid var(--bg-0);
  box-shadow: 0 10px 22px -8px rgba(252, 157, 19, 0.55);
}

.gestor .ph-fab svg {
  width: 19px;
  height: 19px;
}

/* Home indicator */
.gestor .ph-tabbar::after {
  content: "";
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 4px;
  border-radius: 999px;
  background: rgba(247, 242, 231, 0.24);
}

/* ----- Chip satélite (fora do frame) ----- */

.gestor-toast {
  position: absolute;
  top: 33.5%;
  right: -56px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 9px;
  border-radius: 999px;
  background: rgba(26, 22, 13, 0.82);
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-brand);
  box-shadow: var(--shadow-card), 0 0 30px -8px rgba(252, 157, 19, 0.25);
  animation: gestor-bob 6s ease-in-out -3s infinite;
  will-change: transform;
}

.gestor-toast-icon {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #1A1000;
  box-shadow: 0 6px 14px -6px rgba(252, 157, 19, 0.6);
}

.gestor-toast-icon svg {
  width: 13px;
  height: 13px;
}

.gestor-toast-body {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  white-space: nowrap;
}

.gestor-toast-body strong {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-1);
}

.gestor-toast-body span {
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ============================================================
   Responsivo
   ============================================================ */

@media (max-width: 1080px) {
  .gestor-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
  }

  .gestor-copy { max-width: 640px; }

  .gestor-visual {
    margin: 0;
    justify-content: center;
  }

  .gestor-rotor { transform: rotate(-2deg); }

  .gestor-panel {
    padding: clamp(44px, 7vw, 64px) clamp(24px, 5vw, 56px) 68px;
  }

  .gestor-glow {
    top: auto;
    right: auto;
    bottom: -140px;
    left: 50%;
    transform: translateX(-50%);
  }

  .gestor-grid {
    -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 82%, black 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 55% at 50% 82%, black 25%, transparent 75%);
  }
}

@media (max-width: 760px) {
  .gestor-panel {
    padding: 40px 18px 48px;
  }

  /* Frame ~260px: escala preservando a composição interna */
  .gestor-scene {
    transform: scale(0.867);
    transform-origin: top center;
    margin-bottom: -82px;
  }

  .gestor-rotor { transform: rotate(-1.5deg); }

  .gestor-toast {
    right: -14px;
  }

  .gestor-module {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 13px;
  }

  .gestor-module-chip {
    width: 40px;
    height: 40px;
  }

  .gestor-module-chip svg {
    width: 21px;
    height: 21px;
  }
}

@media (max-width: 400px) {
  .gestor-scene {
    transform: scale(0.8);
    margin-bottom: -124px;
  }
}

/* ---------- Motion safety ---------- */

@media (prefers-reduced-motion: reduce) {
  .gestor-float,
  .gestor-toast {
    animation: none;
  }
}
