/* ─── AIP Registry — agentintake.io ────────────────────────────────
   Brand: warm orange/amber (#f77f00)
   Premium, professional, developer-friendly
   ─────────────────────────────────────────────────────────────────── */

:root {
  --brand: #f77f00;
  --brand-light: #fca311;
  --brand-dark: #e06c00;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --bg-dark: #0d1117;
  --bg-dark-alt: #161b22;
  --text: #1a1a2e;
  --text-light: #6c757d;
  --text-on-dark: #e6edf3;
  --text-muted-dark: #8b949e;
  --border: #e1e4e8;
  --border-dark: #30363d;
  --success: #2ea043;
  --error: #da3633;
  --warn: #d29922;
  --code-bg: #f6f8fa;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header / Nav ────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.nav { display: flex; align-items: center; gap: 8px; }

.nav a {
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav a.active { color: var(--brand); background: rgba(247,127,0,0.08); }

.nav-cta {
  background: var(--brand) !important;
  color: white !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--brand-dark) !important; }

.nav-auth {
  margin-left: 8px;
  font-size: 13px !important;
  color: var(--text-light) !important;
}

.mobile-menu { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ─── Hero ────────────────────────────────────────────────────── */

.hero {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 80px 24px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 0%, rgba(247,127,0,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 auto 20px;
  position: relative;
}

.hero h1 .highlight { color: var(--brand); }

.hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted-dark);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid var(--border-dark);
}
.btn-outline:hover { border-color: var(--text-muted-dark); text-decoration: none; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--error); color: white; }
.btn-success { background: var(--success); color: white; }

/* ─── Sections ────────────────────────────────────────────────── */

.section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  max-width: none;
}

.section-dark .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt .section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-light);
  margin-bottom: 48px;
  max-width: 600px;
}

/* ─── Cards ───────────────────────────────────────────────────── */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--text-light); font-size: 14px; }

/* ─── Features grid ───────────────────────────────────────────── */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }

.feature {
  padding: 24px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(247,127,0,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-light); font-size: 14px; line-height: 1.6; }

/* ─── Layer diagram ───────────────────────────────────────────── */

.layer-stack {
  max-width: 480px;
  margin: 0 auto;
}

.layer {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-dark);
  border-bottom: none;
  font-size: 14px;
}
.layer:last-child { border-bottom: 1px solid var(--border-dark); }

.layer-name {
  padding: 12px 20px;
  min-width: 160px;
  font-weight: 600;
  border-right: 1px solid var(--border-dark);
}

.layer-protocols {
  padding: 12px 20px;
  color: var(--text-muted-dark);
  flex: 1;
}

.layer-highlight {
  background: rgba(247,127,0,0.15);
}
.layer-highlight .layer-name { color: var(--brand); }
.layer-highlight .layer-protocols { color: var(--brand-light); font-weight: 600; }

/* ─── Protocol flow ───────────────────────────────────────────── */

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.flow-step {
  background: rgba(247,127,0,0.1);
  color: var(--brand);
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
}

.flow-arrow { color: var(--text-muted-dark); font-size: 18px; }

/* ─── Code blocks ─────────────────────────────────────────────── */

.code-block {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  margin: 16px 0;
}

.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-on-dark);
  line-height: 1.6;
}

/* ─── Forms ───────────────────────────────────────────────────── */

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color 0.15s;
  background: var(--bg);
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(247,127,0,0.15);
}

.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  transition: border-color 0.15s;
}
.otp-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(247,127,0,0.15);
}

/* ─── Auth pages ──────────────────────────────────────────────── */

.auth-container {
  max-width: 420px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.auth-container h1 { font-size: 28px; margin-bottom: 8px; }
.auth-container .subtitle { color: var(--text-light); margin-bottom: 32px; }

.auth-form { text-align: left; }
.auth-form .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ─── Registry ────────────────────────────────────────────────── */

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.search-bar .form-input { flex: 1; }

.registry-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all 0.15s;
}
.registry-entry:hover { border-color: var(--brand); box-shadow: var(--shadow); }

.registry-entry-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.registry-entry-info p { font-size: 13px; color: var(--text-light); }

.registry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-certified { background: rgba(46,160,67,0.1); color: var(--success); }
.badge-pending { background: rgba(210,153,34,0.1); color: var(--warn); }
.badge-expired { background: rgba(218,54,51,0.1); color: var(--error); }

.registry-tags { display: flex; gap: 6px; margin-top: 6px; }

.tag {
  background: var(--bg-alt);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-light);
}

/* ─── Certify ─────────────────────────────────────────────────── */

.inspect-container { max-width: 720px; margin: 0 auto; }

.inspect-url-form {
  display: flex;
  gap: 12px;
}

.inspect-url-form .form-input { flex: 1; font-size: 16px; }

.inspect-results {
  margin-top: 32px;
}

.inspect-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.inspect-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 14px;
}

.inspect-item-body { padding: 16px 20px; font-size: 13px; }

.status-pass { color: var(--success); }
.status-fail { color: var(--error); }
.status-warn { color: var(--warn); }
.status-pending { color: var(--text-light); }

/* ─── Certificate ─────────────────────────────────────────────── */

.cert-container { max-width: 600px; margin: 60px auto; padding: 0 24px; }

.cert-card {
  border: 2px solid var(--brand);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cert-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  padding: 32px;
  text-align: center;
}

.cert-header h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 2px; opacity: 0.9; }
.cert-header h1 { font-size: 24px; margin-top: 8px; }

.cert-body { padding: 32px; }

.cert-field {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cert-field:last-child { border-bottom: none; }

.cert-label { color: var(--text-light); }
.cert-value { font-weight: 600; }

.cert-status {
  text-align: center;
  padding: 20px;
  margin-top: 16px;
}

.cert-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 16px;
}

/* ─── Playground ──────────────────────────────────────────────── */

.playground-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100vh - var(--header-height));
  max-width: none;
}

.playground-chat {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.playground-inspector {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.playground-inspector .panel-header { border-color: var(--border-dark); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-message {
  margin-bottom: 20px;
  max-width: 85%;
}

.chat-message.user { margin-left: auto; }

.chat-message .message-role {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.chat-message .message-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
}

.chat-message.user .message-content {
  background: var(--brand);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
  background: var(--bg-alt);
  border-bottom-left-radius: 4px;
}

.chat-message.system .message-content {
  background: rgba(247,127,0,0.08);
  color: var(--text-light);
  font-size: 13px;
  text-align: center;
  max-width: 100%;
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.chat-input-area .form-input { flex: 1; }

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.http-log {
  margin-bottom: 24px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
}

.http-log-header {
  padding: 10px 16px;
  background: var(--bg-dark-alt);
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.http-method {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.http-method.get { background: rgba(46,160,67,0.2); color: var(--success); }
.http-method.post { background: rgba(247,127,0,0.2); color: var(--brand); }

.http-status {
  margin-left: auto;
  font-weight: 600;
}
.http-status.s2xx { color: var(--success); }
.http-status.s4xx { color: var(--warn); }
.http-status.s5xx { color: var(--error); }

.http-log-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted-dark);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

.inspector-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted-dark);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}

.demo-endpoints {
  padding: 12px 16px;
  border-top: 1px solid var(--border-dark);
  flex-shrink: 0;
}

.demo-endpoints h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted-dark); margin-bottom: 8px; }

.demo-endpoint-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-dark-alt);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  color: var(--text-on-dark);
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 6px;
  font-family: var(--font);
}
.demo-endpoint-btn:hover { border-color: var(--brand); }

/* ─── Dashboard ───────────────────────────────────────────────── */

.dashboard-container { max-width: 800px; margin: 0 auto; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.cert-list-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-list-info h3 { font-size: 16px; margin-bottom: 4px; }
.cert-list-info p { font-size: 13px; color: var(--text-light); }

.cert-list-actions { display: flex; gap: 8px; }

/* ─── Footer ──────────────────────────────────────────────────── */

.footer {
  background: var(--bg-dark);
  color: var(--text-muted-dark);
  padding: 48px 24px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-muted-dark); font-size: 13px; }
.footer-links a:hover { color: var(--text-on-dark); }

/* ─── Utilities ───────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: rgba(218,54,51,0.08); color: var(--error); border: 1px solid rgba(218,54,51,0.2); }
.alert-success { background: rgba(46,160,67,0.08); color: var(--success); border: 1px solid rgba(46,160,67,0.2); }
.alert-info { background: rgba(247,127,0,0.08); color: var(--brand-dark); border: 1px solid rgba(247,127,0,0.2); }

.hidden { display: none !important; }

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu { display: block; }

  .playground-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .playground-chat { min-height: 60vh; }
  .playground-inspector { min-height: 40vh; }

  .hero { padding: 48px 24px 64px; }
  .section { padding: 48px 24px; }

  .inspect-url-form { flex-direction: column; }
  .search-bar { flex-direction: column; }

  .cert-list-item { flex-direction: column; gap: 16px; align-items: flex-start; }

  .registry-entry { flex-direction: column; gap: 12px; align-items: flex-start; }
}
