:root {
  --bg-main: #0b101c;
  --bg-card: #111827;
  --bg-card-hover: #162035;
  --bg-surface: #0f172a;
  --bg-modal: #0d1322;
  
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-glow: rgba(251, 191, 36, 0.15);
  --amber-border: rgba(251, 191, 36, 0.35);

  --slate-100: #f3f4f6;
  --slate-200: #e5e7eb;
  --slate-300: #d1d5db;
  --slate-400: #9ca3af;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-800: #1e293b;

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-hard: #1e293b;

  --font-display: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-main);
  color: var(--slate-100);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--slate-100);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background terminal grid glow */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(251, 191, 36, 0.04) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.site-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11, 16, 28, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--emerald-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--slate-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span {
  color: var(--emerald-400);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid var(--emerald-border);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
  animation: pulse-dot 2s infinite ease-in-out;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--emerald-500);
  color: #061e14;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: var(--emerald-400);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--slate-800);
  color: var(--slate-200);
  border-color: var(--border-soft);
}

.btn-secondary:hover {
  background: var(--slate-700);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--slate-300);
  border: 1px solid var(--border-soft);
}

.btn-outline:hover {
  color: #fff;
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Return Verification Banner */
.notice-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.notice-banner.hidden {
  display: none;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-terminal-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--emerald-border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 840px;
  color: #ffffff;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #ffffff 30%, var(--emerald-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--slate-400);
  max-width: 680px;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Search & Filters */
.controls-wrap {
  margin: 32px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search-box-row {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 18px 14px 44px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--slate-100);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--emerald-400);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
  pointer-events: none;
}

.filter-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--slate-300);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border-color: var(--emerald-400);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* Directory Section */
.directory-section {
  padding-bottom: 48px;
}

.directory-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--slate-400);
}

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

/* Tool Card */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.22s ease;
  overflow: hidden;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.tool-card.featured-card {
  border-color: var(--emerald-border);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.tool-card.hero-card {
  border-color: var(--amber-border);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.1);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.03) 0%, var(--bg-card) 40%);
}

.tool-card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.tag-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--slate-300);
}

.tag-plan {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.tag-plan.hero {
  background: var(--amber-glow);
  color: var(--amber-400);
  border: 1px solid var(--amber-border);
}

.tag-plan.featured {
  background: var(--emerald-glow);
  color: var(--emerald-400);
  border: 1px solid var(--emerald-border);
}

.tool-card-main {
  margin-bottom: 18px;
}

.tool-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deal-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid var(--emerald-border);
  margin-bottom: 12px;
}

.tool-desc {
  font-size: 0.88rem;
  color: var(--slate-300);
  line-height: 1.5;
  margin-bottom: 12px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--slate-300);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--emerald-400);
  color: var(--emerald-400);
  background: var(--emerald-glow);
}

.vote-btn:disabled {
  opacity: 0.6;
  cursor: default;
  color: var(--emerald-400);
  border-color: var(--emerald-border);
}

.claim-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--emerald-400);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--emerald-border);
  transition: all 0.18s ease;
}

.claim-link:hover {
  background: var(--emerald-500);
  color: #061e14;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--slate-400);
  grid-column: 1 / -1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-soft);
}

/* ROI Estimator Section */
.roi-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, transparent 100%);
}

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

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-400);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.roi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  position: relative;
}

.roi-inputs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.roi-input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-200);
  margin-bottom: 8px;
}

.roi-input-group label span.val-display {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--emerald-400);
  font-weight: 700;
}

.roi-slider {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--slate-800);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald-400);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  border: 2px solid #061e14;
}

.roi-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald-400);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  border: 2px solid #061e14;
}

.roi-outputs {
  background: rgba(11, 16, 28, 0.85);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

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

.roi-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
}

.roi-stat-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--emerald-400);
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.roi-sub-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.roi-sub-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-100);
}

.recommended-stack-pill {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid var(--amber-border);
  color: var(--amber-400);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recommended-stack-pill strong {
  color: #fff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-hard);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.22s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-300);
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--slate-100);
  transition: border-color 0.18s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald-400);
}

textarea.form-control {
  resize: vertical;
  min-height: 72px;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--slate-500);
  text-align: right;
}

/* Tier Selection Cards */
.tiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tier-option {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  transition: all 0.18s ease;
}

.tier-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.tier-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--emerald-400);
}

.tier-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
}

.tier-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--emerald-400);
}

.tier-desc {
  font-size: 0.78rem;
  color: var(--slate-400);
}

.tier-option.selected {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

.error-banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.4;
  display: none;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  background: #090e18;
  padding: 32px 0;
  font-size: 0.85rem;
  color: var(--slate-500);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--slate-400);
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-link:hover {
  color: var(--emerald-400);
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .roi-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-section {
    padding: 32px 0 24px;
  }

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

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-card {
    padding: 0;
  }
}
