/* ==========================================
   ROBOT TRUST HUB — Main Stylesheet
   ========================================== */

/* Design tokens */
:root {
  --bg-base: #09090f;
  --bg-surface: #111120;
  --bg-card: #161628;
  --bg-card-hover: #1c1c35;
  --border: rgba(99, 102, 241, 0.2);
  --border-bright: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-green: #10b981;

  --text-primary: #f0f0f9;
  --text-secondary: #9090b0;
  --text-muted: #5a5a7a;

  --gradient-hero: linear-gradient(135deg, #0d0d1f 0%, #1a0533 50%, #0a1a40 100%);
  --gradient-accent: linear-gradient(90deg, #6366f1, #8b5cf6);
  --gradient-card: linear-gradient(180deg, #1c1c35 0%, #111120 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-secondary); }

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

/* ==========================================
   LAYOUT UTILITIES
   ========================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.section {
  padding: 96px 0;
}

.section-dark {
  background: var(--bg-surface);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-title.left-align { text-align: left; }

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--border-bright);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-large { padding: 16px 36px; font-size: 1.05rem; }

/* ==========================================
   NAV
   ========================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
}

.nav-scrolled {
  background: rgba(9, 9, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.nav-logo:hover { color: var(--text-primary); }
.nav-logo-icon { font-size: 1.3rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

/* ==========================================
   HERO
   ========================================== */
.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
  gap: 48px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: -100px;
  right: -50px;
  pointer-events: none;
}

.hero-bg { display: none; }

.hero-content {
  flex: 1;
  min-width: 320px;
  max-width: 580px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border-bright);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat { text-align: center; }
.stat-val { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.stat-label { display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* Hero code block */
.hero-code-block {
  flex: 1;
  min-width: 300px;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  position: relative;
  z-index: 1;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #28c840; }

.code-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.code-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
  overflow-x: auto;
}

/* Syntax colours */
.c-key { color: #79c0ff; }
.c-str { color: #a5d6ff; }
.c-bool { color: #ff7b72; }

/* ==========================================
   CARDS
   ========================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.3s ease;
}

.card-glow:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   STEPS
   ========================================== */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.step-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-primary);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.step-arrow {
  font-size: 1.5rem;
  color: var(--accent-primary);
  opacity: 0.5;
  margin-top: 32px;
  flex-shrink: 0;
}

/* ==========================================
   BENEFITS
   ========================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.two-col-centered { align-items: center; }

.benefit-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.benefit-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.icon-circle {
  font-size: 1.3rem;
}

.benefit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.benefit-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================
   HIGHLIGHT / ROBOT-CREATE SECTION
   ========================================== */
.highlight-section {
  background: linear-gradient(135deg, #0e0e22, #180d30, #0d1a35);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.highlight-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.highlight-text p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.check-list li::before {
  content: '✦ ';
  color: var(--accent-primary);
  font-size: 0.75rem;
}

.check-list li {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Diagram */
.highlight-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
}

.diagram-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 350px;
}

.diagram-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.diagram-row.two { justify-content: space-around; }

.diagram-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
  min-width: 120px;
}

.diagram-node.ai { border-color: var(--accent-primary); color: var(--accent-primary); }
.diagram-node.robot-site { border-color: var(--accent-secondary); color: var(--accent-secondary); }
.diagram-node.registry { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.diagram-node.preferred { border-color: var(--accent-green); color: var(--accent-green); }

.glow-node {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  animation: glow-pulse 3s infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 35px rgba(139, 92, 246, 0.6); }
}

.diagram-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  text-align: center;
}

.diagram-node small { display: block; font-size: 0.68rem; opacity: 0.7; margin-top: 4px; }

/* ==========================================
   PLANS
   ========================================== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.plan-card-featured {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-tier {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan-features li {
  font-size: 0.87rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: 700;
}

/* ==========================================
   TECHNICAL SECTION
   ========================================== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.tech-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tech-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 14px 16px 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.code-block {
  background: var(--bg-base);
}

.code-block pre {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.tech-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================
   CTA SECTION
   ========================================== */
.section-cta {
  text-align: center;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
}

.section-cta .section-subtitle {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.cta-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 12px 0 16px;
  line-height: 1.6;
}

.footer-meta code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.87rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   FORM STYLES (for register.html)
   ========================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 100px; }

/* ==========================================
   PAGE HEADER (inner pages)
   ========================================== */
.page-header {
  background: var(--gradient-hero);
  padding: 140px 24px 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ==========================================
   CODE / JSON PREVIEW BOX
   ========================================== */
.json-preview {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    min-height: auto;
    padding: 100px 24px 60px;
    text-align: center;
  }

  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-code-block { max-width: 100%; }

  .two-col {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .steps {
    flex-direction: column;
  }

  .step-arrow { display: none; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .nav-links { display: none; }
  .footer-links { grid-template-columns: 1fr; }
  .plans-grid { max-width: 100%; }
  .hero-code-block { display: none; }

  .diagram-row.two {
    flex-direction: column;
    align-items: center;
  }
}

/* ==========================================
   CODE (inline)
   ========================================== */
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}