/* Proxy Guard — shell limpio estilo OmniRoute (grid + split) */
:root {
  --pg-bg: #f7f7f8;
  --pg-surface: #ffffff;
  --pg-text: #0f172a;
  --pg-muted: #64748b;
  --pg-border: #e5e7eb;
  --pg-accent: #e11d48;
  --pg-grad-a: #ec4899;
  --pg-grad-b: #a855f7;
  --pg-ring: #6366f1;
  --pg-radius: 14px;
  --pg-font: "Inter", system-ui, -apple-system, sans-serif;
  --pg-mono: "JetBrains Mono", ui-monospace, monospace;
  --pg-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
}

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

html, body {
  min-height: 100%;
  font-family: var(--pg-font);
  color: var(--pg-text);
  background-color: var(--pg-bg);
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.5;
}

a { color: var(--pg-muted); text-decoration: none; }
a:hover { color: var(--pg-text); }

.pg-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Login + acordeones debajo: no forzar altura viewport (evita hueco enorme) */
.pg-shell-login {
  min-height: auto;
}

.pg-shell-login .pg-pane {
  justify-content: flex-start;
  padding-top: clamp(1.5rem, 3.5vw, 2.5rem);
  padding-bottom: clamp(0.75rem, 2vw, 1.25rem);
}

@media (max-width: 900px) {
  .pg-shell { grid-template-columns: 1fr; }
}

.pg-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.pg-pane-left { max-width: 480px; width: 100%; margin: 0 auto; }
.pg-pane-right { max-width: 520px; width: 100%; margin: 0 auto; }

.pg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pg-text);
  text-decoration: none;
}

.pg-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--pg-accent), var(--pg-grad-b));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.28);
}

.pg-title {
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.45rem;
}

.pg-sub {
  color: var(--pg-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.pg-field { margin-bottom: 1rem; }
.pg-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.pg-input-wrap { position: relative; }
.pg-input-wrap .pg-input-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.pg-field input,
.pg-field textarea {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.9rem;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--pg-text);
}

.pg-field textarea {
  min-height: 110px;
  resize: vertical;
  padding-right: 0.9rem;
  font-family: var(--pg-mono);
  font-size: 0.8rem;
}

.pg-field input:focus,
.pg-field textarea:focus {
  outline: none;
  border-color: var(--pg-ring);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.pg-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0.45rem 0 1.15rem;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.8rem 1.1rem;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, var(--pg-grad-a), var(--pg-grad-b));
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}

.pg-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(168, 85, 247, 0.34); }
.pg-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }

.pg-btn-ghost {
  background: #fff;
  color: var(--pg-text);
  border: 1px solid var(--pg-border);
  box-shadow: none;
  font-weight: 600;
}

.pg-btn-ghost:hover { box-shadow: var(--pg-shadow); }

.pg-link-row {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--pg-muted);
}

.pg-right-title {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}

.pg-right-lead {
  color: var(--pg-muted);
  font-size: 0.92rem;
  margin-bottom: 1.35rem;
  max-width: 42ch;
}

.pg-cards { display: flex; flex-direction: column; gap: 0.75rem; }

.pg-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  padding: 0.95rem 1rem;
  box-shadow: var(--pg-shadow);
  backdrop-filter: blur(6px);
}

.pg-card-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(236, 72, 153, 0.1);
  color: var(--pg-grad-a);
  font-size: 1rem;
}

.pg-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.pg-card p {
  font-size: 0.8rem;
  color: var(--pg-muted);
  line-height: 1.45;
}

/* App chrome */
.pg-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem clamp(1rem, 3vw, 1.75rem);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--pg-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.pg-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.pg-tabs button {
  border: 1px solid var(--pg-border);
  background: #fff;
  color: var(--pg-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.pg-tabs button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(90deg, var(--pg-grad-a), var(--pg-grad-b));
}

.pg-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 1.25rem;
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem) 2rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .pg-main { grid-template-columns: 1fr; }
}

.pg-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--pg-border);
  border-radius: 16px;
  box-shadow: var(--pg-shadow);
  padding: 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.pg-panel h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pg-panel .sub {
  font-size: 0.84rem;
  color: var(--pg-muted);
  margin-bottom: 1rem;
}

.pg-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0; }
.pg-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #7e22ce;
}

.pg-meta { font-size: 0.8rem; color: var(--pg-muted); margin-top: 0.65rem; }

.pg-out {
  margin-top: 0.85rem;
  padding: 0.85rem;
  background: #fafafa;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  font-family: var(--pg-mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
  min-height: 72px;
}

/* Chat */
.pg-chat {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  height: calc(100vh - 7.5rem);
  max-height: 760px;
}

.pg-chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0.15rem 0.85rem;
}

.pg-bubble {
  max-width: 92%;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  border: 1px solid var(--pg-border);
  background: #fff;
}

.pg-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
  border-color: #f5d0fe;
}

.pg-bubble.assistant {
  align-self: flex-start;
  background: #fff;
}

.pg-bubble .label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a855f7;
  margin-bottom: 0.3rem;
}

.pg-bubble.user .label { color: #db2777; }

.pg-bubble pre {
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-radius: 8px;
  font-family: var(--pg-mono);
  font-size: 0.74rem;
  white-space: pre-wrap;
  color: #334155;
}

.pg-chat-compose {
  display: flex;
  gap: 0.55rem;
  align-items: flex-end;
  border-top: 1px solid var(--pg-border);
  padding-top: 0.85rem;
  margin-top: auto;
}

.pg-chat-compose textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
}

.pg-chat-compose textarea:focus {
  outline: none;
  border-color: var(--pg-ring);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pg-chat-compose .pg-btn {
  width: auto;
  min-width: 110px;
  padding: 0.7rem 1rem;
}

.pg-empty-chat {
  margin: auto;
  text-align: center;
  color: var(--pg-muted);
  font-size: 0.9rem;
  max-width: 28ch;
  padding: 2rem 1rem;
}

/* Accordion — ver más / cómo funciona */
.pg-more {
  max-width: 1100px;
  margin: 0.35rem auto 0;
  padding: 0 1.25rem 1.75rem;
}

.pg-accordion {
  border: 1px solid var(--pg-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--pg-shadow);
  overflow: hidden;
}

.pg-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pg-text);
  cursor: pointer;
  text-align: left;
}

.pg-accordion-toggle:hover { background: #fafafa; }

.pg-accordion-toggle .chev {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--pg-border);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--pg-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.pg-accordion.open .pg-accordion-toggle .chev { transform: rotate(180deg); }

.pg-accordion-body {
  display: none;
  border-top: 1px solid var(--pg-border);
  padding: 1.25rem 1.25rem 1.5rem;
}

.pg-accordion.open .pg-accordion-body { display: block; }

.pg-shell-home {
  min-height: auto;
  padding-bottom: 1rem;
}

.pg-dossier .wrap { max-width: 100%; padding: 0; }
.pg-dossier .hero {
  background: linear-gradient(155deg, #042f2e 0%, #0f766e 45%, #0ea5e9 100%);
  color: #fff;
  padding: 1.75rem 1.25rem 2rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
}
.pg-dossier .hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 800px) {
  .pg-dossier .hero-inner { grid-template-columns: 1fr; }
}
.pg-dossier .brand-row { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.75rem; }
.pg-dossier .brand-mark {
  width: 40px; height: 40px; background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28); border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; font-size: 0.65rem;
}
.pg-dossier .hero h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.pg-dossier .hero .tagline { font-size: 1rem; font-weight: 600; opacity: 0.95; margin-bottom: 0.45rem; }
.pg-dossier .hero .lead { font-size: 0.88rem; opacity: 0.88; margin-bottom: 0; }
.pg-dossier .hero-panel {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px; padding: 1rem; font-family: var(--pg-mono); font-size: 0.74rem; line-height: 1.55;
}
.pg-dossier .hero-panel .in { color: #5eead4; display: block; }
.pg-dossier .hero-panel .out { color: #fde68a; margin-top: 0.65rem; display: block; }
.pg-dossier .flow-card {
  background: #fff; border: 1px solid #99f6e4; border-radius: 12px;
  padding: 0.95rem 1.1rem; margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.45rem 0.65rem; font-size: 0.85rem; color: var(--pg-muted);
}
.pg-dossier .flow-card strong { color: var(--pg-text); }
.pg-dossier h3.sec {
  font-size: 1.15rem; font-weight: 800; text-align: center; margin: 0 0 0.35rem;
}
.pg-dossier p.sec-lead {
  text-align: center; color: var(--pg-muted); font-size: 0.9rem;
  max-width: 640px; margin: 0 auto 1.25rem;
}
.pg-dossier .segments {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .pg-dossier .segments { grid-template-columns: 1fr; }
}
.pg-dossier .seg-card {
  background: #fff; border: 1px solid #99f6e4; border-radius: 12px; padding: 1.1rem 1rem;
}
.pg-dossier .seg-card h4 { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.3rem; color: #0f766e; }
.pg-dossier .seg-card p { font-size: 0.82rem; color: var(--pg-muted); margin-bottom: 0.55rem; }
.pg-dossier .seg-card ul { font-size: 0.8rem; color: var(--pg-muted); padding-left: 1.05rem; }
.pg-dossier .seg-card li { margin-bottom: 0.2rem; }
.pg-dossier .features {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; margin-bottom: 1.25rem;
}
@media (max-width: 640px) {
  .pg-dossier .features { grid-template-columns: 1fr; }
}
.pg-dossier .feat {
  background: #fff; border: 1px solid #99f6e4; border-radius: 12px; padding: 1rem;
}
.pg-dossier .feat h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
.pg-dossier .feat p { font-size: 0.82rem; color: var(--pg-muted); }
.pg-dossier .cta-band {
  background: linear-gradient(135deg, #042f2e, #0f766e);
  color: #fff; border-radius: 14px; padding: 1.5rem; text-align: center;
}
.pg-dossier .cta-band h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.pg-dossier .cta-band p { opacity: 0.88; font-size: 0.88rem; margin-bottom: 1rem; }
.pg-dossier .cta-band .pg-btn { width: auto; display: inline-flex; min-width: 200px; }

/* Acordeón visual — imagen + descripción corporativa */
.pg-more-stack { display: flex; flex-direction: column; gap: 0.75rem; }

.pg-visual {
  padding: 0.35rem 0 0.25rem;
}

.pg-visual-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.pg-visual-brand .pg-mark { width: 36px; height: 36px; font-size: 0.72rem; }

.pg-visual-brand b {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pg-text);
}

.pg-visual-brand small {
  display: block;
  font-size: 0.75rem;
  color: var(--pg-muted);
  font-weight: 500;
}

.pg-visual-hero {
  width: 100%;
  display: block;
  border-radius: 14px;
  margin: 0 0 1.15rem;
  background: #f8fafc;
  object-fit: contain;
  max-height: 420px;
}

.pg-visual-title {
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.55rem;
  color: var(--pg-text);
}

.pg-visual-sub {
  color: var(--pg-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0 0 1.15rem;
}

.pg-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .pg-visual-grid { grid-template-columns: 1fr; }
}

.pg-visual-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
}

.pg-visual-item .ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(236, 72, 153, 0.1);
  display: grid; place-items: center; font-size: 0.95rem;
}

.pg-visual-item h5 {
  margin: 0 0 0.15rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--pg-text);
}

.pg-visual-item p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--pg-muted);
  line-height: 1.4;
}
