/**
 * OST Web&Support 3.0 - Global Design System Tokens & Base Styles
 * Aesthetic: HYBRID ENTERPRISE TECH
 */

:root {
  /* Color Palette */
  --ost-deep-navy: #0A1020;
  --ost-dark-surface: #111B30;
  --ost-dark-surface-elevated: #1A2744;
  --ost-primary-blue: #1570EF;
  --ost-primary-blue-hover: #175CD3;
  --ost-primary-blue-light: #EFF8FF;
  --ost-cyber-cyan: #14D7CB;
  --ost-cyber-cyan-hover: #0FBDAF;
  --ost-cyber-cyan-glow: rgba(20, 215, 203, 0.25);
  --ost-light-bg: #F4F7FB;
  --ost-white: #FFFFFF;
  --ost-text-main: #142238;
  --ost-text-muted: #5F7188;
  --ost-text-light: #94A3B8;
  --ost-border: #E2E8F0;
  --ost-border-dark: rgba(255, 255, 255, 0.1);
  --ost-success: #10B981;
  --ost-warning: #F59E0B;
  --ost-danger: #EF4444;

  /* Typography */
  --ost-font-heading: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ost-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --ost-space-xs: 0.25rem;
  --ost-space-sm: 0.5rem;
  --ost-space-md: 1rem;
  --ost-space-lg: 1.5rem;
  --ost-space-xl: 2rem;
  --ost-space-2xl: 3rem;
  --ost-space-3xl: 5rem;

  /* Layout */
  --ost-container-width: 1280px;
  --ost-header-height: 80px;
  --ost-radius-sm: 6px;
  --ost-radius-md: 10px;
  --ost-radius-lg: 16px;
  --ost-radius-full: 9999px;

  /* Shadows */
  --ost-shadow-sm: 0 1px 3px rgba(10, 16, 32, 0.05);
  --ost-shadow-md: 0 4px 12px rgba(10, 16, 32, 0.08);
  --ost-shadow-lg: 0 12px 32px rgba(10, 16, 32, 0.12);
  --ost-shadow-cyan-glow: 0 0 24px var(--ost-cyber-cyan-glow);
  --ost-shadow-blue-glow: 0 0 24px rgba(21, 112, 239, 0.35);

  /* Transitions */
  --ost-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --ost-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-family: var(--ost-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ost-text-main);
  background-color: var(--ost-light-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: var(--ost-header-height);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
}

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

a {
  color: var(--ost-primary-blue);
  text-decoration: none;
  transition: color var(--ost-transition-fast);
}

a:hover {
  color: var(--ost-primary-blue-hover);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ost-font-heading);
  font-weight: 600;
  color: var(--ost-text-main);
  line-height: 1.2;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 700; line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.85rem); }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.25em;
  color: var(--ost-text-muted);
}

p.lead {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--ost-text-main);
}

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

.ost-section {
  padding-top: var(--ost-space-3xl);
  padding-bottom: var(--ost-space-3xl);
}

.ost-section-dark {
  background-color: var(--ost-deep-navy);
  color: var(--ost-white);
}

.ost-section-dark h1,
.ost-section-dark h2,
.ost-section-dark h3,
.ost-section-dark h4 {
  color: var(--ost-white);
}

.ost-section-dark p {
  color: var(--ost-text-light);
}

/* Grids */
.ost-grid {
  display: grid;
  gap: 2rem;
}

.ost-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ost-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ost-grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

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

/* Buttons */
.ost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--ost-font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--ost-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ost-transition-base);
  white-space: nowrap;
  min-height: 44px; /* WCAG touch target */
}

.ost-btn-primary {
  background-color: var(--ost-primary-blue);
  color: var(--ost-white);
  box-shadow: 0 4px 14px rgba(21, 112, 239, 0.35);
}

.ost-btn-primary:hover {
  background-color: var(--ost-primary-blue-hover);
  color: var(--ost-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(21, 112, 239, 0.45);
}

.ost-btn-cyber {
  background-color: var(--ost-cyber-cyan);
  color: var(--ost-deep-navy);
  box-shadow: 0 4px 14px var(--ost-cyber-cyan-glow);
}

.ost-btn-cyber:hover {
  background-color: var(--ost-cyber-cyan-hover);
  color: var(--ost-deep-navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 215, 203, 0.4);
}

.ost-btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--ost-white);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.ost-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--ost-white);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.ost-btn-outline {
  background-color: transparent;
  color: var(--ost-primary-blue);
  border-color: var(--ost-primary-blue);
}

.ost-btn-outline:hover {
  background-color: var(--ost-primary-blue-light);
  color: var(--ost-primary-blue-hover);
}

/* Badges */
.ost-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-family: var(--ost-font-heading);
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--ost-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ost-badge-cyber {
  background-color: rgba(20, 215, 203, 0.12);
  color: var(--ost-cyber-cyan);
  border: 1px solid rgba(20, 215, 203, 0.3);
}

.ost-badge-blue {
  background-color: var(--ost-primary-blue-light);
  color: var(--ost-primary-blue);
  border: 1px solid rgba(21, 112, 239, 0.2);
}

.ost-badge-success {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--ost-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Cards */
.ost-card {
  background-color: var(--ost-white);
  border: 1px solid var(--ost-border);
  border-radius: var(--ost-radius-lg);
  padding: 2rem;
  box-shadow: var(--ost-shadow-sm);
  transition: all var(--ost-transition-base);
}

.ost-card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--ost-shadow-lg);
  border-color: rgba(21, 112, 239, 0.25);
}

.ost-card-dark {
  background-color: var(--ost-dark-surface);
  border-color: var(--ost-border-dark);
  color: var(--ost-white);
}

.ost-card-dark:hover {
  border-color: var(--ost-cyber-cyan);
  box-shadow: var(--ost-shadow-cyan-glow);
}

/* ==========================================================================
   Responsive Section Layouts (Zero Inline Fixed Grids)
   ========================================================================== */

/* Hero Section */
.ost-hero-section {
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
  padding-bottom: 6rem;
  background: radial-gradient(circle at 85% 30%, rgba(20, 215, 203, 0.08) 0%, rgba(10, 16, 32, 1) 65%);
}

.ost-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.ost-hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* TCO Cost Calculator */
.ost-tco-card {
  padding: 2.5rem;
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow-md);
}

.ost-tco-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.ost-tco-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.ost-tco-savings-box {
  margin-top: 2rem;
  background: #ECFDF5;
  border: 2px solid #10B981;
  border-radius: var(--ost-radius-md);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* 5-Branch Configurator */
.ost-config-card {
  padding: 2.5rem;
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow-md);
}

.ost-config-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.ost-branch-btn {
  padding: 1.25rem 1rem;
  text-align: center;
  border-radius: var(--ost-radius-md);
  border: 1px solid var(--ost-border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.ost-branch-btn.active {
  border-color: var(--ost-primary-blue);
  background: var(--ost-primary-blue-light);
}

.ost-config-main-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2.5rem;
  align-items: flex-start;
}

.ost-config-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ost-config-ticker {
  background: var(--ost-dark-surface);
  color: #fff;
  border-radius: var(--ost-radius-md);
  padding: 2rem;
  position: sticky;
  top: 100px;
}

/* Form 2-Column Grids */
.ost-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Radio Option Flex Row */
.ost-radio-group-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Contact Main Grid */
.ost-contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3.5rem;
  align-items: flex-start;
}

/* ==========================================================================
   Mobile Touch Controls & Form Inputs (iOS Zoom Prevention)
   ========================================================================== */

/* Prevent iOS Safari 100% zoom bug when tapping text inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select,
textarea {
  font-size: 16px !important;
  font-family: inherit;
  box-sizing: border-box;
  max-width: 100%;
}

/* Responsive Touch Sliders */
input[type="range"].ost-slider,
input[type="range"] {
  width: 100%;
  height: 44px;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 0.25rem 0;
  touch-action: pan-y;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 5px;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  background: var(--ost-primary-blue);
  box-shadow: 0 2px 8px rgba(21, 112, 239, 0.45);
  border: 2px solid #FFFFFF;
  margin-top: -9px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
  background: var(--ost-cyber-cyan);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 5px;
}

input[type="range"]::-moz-range-thumb {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  background: var(--ost-primary-blue);
  box-shadow: 0 2px 8px rgba(21, 112, 239, 0.45);
  border: 2px solid #FFFFFF;
  cursor: pointer;
}

label input[type="checkbox"],
label input[type="radio"] {
  min-width: 18px;
  min-height: 18px;
  accent-color: var(--ost-primary-blue);
  cursor: pointer;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Overrides
   ========================================================================== */

@media (max-width: 992px) {
  .ost-hero-section {
    padding-top: 3.5rem;
    padding-bottom: 4rem;
  }

  .ost-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .ost-config-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .ost-config-ticker {
    position: static;
    width: 100%;
  }

  .ost-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  :root {
    --ost-header-height: 64px;
    --ost-space-3xl: 3rem;
    --ost-space-2xl: 2rem;
  }

  .ost-container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .ost-card,
  .ost-tco-card,
  .ost-config-card {
    padding: 1.35rem 1.1rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  h1 { font-size: clamp(1.8rem, 6.5vw, 2.3rem); line-height: 1.18; }
  h2 { font-size: clamp(1.45rem, 5vw, 1.85rem); line-height: 1.25; }
  h3 { font-size: 1.25rem; }

  p.lead {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  .ost-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }

  .ost-tco-sliders-grid,
  .ost-tco-comparison-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    width: 100% !important;
  }

  .ost-tco-col-internal,
  .ost-tco-col-managed {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .ost-tco-savings-box {
    padding: 1.25rem 1rem;
    text-align: center;
    justify-content: center;
  }

  .ost-config-branches {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .ost-branch-btn {
    padding: 0.85rem 0.6rem;
  }

  .ost-branch-btn strong {
    font-size: 0.85rem;
  }

  .ost-branch-btn small {
    display: none;
  }

  .ost-config-branches .ost-branch-btn:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .ost-config-checkbox-grid,
  .ost-form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .ost-radio-group-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 576px) {
  .ost-hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .ost-hero-cta-group .ost-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }

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

@media (max-width: 480px) {
  .ost-hero-stats-grid {
    gap: 0.6rem !important;
  }

  .ost-hero-stat-card {
    padding: 0.75rem 0.6rem !important;
  }

  .ost-hero-stat-card div:nth-child(2) {
    font-size: 1.35rem !important;
  }
}

/* Accessibility & Screen Readers */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

:focus-visible {
  outline: 2px solid var(--ost-primary-blue);
  outline-offset: 3px;
}

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

/* ==========================================================================
   OST Subpage Hero Header Section (SEO H1 Container)
   ========================================================================== */
.ost-page-header {
  background: linear-gradient(135deg, var(--ost-deep-navy) 0%, #0d1a33 50%, var(--ost-dark-surface) 100%);
  padding: 4.5rem 1.5rem 3.5rem;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--ost-border-dark);
}

.ost-page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse at center, rgba(20, 215, 203, 0.15), transparent 70%);
  pointer-events: none;
}

.ost-page-header h1 {
  font-family: var(--ost-font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.ost-page-header p.lead {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--ost-text-light);
  line-height: 1.6;
  max-width: 780px;
  margin: 0 auto;
}

/* Global Logo & Header Layout Safeguards */
:root {
  --ost-logo-height: 48px;
  --ost-logo-max-width: 280px;
}

.ost-logo-container,
.ost-logo,
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  height: auto;
  min-height: 44px;
  flex-shrink: 0;
}

.custom-logo,
.custom-logo-link img,
.ost-logo-img,
.ost-logo img,
.ost-logo-container img {
  height: var(--ost-logo-height, 48px);
  width: auto;
  max-width: var(--ost-logo-max-width, 280px);
  object-fit: contain;
  display: block;
}

.ost-hotline-btn,
.ost-portal-btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   Elementor Hero Auto-Fullwidth Breakout
   Forces the top hero / starter section to span edge-to-edge full width
   even if the Elementor section or page template is set to Boxed
   ========================================================================== */
.elementor-section:has(.ost-hero-section),
.elementor-section:has(.elementor-widget-ost-hero),
.e-con:has(.ost-hero-section),
.e-con:has(.elementor-widget-ost-hero),
.e-container:has(.ost-hero-section),
.e-container:has(.elementor-widget-ost-hero) {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.elementor-section:has(.ost-hero-section) > .elementor-container,
.elementor-section:has(.elementor-widget-ost-hero) > .elementor-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.elementor-section:has(.ost-hero-section) .elementor-column,
.elementor-section:has(.ost-hero-section) .elementor-widget-wrap,
.elementor-section:has(.elementor-widget-ost-hero) .elementor-column,
.elementor-section:has(.elementor-widget-ost-hero) .elementor-widget-wrap {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ost-hero-section {
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .ost-hotline-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }
  .ost-hotline-btn span {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
  }
}
