/* =========================================
   Telecom · Tour SOC – styles.css (v5 Final)
   ========================================= */

@font-face {
  font-family: "Pulso";
  src: url("assets/fonts/Pulso-Regular.woff2") format("woff2"),
       url("assets/fonts/Pulso-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pulso";
  src: url("assets/fonts/Pulso-Light.woff2") format("woff2"),
       url("assets/fonts/Pulso-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root{
  --violeta-telecom: #3C009F;
  --violeta-700: #281E5A;
  --violeta-900: #140232;
  --violeta-500: #39129A;
  --violeta-acento: #B989F9;
  --blanco-digital: #F5F5F5;
  --negro-true: #000000;
  --text-primary: #0F172A;
  --text-on-violet: #FFFFFF;
  --surface: #0b1020;
  --btn-primary-bg: var(--violeta-telecom);
  --btn-primary-fg: #FFFFFF;
  --btn-ghost-fg: #E2E8F0;
  --chip-bg: rgba(255,255,255,.10);
  --card-bg: #FFFFFF;
  --card-fg: #0F172A;
  --card-shadow: 0 12px 28px rgba(0,0,0,.25);
  --hero-from: var(--violeta-900);
  --hero-to: var(--violeta-700);
  --violeta-hover: #2F007E;
  --violeta-active: #260067;
  --focus-ring: rgba(185,137,249,.55);
  --violeta-outline: rgba(60, 0, 159, .55);
  --violeta-glow: rgba(60, 0, 159, .08);
  --header-h: 64px;
  --footer-h: 28px;
  --window-lift: -32vh;
  --under-height: 36vh;
}

* { box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0 !important;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--blanco-digital);
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to)) fixed;
  overflow: hidden;
}

img{ max-width: 100%; display: block; }

.app-header{
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 18px;
  height: var(--header-h); min-height: var(--header-h);
  background: rgba(20, 2, 50, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-on-violet);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand{ display: flex; align-items: center; gap: 10px; }
.brand img{ height: 18px; }
.brand span{
  font-family: "Pulso", Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: .2px;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.controls{ display: flex; align-items: center; gap: 10px; }
.ctrl-group{ display:flex; align-items:center; gap:8px; }
.ctrl-label{ font-size:.9rem; opacity:.9; }

button, input[type="button"], input[type="submit"]{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: none !important;
  background-image: none !important;
  border: 0;
  font: inherit;
  color: inherit;
}
button::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner{ border:0; padding:0; }

button.ghost{
  color: var(--btn-ghost-fg);
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.04);
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
button.small{ padding: 6px 10px; font-size:.9rem; }
button.tiny { padding: 4px 8px;  font-size:.8rem; }

.primary {
  background-color: var(--violeta-telecom) !important;
  color: #fff !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: background-color .15s ease, transform .02s ease, box-shadow .15s ease !important;
}
.primary:hover { background-color: var(--violeta-hover) !important; }
.primary:active {
  background-color: var(--violeta-active) !important; transform: translateY(1px);
}
.primary:disabled { opacity:.6 !important; cursor:not-allowed !important; }
.primary:focus-visible {
  outline:0; box-shadow:0 0 0 3px var(--focus-ring) !important;
}

.progress-container{
  position: relative; width: 180px; height: 10px; border-radius:999px;
  background: rgba(255,255,255,.18); overflow: hidden;
}
.progress-bar{
  position:absolute; inset:0 100% 0 0; background: var(--violeta-acento);
  transition: width .25s ease; border-radius: 999px;
}

.stage{
  position: fixed;
  left: 0; right: 0;
  top: var(--header-h);
  bottom: var(--footer-h);
  padding: 8px 18px 20px;
  display: grid; place-items: center;
  background: transparent;
  overflow: hidden;
}
.desktop{
  width: min(1280px, 96vw);
  height: 100%;
  margin-inline: auto;
  overflow: hidden;
}

.under-screen{
  height: var(--under-height);
  overflow: hidden;
}
.under-screen img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity:.28; filter: blur(2px) saturate(.9);
  border-radius: 18px;
}

.window{
  position: relative;
  margin-top: var(--window-lift);
  background: #0d0d17;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 10px 22px rgba(0,0,0,.3);
  border-radius: 18px; overflow: hidden;
}
.chrome{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:10px 12px;
  background: linear-gradient(180deg, #111827, #0f172a);
  color:#cbd5e1; border-bottom: 1px solid rgba(255,255,255,.08);
}
.traffic{ display:flex; gap:6px; }
.dot{ width:12px; height:12px; border-radius:999px; display:inline-block; }
.dot.red{ background:#ff5f56; }
.dot.yellow{ background:#ffbd2e; }
.dot.green{ background:#27c93f; }

.omnibox{
  flex:1; margin:0 10px; padding:8px 12px; border-radius:999px;
  background: rgba(255,255,255,.10);
  color: var(--blanco-digital);
  display:flex; align-items:center; gap:8px;
}
.omnibox .url{ opacity:.85; font-size:.95rem; }

.screen{ position: relative; }
.image-wrap{
  position: relative; overflow: hidden;
  background: #0b0f1b; border-radius: 0 0 18px 18px;
}
.stage-image{
  width: 100%; height: auto; display: block;
  transform-origin: top left;
  image-rendering: auto;
}
body.sharp .stage-image{
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.vignette{
  pointer-events:none;
  position:absolute; inset:0;
  background: radial-gradient(120% 85% at 50% 10%, rgba(0,0,0,0) 55%, rgba(0,0,0,.28));
}

.hotspot{
  position:absolute; width:24px; height:24px; border-radius:999px;
  background: var(--violeta-telecom);
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 16px rgba(0,0,0,.25),
    0 0 0 3px var(--violeta-glow);
  transform: translate(-50%, -50%); pointer-events:none;
}
.hotspot::before{
  content:""; position:absolute; inset:-5px; border-radius:999px;
  border: 2px solid var(--violeta-outline);
}
.hotspot::after{
  content:""; position:absolute; inset:-8px; border-radius:999px;
  border:2px solid rgba(185,137,249,.45);
  opacity:.9; animation: ping 1.6s ease-out infinite;
}
@keyframes ping{ 0%{ transform:scale(1); opacity:.9 } 100%{ transform:scale(1.8); opacity:0 } }

.tooltip{
  position: absolute;
  max-width: min(520px, 78vw);
  background: var(--card-bg);
  color: var(--card-fg);
  border: 1.5px solid var(--violeta-outline);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18),
    0 0 0 4px var(--violeta-glow);
  padding: 16px;
  transform: translate(-10%, -10%);
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  gap: 12px;
  animation: tooltipFadeIn .3s ease-out both;
}

.tooltip-header{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.tooltip-header h2{
  margin:0;
  font-family:"Pulso", Roboto, sans-serif;
  font-weight:400;
  color: var(--violeta-telecom);
}
.tooltip .counter{ color:#6b7280; font-weight:600; }

.tooltip .tooltip-body{
  margin: 0;
  color:#111827;
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.tooltip .tooltip-body p{ margin:.5rem 0 1rem; }

.tooltip-actions{
  display:flex; justify-content:flex-end; gap:10px;
  position: relative; z-index: 2;
}

.zoom-controls{
  position: absolute; left: 50%; bottom: 10px;
  transform: translateX(-50%);
  display:flex; gap:8px; align-items:center; z-index: 15;
  pointer-events: auto;
}
.zoom-readout{ color: var(--blanco-digital); font-weight: 600; }

.app-footer{
  height: var(--footer-h); min-height: var(--footer-h);
  display:flex; align-items:center; justify-content:center;
  padding: 0 16px; text-align: center; color:#94a3b8; font-size:.9rem;
}

#stage:focus{ outline: 2px solid var(--violeta-acento); outline-offset: 2px; }

.loader{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.22); color:#e5e7eb; gap:10px; z-index:10;
}
.loader.hidden{ display:none; }
.spinner{
  width:18px; height:18px; border:3px solid rgba(255,255,255,.3); border-top-color:#fff;
  border-radius:50%; animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: var(--blanco-digital);
}
.splash-card{
  width: min(720px, 92vw);
  background: rgba(13,13,23,.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 28px 22px 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
  text-align: center;
}
.splash-brand img{ height: 28px; margin-bottom: 10px; }
.splash h1{ margin: 6px 0 8px; font-family: "Pulso", Roboto, sans-serif; font-weight: 400; }
.splash p{ margin: 0 0 16px; color: #cbd5e1; }

.splash-progress{ display: grid; gap: 8px; margin: 8px 0 14px; }
.splash-bar{ height: 10px; background: rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.splash-bar span{ display:block; height:100%; background: var(--violeta-acento); transition: width .25s ease; }
.splash-meta{ display:flex; justify-content: space-between; font-weight: 600; color:#e2e8f0; }

.splash-cta{ display:flex; gap:10px; justify-content:center; }
#splashStart:not(:disabled){
  animation: pulse-glow 2.2s infinite ease-out;
}
.splash.hidden{ display:none; }

dialog{ border:0; border-radius: 12px; padding: 18px; }
dialog::backdrop{ background: rgba(0,0,0,.45); }

@media (max-height: 800px){
  :root{ --window-lift: -28vh; --under-height: 34vh; }
}
@media (max-height: 700px){
  :root{ --window-lift: -24vh; --under-height: 32vh; }
}
@media (max-height: 640px){
  .under-screen{ display: none; }
  :root{ --window-lift: -6vh; }
}

.tooltip.is-modal{
  max-width: min(640px, 86vw);
  padding: 20px 22px;
  transform: translate(-50%, -50%) !important;
  text-align: left;
  z-index: 20;
}

.image-wrap.modal-open::after{
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 50%, rgba(0,0,0,.18), rgba(0,0,0,.38));
  pointer-events: none;
  z-index: 10;
}

.tooltip .callout{
  display: block;
  background: var(--violeta-telecom);
  color: #fff;
  font-weight: 700;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  text-align: left;
  line-height: 1.4;
  font-size: 1.02rem;
  letter-spacing: .2px;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}
@media (max-width: 480px){
  .tooltip .callout{
    font-size: 1rem;
    padding: 12px 14px;
  }
}

.tooltip .callout-quote{
  position: relative;
  display: block;
  margin: 0 auto;
  max-width: 92%;
  padding: 14px 16px 14px 18px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(60,0,159,.06), rgba(60,0,159,.03));
  border: 1px solid rgba(60,0,159,.22);
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 600;
  z-index: 0;
  overflow-wrap: anywhere;
  animation: calloutIn .28s ease both .04s;
}
.tooltip .callout-quote::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, var(--violeta-telecom), #6c2bd9);
}

.tooltip .callout-quote.callout-compact{
  padding: 10px 14px;
  font-size: 1rem;
  line-height: 1.35;
  margin-top: 10px;
  max-width: 100%;
  font-weight: 600;
}
.tooltip .callout-quote.callout-compact::before{ width: 4px; }
.tooltip .callout-quote.callout-compact[data-badge]::after{ display:none !important; }

@keyframes calloutIn{
  from{ transform: translateY(6px); opacity: 0; }
  to  { transform: translateY(0);   opacity: 1; }
}

@media (max-width: 480px){
  .tooltip .callout-quote{ padding: 12px 14px; font-size: 1rem; }
  .tooltip .callout-quote.callout-compact{
    padding: 9px 12px; font-size: .98rem; line-height: 1.32;
  }
}

.splash-support {
  margin-top: 24px;
}
.splash-support a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--violeta-acento);
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.splash-support a:hover,
.splash-support a:focus-visible {
  opacity: 1;
  color: #fff;
  text-decoration: underline;
}
.splash-support svg {
  width: 18px;
  height: 18px;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(185, 137, 249, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(185, 137, 249, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 137, 249, 0); }
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) translate(-10%, -10%);
  }
  to {
    opacity: 1;
    transform: translateY(0) translate(-10%, -10%);
  }
}
.tooltip.is-modal {
  animation: tooltipFadeInModal .3s ease-out both;
}
@keyframes tooltipFadeInModal {
  from {
    opacity: 0;
    transform: translateY(10px) translate(-50%, -50%);
  }
  to {
    opacity: 1;
    transform: translateY(0) translate(-50%, -50%);
  }
}

/* --- ESTILO PARA LA NOTA DE PANTALLA COMPLETA --- */
.fullscreen-hint {
  display: block;
  text-align: center;
  color: #999;
  font-size: 0.8rem;
  margin-top: 15px;
  margin-bottom: 20px;
  opacity: 0.8;
}

/* --- ESTILOS PARA DIÁLOGO DE AYUDA --- */
dialog h4 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}
dialog .help-recommendation,
dialog .help-zoom-info {
  background-color: rgba(60, 0, 159, .08);
  border: 1px solid rgba(60, 0, 159, .15);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1em;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #374151;
}
dialog .help-recommendation {
  margin-top: -5px;
}
dialog kbd {
  background-color: #e5e7eb;
  color: #374151;
  padding: 2px 6px;
  border-radius: 4px;
  border-bottom: 2px solid #d1d5db;
  font-size: 0.85em;
  font-family: inherit;
  font-weight: 600;
}

/* =====================================
   REGLAS PARA RESPONSIVE DESIGN
   ===================================== */
@media (max-width: 768px) {
  .ctrl-group, #btnHelp, .progress-container, #btnRestart {
    display: none;
  }
  .brand span {
    display: none;
  }
  .stage {
    padding: 8px;
  }
  .desktop {
    width: 100%;
  }
  .window {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .image-wrap {
    flex-grow: 1;
    border-radius: 0 0 12px 12px;
    position: relative;
    min-height: 0;
  }
  .screen, .stage-image {
    height: 100%;
  }
  .stage-image {
    object-fit: contain;
  }
  .under-screen {
    display: none;
  }
  .tooltip {
    max-width: 90vw;
    padding: 14px;
  }
  .tooltip-header h2 {
    font-size: 1.1rem;
  }
  .zoom-controls {
    bottom: 8px;
  }
  .app-footer small {
    font-size: 0.8rem;
  }
}