/* =============================================================================
   Rapid Viable Product -- GIABO Digital PMO Swarm
   Shared design system: deep navy/slate cyber-enterprise theme with electric
   cyan/neon-blue accents. Every template (templates/*.html) links this file
   via base.html; nothing here is page-specific.
   ============================================================================= */

:root {
  /* Backgrounds */
  --bg-primary: #070b14;
  --bg-panel: #0a0f1d;
  --bg-panel-raised: #0d1426;
  --border-cyan-dim: rgba(0, 242, 254, 0.16);
  --border-cyan-dimmer: rgba(0, 242, 254, 0.08);

  /* Accents */
  --accent-cyan: #00f2fe;
  --accent-blue: #38bdf8;
  --accent-cyan-soft: rgba(0, 242, 254, 0.12);

  /* Text */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Status */
  --status-active: #34e6b0;
  --status-warn: #fbbf24;
  --status-danger: #fb7185;

  /* Effects */
  --glow-soft: 0 0 24px rgba(0, 242, 254, 0.22);
  --glow-strong: 0 0 40px rgba(0, 242, 254, 0.38);
  --radius-md: 10px;
  --radius-lg: 18px;
  --font-display: "Space Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-cyan);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
h3 {
  font-size: 1.15rem;
}

p {
  color: var(--text-muted);
  margin: 0 0 1em;
}

.accent {
  color: var(--accent-cyan);
}

/* -----------------------------------------------------------------------------
   Layout shell
   ----------------------------------------------------------------------------- */

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #070b14;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.mesh-blob-1 {
  width: 600px;
  height: 600px;
  top: -120px;
  left: -80px;
  background: #00f2fe;
  opacity: 0.3;
  filter: blur(140px);
  animation: blob-float-1 18s ease-in-out infinite alternate;
}

.mesh-blob-2 {
  width: 560px;
  height: 560px;
  top: 18%;
  right: -140px;
  background: #4f46e5;
  opacity: 0.25;
  filter: blur(120px);
  animation: blob-float-2 22s ease-in-out infinite alternate;
}

.mesh-blob-3 {
  width: 500px;
  height: 500px;
  bottom: -160px;
  left: 22%;
  background: #8b5cf6;
  opacity: 0.2;
  filter: blur(100px);
  animation: blob-float-3 16s ease-in-out infinite alternate;
}

.mesh-glass {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.18) 0%, rgba(7, 11, 20, 0.42) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: auto, 180px 180px;
  opacity: 0.35;
  pointer-events: none;
}

@keyframes blob-float-1 {
  from {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  to {
    transform: translate3d(22vw, 14vh, 0) scale(1.18) rotate(12deg);
  }
}

@keyframes blob-float-2 {
  from {
    transform: translate3d(0, 0, 0) scale(1.06) rotate(-6deg);
  }
  to {
    transform: translate3d(-18vw, -12vh, 0) scale(0.88) rotate(10deg);
  }
}

@keyframes blob-float-3 {
  from {
    transform: translate3d(0, 0, 0) scale(0.94) rotate(8deg);
  }
  to {
    transform: translate3d(14vw, -16vh, 0) scale(1.22) rotate(-14deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mesh-blob-1,
  .mesh-blob-2,
  .mesh-blob-3 {
    animation: none;
  }
}

.site-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
}

/* -----------------------------------------------------------------------------
   Nav
   ----------------------------------------------------------------------------- */

.site-nav {
  border-bottom: 1px solid var(--border-cyan-dimmer);
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.brand:hover {
  color: var(--text-primary);
}
.brand .brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand .brand-name small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.rvp-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.55));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--accent-cyan);
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #04101c;
  box-shadow: var(--glow-soft);
}
.btn-primary:hover {
  box-shadow: var(--glow-strong);
  color: #04101c;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-cyan-dim);
  color: var(--text-primary);
}
.btn-ghost:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-block {
  width: 100%;
}

/* -----------------------------------------------------------------------------
   Cards / panels
   ----------------------------------------------------------------------------- */

.card {
  background: linear-gradient(160deg, var(--bg-panel-raised), var(--bg-panel));
  border: 1px solid var(--border-cyan-dimmer);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-glow {
  border-color: var(--border-cyan-dim);
  box-shadow: var(--glow-soft);
}

.card-hover {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
  border-color: var(--border-cyan-dim);
  box-shadow: var(--glow-soft);
  transform: translateY(-2px);
}

.center-card {
  max-width: 560px;
  margin: 72px auto;
  text-align: center;
}

/* -----------------------------------------------------------------------------
   Badges
   ----------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.3);
}
.badge-active {
  background: rgba(52, 230, 176, 0.12);
  color: var(--status-active);
  border-color: rgba(52, 230, 176, 0.32);
}
.badge-warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--status-warn);
  border-color: rgba(251, 191, 36, 0.32);
}
.badge-danger {
  background: rgba(251, 113, 133, 0.12);
  color: var(--status-danger);
  border-color: rgba(251, 113, 133, 0.32);
}
.badge-neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.25);
}

/* -----------------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------------- */

.hero {
  padding: 96px 0 72px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  max-width: 880px;
  margin: 0 auto 20px;
}
.hero p.lead {
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: 1.08rem;
}
.hero .btn-row {
  justify-content: center;
}

/* -----------------------------------------------------------------------------
   Agent grid
   ----------------------------------------------------------------------------- */

.section {
  padding: 64px 0;
}
.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.agent-card .agent-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-cyan-soft);
  border: 1px solid var(--border-cyan-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.agent-card h3 {
  margin-bottom: 8px;
}
.agent-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Forms
   ----------------------------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-cyan-dim);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder {
  color: var(--text-dim);
}
.field input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-soft);
}
.field .hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 5px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
   Stats / progress
   ----------------------------------------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.stat-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-cyan-dimmer);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.stat-box .stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.stat-box .stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 999px;
}
.progress-fill.progress-danger {
  background: linear-gradient(90deg, #fb7185, #fbbf24);
}

/* -----------------------------------------------------------------------------
   Tables
   ----------------------------------------------------------------------------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
table.data-table th,
table.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-cyan-dimmer);
  font-size: 0.88rem;
}
table.data-table th {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}
table.data-table td {
  color: var(--text-muted);
}
table.data-table td.cell-primary {
  color: var(--text-primary);
  font-weight: 600;
}
table.data-table tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-size: 0.92rem;
  border: 1px dashed var(--border-cyan-dim);
  border-radius: var(--radius-md);
}

/* -----------------------------------------------------------------------------
   Alerts (landing success/error)
   ----------------------------------------------------------------------------- */

.alert-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}
.alert-icon.success {
  background: rgba(52, 230, 176, 0.12);
  color: var(--status-active);
  box-shadow: 0 0 30px rgba(52, 230, 176, 0.25);
}
.alert-icon.error {
  background: rgba(251, 113, 133, 0.12);
  color: var(--status-danger);
  box-shadow: 0 0 30px rgba(251, 113, 133, 0.2);
}

.error-detail {
  margin-top: 24px;
  font-size: 0.76rem;
  color: var(--text-dim);
  word-break: break-word;
}

/* -----------------------------------------------------------------------------
   Legal pages
   ----------------------------------------------------------------------------- */

.legal h2 {
  margin-top: 2em;
  color: var(--accent-cyan);
  font-size: 1.15rem;
}
.legal p,
.legal li {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.legal .updated {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* -----------------------------------------------------------------------------
   Handbook (Agent Guide)
   ----------------------------------------------------------------------------- */

.handbook {
  padding: 56px 0 72px;
}

.handbook .lead {
  font-size: 1.05rem;
  max-width: 720px;
}

.handbook h2 {
  margin-top: 2.4em;
  color: var(--accent-cyan);
}

.handbook h3 {
  margin-top: 1.4em;
}

.handbook table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 28px;
  font-size: 0.9rem;
}

.handbook th,
.handbook td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-cyan-dimmer);
}

.handbook th {
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-panel);
}

.handbook td {
  color: var(--text-muted);
}

.handbook tr:last-child td {
  border-bottom: none;
}

.handbook kbd,
.handbook code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
}

.handbook kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--border-cyan-dim);
  border-radius: 6px;
  background: var(--bg-panel-raised);
  color: var(--accent-cyan);
  box-shadow: inset 0 -1px 0 rgba(0, 242, 254, 0.18);
}

.handbook code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-cyan-soft);
  color: var(--accent-blue);
}

.handbook .toc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 20px 0 8px;
}

.roster-group {
  margin-bottom: 28px;
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border-cyan-dimmer);
  padding: 32px 0;
  margin-top: 48px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-footer .footer-links {
  display: flex;
  gap: 20px;
}
.site-footer .footer-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.site-footer .footer-links a:hover {
  color: var(--accent-cyan);
}
.site-footer .copyright {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* -----------------------------------------------------------------------------
   Small helpers
   ----------------------------------------------------------------------------- */

.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.text-center {
  text-align: center;
}
.section-divider {
  border: none;
  border-top: 1px solid var(--border-cyan-dimmer);
  margin: 32px 0;
}
