/* ==========================================================================
   Cloud Control ERP — Design System & Main Stylesheet
   Apple-inspired, light-first, high-performance static architecture
   Zero external fonts, zero blocking imports
   ========================================================================== */

:root {
  /* Color Tokens */
  --color-canvas: #ffffff;
  --color-canvas-subtle: #f5f5f7;
  --color-canvas-card: #ffffff;
  --color-canvas-dark: #111215;
  --color-canvas-dark-subtle: #1c1c1e;
  
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #59595e;
  --color-text-muted: #59595e;
  --color-text-inverse: #f5f5f7;
  --color-text-inverse-secondary: #a1a1a6;

  --color-accent: #0066cc;
  --color-accent-hover: #0055b3;
  --color-accent-vivid: #2997ff;
  --color-accent-subtle: rgba(0, 102, 204, 0.08);

  /* Pillar Specific Accents - AAA/AA Contrast Compliant */
  --color-pillar-finance: #0369a1;
  --color-pillar-finance-bg: #e0f2fe;
  --color-pillar-supply: #b45309;
  --color-pillar-supply-bg: #fef3c7;
  --color-pillar-procurement: #4338ca;
  --color-pillar-procurement-bg: #eef2ff;
  --color-pillar-human: #6d28d9;
  --color-pillar-human-bg: #f5f3ff;

  --color-border: #d2d2d7;
  --color-border-subtle: rgba(0, 0, 0, 0.08);
  --color-border-dark: #2c2c2e;

  /* Typography Stack */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  /* Elevation Shadows */
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-device: 0 24px 64px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.1);

  /* Layout & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  --container-max: 1200px;
  --container-narrow: 840px;
  --header-height: 52px;
}

/* Modern Reset & Baseline */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background-color: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

img, svg, picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--color-text-primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--color-accent-vivid);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-top: clamp(64px, 8vw, 120px);
  padding-bottom: clamp(64px, 8vw, 120px);
  position: relative;
}

.section-subtle {
  background-color: var(--color-canvas-subtle);
}

.section-white {
  background-color: var(--color-canvas);
}

/* Typography Hierarchy */
.hero-title {
  font-size: clamp(40px, 5.5vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--color-text-primary);
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

.section-title-inverse {
  color: #ffffff;
}

.subsection-title {
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.lead {
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.45;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin-bottom: 32px;
}

.lead-centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.eyebrow-inverse {
  color: var(--color-accent-vivid);
}

.illustrative-caption {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 14px;
  letter-spacing: 0.01em;
}

/* Button & Pill Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

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

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

.btn-secondary {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
  border-color: rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.btn-inverse {
  background-color: #ffffff;
  color: #111215;
}

.btn-inverse:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

.btn-outline-inverse {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-inverse:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-link {
  color: var(--color-accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.btn-link:hover {
  text-decoration: underline;
  gap: 7px;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-group-centered {
  justify-content: center;
}

/* Frosted Glass Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-subtle);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-brand img {
  height: 28px;
  width: auto;
}

.main-nav {
  display: none;
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
  }
}

.nav-link {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 400;
  opacity: 0.82;
  transition: opacity 0.15s ease;
  position: relative;
  padding: 8px 0;
}

.nav-link:hover, .nav-link:focus {
  opacity: 1;
}

.nav-link.active {
  opacity: 1;
  font-weight: 600;
}

/* Nav Dropdown for Product */
.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -20px;
  width: 320px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1010;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
  background: rgba(0, 0, 0, 0.04);
}

.dropdown-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.dropdown-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

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

.header-login {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 500;
}

.header-login:hover {
  color: var(--color-accent);
}

/* Mobile Menu Button */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

@media (min-width: 992px) {
  .mobile-toggle {
    display: none;
  }
}

.mobile-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  z-index: 999;
}

.mobile-drawer.is-open {
  display: flex;
}

.mobile-nav-link {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-primary);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Hero Section */
.hero-section {
  padding-top: clamp(48px, 6vw, 96px);
  padding-bottom: clamp(64px, 8vw, 110px);
  text-align: center;
  background: radial-gradient(circle at 50% 20%, rgba(0, 113, 227, 0.04) 0%, transparent 70%);
}

.hero-visual-frame {
  margin-top: 48px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-device);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  position: relative;
}

/* Cinematic Dark Feature Band */
.dark-band {
  background-color: var(--color-canvas-dark);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  padding-top: clamp(80px, 9vw, 140px);
  padding-bottom: clamp(80px, 9vw, 140px);
}

.dark-band-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  pointer-events: none;
}

.dark-band-content {
  position: relative;
  z-index: 2;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

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

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* Cards & Containers */
.card {
  background: var(--color-canvas-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.card-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.card-dark:hover {
  background: rgba(255, 255, 255, 0.08);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: var(--color-canvas-subtle);
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-icon-dark {
  background: rgba(255, 255, 255, 0.1);
}

.card-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-dark .card-desc {
  color: var(--color-text-inverse-secondary);
}

/* Split Showcase Section */
.split-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 992px) {
  .split-showcase {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  .split-reverse {
    direction: rtl;
  }
  .split-reverse > * {
    direction: ltr;
  }
}

.showcase-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-device);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
}

/* Comparison Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}

.comparison-table th,
.comparison-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.comparison-table th {
  background: var(--color-canvas-subtle);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .highlight-col {
  background: rgba(0, 113, 227, 0.03);
  font-weight: 500;
}

/* Interactive Tabs Component */
.tab-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.is-active, .tab-btn:hover {
  background: var(--color-text-primary);
  color: #ffffff;
  border-color: var(--color-text-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* Transparent ROI Estimator */
.roi-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: clamp(32px, 4vw, 48px);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-subtle);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 840px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.calc-field {
  margin-bottom: 20px;
}

.calc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.calc-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-prefix {
  position: absolute;
  left: 14px;
  font-size: 15px;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.calc-input {
  width: 100%;
  padding: 12px 14px 12px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 15px;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

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

.calc-input-noprefix {
  padding-left: 14px;
}

.calc-results-box {
  background: var(--color-canvas-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--color-border-subtle);
}

.calc-result-stat {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
  margin-bottom: 8px;
}

.calc-formula-note {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 16px;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow-subtle);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 24px;
  background: transparent;
  border: none;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-icon {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-accent);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 20px 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #ffffff;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
  outline: none;
}

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

.form-consent {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 14px;
  margin-bottom: 20px;
}

.form-feedback {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 20px;
  display: none;
  font-size: 14px;
}

.form-feedback.is-success {
  display: block;
  background: #e8f5ee;
  color: #0f5132;
  border: 1px solid #c3e6cb;
}

.form-feedback.is-error {
  display: block;
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

/* Sticky Mobile CTA Bar */
.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 990;
}

@media (min-width: 768px) {
  .mobile-sticky-bar {
    display: none;
  }
}

/* Site Footer */
.site-footer {
  background-color: var(--color-canvas-subtle);
  color: var(--color-text-secondary);
  font-size: 13px;
  padding-top: 64px;
  padding-bottom: 48px;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
}

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

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Scroll Reveal Fade */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}
