@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Poppins:wght@400;500;600&display=swap');

/* Core Color Palette & Design Tokens */
:root {
  --color-background:    #f6f6f4;  /* App background */
  --color-surface:       #ffffff;  /* Cards, panes, header */
  --color-text:          #141414;
  --color-text-muted:    #8a8a86;
  --color-border:        #e3e3de;  /* Primary borders */
  --color-border-light:  #eeeeea;  /* Secondary/light borders, grid lines */

  --color-accent:        #121212;  /* Primary buttons, active states */
  --color-accent-hover:  #000000;
  --color-accent-light:  #eeeeea;  /* Hover fills, active nav backgrounds */

  --color-success:       #41D333;  /* API online, status ok */
  --color-warning:       #F8D311;  /* Pending */
  --color-danger:        #F73730;  /* Failed, error */

  --font-heading: 'Manrope', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html.dark {
  --color-background:    #141414;
  --color-surface:       #1e1e1e;
  --color-text:          #f6f6f4;
  --color-text-muted:    #9b9b96;
  --color-border:        #2e2e2a;
  --color-border-light:  #252522;

  --color-accent:        #f6f6f4;  /* Inverted: light-on-dark */
  --color-accent-hover:  #ffffff;
  --color-accent-light:  #252522;
}

/* Base Global Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  letter-spacing: -0.012em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 800;
}

/* Enforced Sharp Radii vs Fully Rounded Contrast */
.sharp {
  border-radius: 0 !important;
}

.pill {
  border-radius: 9999px !important;
}

/* Grid Background Texture */
.grid-bg {
  background-image: 
    linear-gradient(to right, var(--color-border-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border-light) 1px, transparent 1px);
  background-size: 58px 58px;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Topbar Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.brand-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

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

.theme-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.theme-toggle:hover {
  background: var(--color-accent-light);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-surface);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-accent-light);
}

/* Hero Section */
.hero {
  padding: 80px 0 48px 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
}

.hero h1 {
  font-size: 48px;
  max-width: 840px;
  margin: 0 auto 20px auto;
  color: var(--color-text);
}

.hero p {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto 32px auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Sandbox Console Component */
.sandbox-section {
  padding: 40px 0 80px 0;
}

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

.section-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

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

.console-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.console-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  background: var(--color-background);
}

.tab-btn {
  padding: 16px 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.tab-btn.active {
  color: var(--color-text);
  background: var(--color-surface);
  font-weight: 600;
  border-top: 2px solid var(--color-accent);
}

.console-body {
  padding: 32px;
}

.input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.input-control {
  flex: 1;
  padding: 12px 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
}

.input-control:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Result Visualization Cards */
.result-pane {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  padding: 24px;
  margin-top: 24px;
}

.score-badge-huge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.score-number {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.grade-tag {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.grade-A {
  background: rgba(65, 211, 51, 0.15);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.grade-B {
  background: rgba(248, 211, 17, 0.15);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.grade-C {
  background: rgba(247, 55, 48, 0.15);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.metric-title {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
}

.recom-item {
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: 12px;
}

.recom-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.badge-popular {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  letter-spacing: 0.05em;
}

.pricing-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pricing-header .price {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
}

.pricing-header .period {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.pricing-features {
  margin: 28px 0;
  border-top: 1px solid var(--color-border-light);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Testimonials Grid */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-icon {
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.quote-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  font-style: italic;
  margin-bottom: 24px;
}

.author-info strong {
  display: block;
  font-size: 14px;
}

.author-info span {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* FAQ List (Single-Column Vertical Stack) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  padding: 24px 28px;
  transition: border-color 0.15s, background 0.15s;
}

.faq-item:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.faq-item h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.faq-item p {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Contact Card & Clean Form Display */
.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 48px;
  margin-top: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

#form-contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

#form-contact .input-group {
  margin-bottom: 0 !important;
  width: 100%;
}

#form-contact .input-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
}

#form-contact textarea.input-control {
  min-height: 120px;
  resize: vertical;
}

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

/* Documentation Shell */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 48px 0;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
}

.docs-nav-group {
  margin-bottom: 24px;
}

.docs-nav-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.docs-nav-link {
  display: block;
  padding: 8px 12px;
  color: var(--color-text-muted);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.docs-nav-link:hover {
  color: var(--color-text);
  border-left-color: var(--color-border);
  background: var(--color-surface);
}

.docs-nav-link.active {
  color: var(--color-accent);
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-light);
  font-weight: 700;
}

.lang-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: none;
  padding: 8px 16px;
}

.lang-selector-group {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: var(--color-text);
}

.lang-btn.active {
  color: var(--color-text);
  background: var(--color-accent-light);
  border-color: var(--color-border);
}

.code-block-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
}

.code-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--color-text);
  max-height: 480px;
  white-space: pre-wrap;
  word-break: break-word;
}

.endpoint-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px;
  margin-bottom: 40px;
}

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

.method-tag {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.method-get {
  background: rgba(65, 211, 51, 0.15);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.method-post {
  background: rgba(18, 18, 18, 0.1);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

html.dark .method-post {
  background: rgba(246, 246, 244, 0.1);
  color: var(--color-text);
}

.endpoint-url {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 60px 0 32px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

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

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: 8px;
}

.footer-link {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.footer-muted {
  color: var(--color-text-muted);
  font-size: 13px;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Mobile Hamburger Button & Drawer Navigation */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.mobile-menu-btn:hover {
  background: var(--color-accent-light);
}

.mobile-drawer {
  display: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
}

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

.mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--color-text);
  border-left-color: var(--color-accent);
  background: var(--color-accent-light);
}

@media (max-width: 768px) {
  .nav-links,
  .desktop-auth-btn {
    display: none !important;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
  .topbar-inner {
    padding: 0 16px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
  }
  .input-row {
    flex-direction: column;
  }
}

/* Dashboard Custom Luxury Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 20px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-border-light);
  margin-top: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.dash-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

.dash-table th {
  padding: 12px 16px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

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

/* High-Contrast Code Blocks & Inline Code */
pre {
  background: #141414 !important;
  color: #f6f6f4 !important;
  border: 1px solid var(--color-border);
  border-radius: 0 !important;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 24px 0;
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-accent-light);
  padding: 2px 6px;
  border-radius: 0 !important;
  border: 1px solid var(--color-border);
}

pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #f6f6f4 !important;
  font-size: inherit !important;
}

html.dark pre {
  background: #000000 !important;
  color: #f6f6f4 !important;
  border-color: #2e2e2a;
}

html.dark code {
  color: #f6f6f4;
  background: #252522;
  border-color: #2e2e2a;
}
