/* ===============================
   Delega — Shared Styles
   =============================== */

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

:root {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --border: #1e1e1e;
  --border-light: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #888888;
  --text-dim: #666666;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.1);
  --accent-glow: rgba(0, 212, 255, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === NAV === */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span { color: var(--accent); }

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cta {
  background: var(--accent);
  color: #000 !important;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.9; color: #000 !important; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  z-index: 99;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--text); }

/* === SECTIONS === */
section { padding: 100px 24px; }
.container { max-width: var(--max-width); margin: 0 auto; }

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #000;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--border-light);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  background: var(--bg-raised);
}

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

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
}

/* === CODE BLOCKS === */
.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border-light);
}

.code-dot:nth-child(1) { background: #ef4444; }
.code-dot:nth-child(2) { background: #f59e0b; }
.code-dot:nth-child(3) { background: #22c55e; }

.code-filename {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.code-body {
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-body .comment { color: #6b7280; }
.code-body .keyword { color: #c084fc; }
.code-body .func { color: #60a5fa; }
.code-body .string { color: #34d399; }
.code-body .var { color: var(--text); }
.code-body .param { color: #f97316; }
.code-body .op { color: var(--text-muted); }
.code-body .num { color: #fbbf24; }

pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
}

/* === FORMS === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

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

.form-input-mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  font-size: 1.2rem;
  text-align: center;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--border-light);
}

/* === TOAST === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toast-in 0.3s ease;
  max-width: 400px;
  border: 1px solid var(--border);
}

.toast-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.3);
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  border-color: rgba(0, 212, 255, 0.2);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === SPINNER === */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 40px; height: 40px;
  border-width: 3px;
}

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

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* === PRICING (shared: index + billing) === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s;
}

.pricing-card:hover { border-color: var(--border-light); }

.pricing-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-dim);
}

.pricing-card.current {
  border-color: var(--green);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.1);
}

.pricing-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pricing-badge-green {
  background: var(--green);
}

.pricing-tier {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
  flex: 1;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.pricing-card .btn-primary,
.pricing-card .btn-secondary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.9rem;
}

.pricing-note {
  text-align: center;
  margin-top: 32px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* === FOOTER === */
footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.footer-legal {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-legal a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-legal a:hover { color: var(--text-muted); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  section { padding: 72px 20px; }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 20px;
    right: 20px;
  }

  .toast {
    max-width: 100%;
  }
}
