/* ═══════════════════════════════════════════════════════════
   EPP Inbox Dashboard
   Dark theme with indigo/purple accents (#6366f1)
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f18;
  --bg-card: #13131f;
  --bg-card-hover: #1a1a2e;
  --bg-input: #0d0d16;
  --border: #1e1e33;
  --border-focus: #6366f1;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #555570;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-hover: #818cf8;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --yellow: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── HERO ─── */

.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 12px;
}

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

.hero-tagline {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 24px;
}

.hero-description {
  max-width: 640px;
  margin: 0 auto 40px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── BUTTONS ─── */

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

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ─── SECTIONS ─── */

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 16px;
}

/* ─── DEMO STATUS ─── */

.demo-status {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.loading {
  background: var(--yellow);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.ready {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-dot.error {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── DEMO GRID ─── */

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .demo-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── DEMO PANELS ─── */

.demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.agent-role {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.agent-avatar.sarah {
  background: linear-gradient(135deg, #f472b6, #db2777);
  color: white;
}

.agent-avatar.lawbot {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
}

.agent-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  cursor: help;
}

.panel-body {
  padding: 24px;
}

/* ─── FORM ELEMENTS ─── */

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.input-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.input-row {
  margin-bottom: 16px;
}

.input-text {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 0.2s;
}

.input-text:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── SPINNER ─── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── RESULTS ─── */

.result-area {
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

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

.receipt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}

.receipt div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt span {
  font-size: 12px;
  opacity: 0.8;
}

.receipt-accepted {
  background: var(--green-bg);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.receipt-rejected {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.envelope-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.envelope-details summary {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.envelope-details summary:hover {
  background: var(--bg-card-hover);
}

.code-block {
  padding: 16px;
  background: var(--bg-input);
  color: var(--accent-hover);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  max-height: 300px;
  overflow-y: auto;
}

/* ─── INBOX ─── */

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

.inbox-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.inbox-poll {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-poll::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.inbox-messages {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.inbox-message {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-input);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.msg-sender {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-hover);
  font-weight: 600;
}

.msg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-verified {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.msg-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.msg-scope {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.msg-prompt {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}

/* ─── REVENUE BAR ─── */

.revenue-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 13px;
  color: var(--text-secondary);
}

.revenue-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--green);
}

/* ─── FLOW DIAGRAM ─── */

.flow-diagram {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 200px;
  padding: 0 8px;
}

.flow-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

.flow-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-hover);
}

.flow-step h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.flow-step p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.flow-arrow {
  display: flex;
  align-items: center;
  padding-top: 60px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .flow-diagram {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .flow-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }
}

/* ─── DIRECTORY ─── */

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

.directory-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.directory-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.dir-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.dir-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.dir-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.dir-verified {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.dir-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.dir-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cap-tag {
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.directory-loading,
.directory-empty,
.directory-error {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
}

.directory-error {
  color: var(--red);
}

/* ─── FOOTER ─── */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent-hover);
}

/* ─── SCROLLBAR ─── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── SELECTION ─── */

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: white;
}
