/* ==========================================================================
   VIETTEL DAK LAK 2026 - UNIFIED ENTERPRISE DESIGN SYSTEM
   Standard: Professional, Clean, Trustworthy, High-Readability & Modern Viettel Telecom
   ========================================================================== */

/* ═══ 1. DESIGN TOKENS & SYSTEM VARIABLES ═══ */
:root {
  /* Canvas & Layout Surfaces */
  --background: #ffffff;
  --background-subtle: #f8fafc;
  --background-section: #f1f5f9;
  --card: #ffffff;
  
  /* Text & Typography Contrast */
  --foreground: #111827;           /* Primary text - WCAG AAA */
  --foreground-secondary: #374151; /* Body text - WCAG AA */
  --foreground-muted: #4b5563;     /* Supporting text - High readability */
  --muted: #6b7280;                /* Secondary captions */
  
  /* Borders & Dividers */
  --border: #e5e7eb;               /* Standard structural border */
  --border-strong: #d1d5db;        /* Form & input border */
  --border-focus: #ee0033;         /* Interactive focus ring */
  
  /* Viettel Official Brand Palette */
  --primary: #ee0033;              /* Viettel Red */
  --primary-hover: #c70028;
  --primary-active: #a80020;
  --primary-light: #ff2d55;
  --primary-soft: #fff1f3;
  --primary-border: #ffccd3;
  --primary-glow: rgba(238, 0, 51, 0.16);
  
  /* Functional Status Palette */
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --error: #dc2626;
  --error-soft: #fef2f2;
  --error-border: #fecaca;
  
  /* Geometric Radius */
  --radius-xs: 0.375rem; /* 6px */
  --radius-sm: 0.5rem;   /* 8px */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-xl: 1.25rem;  /* 20px */
  --radius-2xl: 1.5rem;  /* 24px */
  --radius-pill: 9999px;
  --radius: 1rem;
  
  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-primary: 0 4px 14px -2px rgba(238, 0, 51, 0.28);
  --shadow-primary-lg: 0 8px 24px -4px rgba(238, 0, 51, 0.40);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  
  /* Safe Areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ═══ 2. BASE TYPOGRAPHY & READABILITY ═══ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  position: relative;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background-color: var(--background);
  color: var(--foreground-secondary);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Clear Heading Hierarchy with Maximum Readability */
h1, .h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

h2, .h2 {
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

h3, .h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

h4, .h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.4;
}

p {
  color: var(--foreground-secondary);
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.62;
}

/* ═══ 2.1 UNIVERSAL HIGH-CONTRAST & TEXT SHIELD SYSTEM ═══ */

/* A. Crisp Pure White Utility (Never blend into dark backgrounds) */
.text-white,
h1.text-white, h2.text-white, h3.text-white, h4.text-white, h5.text-white, h6.text-white,
p.text-white, span.text-white, a.text-white, li.text-white, div.text-white,
button.text-white, label.text-white {
  color: #ffffff !important;
}

/* B. Safe High-Contrast Palette for Light Surfaces */
.text-gray-600 { color: #374151; }
.text-gray-700 { color: #1f2937; }
.text-gray-800 { color: #111827; }
.text-gray-900 { color: #0f172a; }

/* C. Light Gray Shades for Dark Surfaces */
.text-gray-50  { color: #f9fafb !important; }
.text-gray-100 { color: #f3f4f6 !important; }
.text-gray-200 { color: #e5e7eb !important; }
.text-gray-300 { color: #d1d5db !important; }

/* D. Colored Pastel Accents (Ensure visible against dark or light bg) */
.text-red-100 { color: #fee2e2 !important; }
.text-red-200 { color: #fecaca !important; }
.text-red-300 { color: #fca5a5 !important; }
.text-red-400 { color: #f87171 !important; }
.text-red-500 { color: #ef4444 !important; }
.text-red-600 { color: #dc2626 !important; }

.text-emerald-100 { color: #d1fae5 !important; }
.text-emerald-200 { color: #a7f3d0 !important; }
.text-emerald-300 { color: #6ee7b7 !important; }
.text-emerald-400 { color: #34d399 !important; }

.text-blue-100 { color: #dbeafe !important; }
.text-blue-200 { color: #bfdbfe !important; }
.text-blue-300 { color: #93c5fd !important; }
.text-blue-400 { color: #60a5fa !important; }

.text-purple-100 { color: #f3e8ff !important; }
.text-purple-200 { color: #e9d5ff !important; }
.text-purple-300 { color: #d8b4fe !important; }
.text-purple-400 { color: #c084fc !important; }

.text-amber-100 { color: #fef3c7 !important; }
.text-amber-200 { color: #fde68a !important; }
.text-amber-300 { color: #fcd34d !important; }
.text-amber-400 { color: #fbbf24 !important; }

/* ═══ 2.2 DARK CONTAINER ISOLATION & SHIELDING ═══ */
/* Every text element inside dark containers is GUARANTEED high contrast */
.bg-gray-900,
.bg-gray-950,
.bg-black,
.bg-slate-900,
.bg-slate-950,
[class*="bg-gray-9"],
[class*="bg-black"],
[class*="from-black"],
[class*="from-gray-9"],
[class*="from-slate-9"],
[class*="from-red-9"],
[class*="from-purple-9"],
[class*="from-emerald-9"],
footer,
.quote-live-sidebar {
  color: #e5e7eb;
}

/* Headings inside dark containers MUST be Crisp White */
.bg-gray-900 h1, .bg-gray-900 h2, .bg-gray-900 h3, .bg-gray-900 h4, .bg-gray-900 h5, .bg-gray-900 h6,
.bg-gray-950 h1, .bg-gray-950 h2, .bg-gray-950 h3, .bg-gray-950 h4, .bg-gray-950 h5, .bg-gray-950 h6,
.bg-black h1, .bg-black h2, .bg-black h3, .bg-black h4, .bg-black h5, .bg-black h6,
.bg-slate-900 h1, .bg-slate-900 h2, .bg-slate-900 h3, .bg-slate-900 h4,
[class*="bg-gray-9"] h1, [class*="bg-gray-9"] h2, [class*="bg-gray-9"] h3, [class*="bg-gray-9"] h4,
[class*="from-black"] h1, [class*="from-black"] h2, [class*="from-black"] h3, [class*="from-black"] h4,
[class*="from-gray-9"] h1, [class*="from-gray-9"] h2, [class*="from-gray-9"] h3, [class*="from-gray-9"] h4,
[class*="from-red-9"] h1, [class*="from-red-9"] h2, [class*="from-red-9"] h3, [class*="from-red-9"] h4,
[class*="from-purple-9"] h1, [class*="from-purple-9"] h2, [class*="from-purple-9"] h3, [class*="from-purple-9"] h4,
[class*="from-emerald-9"] h1, [class*="from-emerald-9"] h2, [class*="from-emerald-9"] h3, [class*="from-emerald-9"] h4,
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6,
.quote-live-sidebar h1, .quote-live-sidebar h2, .quote-live-sidebar h3, .quote-live-sidebar h4 {
  color: #ffffff !important;
}

/* Paragraphs in dark containers */
.bg-gray-900 p,
.bg-gray-950 p,
.bg-black p,
.bg-slate-900 p,
[class*="bg-gray-9"] p,
[class*="from-black"] p,
[class*="from-gray-9"] p,
[class*="from-red-9"] p,
[class*="from-purple-9"] p,
[class*="from-emerald-9"] p,
footer p {
  color: #d1d5db !important;
}

/* Strong / Bold in dark containers */
.bg-gray-900 strong, .bg-gray-950 strong, .bg-black strong, footer strong,
.bg-gray-900 b, .bg-gray-950 b, .bg-black b, footer b,
[class*="from-black"] strong, [class*="from-gray-9"] strong,
.quote-live-sidebar strong {
  color: #ffffff !important;
}

/* Gray utilities in dark containers */
.bg-gray-900 .text-gray-300,
.bg-gray-950 .text-gray-300,
.bg-black .text-gray-300,
[class*="from-black"] .text-gray-300,
[class*="bg-gray-9"] .text-gray-300,
footer .text-gray-300 {
  color: #e5e7eb !important;
}

.bg-gray-900 .text-gray-400,
.bg-gray-950 .text-gray-400,
.bg-black .text-gray-400,
[class*="from-black"] .text-gray-400,
[class*="from-gray-9"] .text-gray-400,
[class*="from-red-9"] .text-gray-400,
[class*="from-purple-9"] .text-gray-400,
[class*="from-emerald-9"] .text-gray-400,
footer .text-gray-400,
#custFormContainer .text-gray-400 {
  color: #cbd5e1 !important;
}

.bg-gray-900 .text-gray-500,
.bg-gray-950 .text-gray-500,
.bg-black .text-gray-500,
footer .text-gray-500,
.bg-gray-900 .text-gray-600,
.bg-gray-950 .text-gray-600,
.bg-black .text-gray-600,
footer .text-gray-600 {
  color: #9ca3af !important;
}

/* Links inside footer and dark sections */
footer a:not(.btn-market-primary):not(.btn-primary) {
  color: #d1d5db;
}
footer a:not(.btn-market-primary):not(.btn-primary):hover {
  color: #ffffff !important;
}

/* Top utility bar separators */
.bg-gray-900 .text-gray-600 {
  color: #6b7280 !important;
}

/* ═══ 3. FORM CONTROLS & INPUT SYSTEM ═══ */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-size: 15px !important;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  outline: none !important;
  box-shadow: var(--shadow-xs);
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder {
  color: #9ca3af !important;
  font-weight: 400;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  background-color: #ffffff !important;
}

/* Form Labels */
label,
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

/* On dark containers, label must be light and legible */
.bg-gray-900 label,
.bg-gray-950 label,
.bg-black label,
footer label,
#custFormContainer label {
  color: #f3f4f6 !important;
}

/* Checkbox & Radio Alignment */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ═══ 4. BUTTON SYSTEM ═══ */
/* Primary Button: Viettel Red */
.btn-market-primary,
.btn-vt-primary,
.btn-primary {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none;
}

.btn-market-primary *,
.btn-vt-primary *,
.btn-primary * {
  color: #ffffff !important;
}

.btn-market-primary:hover,
.btn-vt-primary:hover,
.btn-primary:hover,
.bg-primary-container,
.hover\:bg-primary-container:hover {
  background-color: var(--primary-hover) !important;
  box-shadow: var(--shadow-primary-lg) !important;
  color: #ffffff !important;
}

.btn-market-primary:active,
.btn-vt-primary:active,
.btn-primary:active {
  background-color: var(--primary-active) !important;
  transform: scale(0.98);
}

.btn-market-primary:disabled,
.btn-vt-primary:disabled,
.btn-primary:disabled {
  background-color: #e5e7eb !important;
  color: #9ca3af !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none;
}

/* Secondary Button: Clean White with Strong Border */
.btn-secondary,
.btn-market-secondary {
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover,
.btn-market-secondary:hover {
  background-color: var(--background-subtle) !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

/* ═══ 5. CARD, BOX & CONTAINER SPECIFICATIONS ═══ */
.card-vt,
.marketplace-card,
.prod-card,
.feature-card {
  background-color: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease;
  overflow: hidden;
}

.marketplace-card:hover,
.prod-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border) !important;
  transform: translateY(-2px);
}

/* Equal-Height Card Alignment in Grids */
.marketplace-card,
.prod-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
}

/* Prominent Pricing Typography */
.card-price-main,
.price-tag-vt {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--primary);
  line-height: 1.2;
}

.card-price-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--foreground-muted);
}

/* ═══ 6. IMAGE CONTAINERS (STRICT ASPECT RATIOS & ALIGNMENT) ═══ */
/* Universal Image Container Rules */
.img-wrap,
.img-container,
.card-image-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
  background-color: var(--background-section);
  display: block;
}

/* Service & Feature Cards: 16:9 */
.img-ratio-16-9,
.card-img-16-9,
[class*="aspect-[16/9]"] {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
}

/* Articles & Thumbnails: 4:3 */
.img-ratio-4-3,
.card-img-4-3,
[class*="aspect-[4/3]"] {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
}

/* Hero / Wide Banners: 21:9 (Desktop) */
.banner-img-wrap,
[class*="aspect-[21/9]"] {
  aspect-ratio: 21 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
}

/* Mobile Banner: 16:10 */
@media (max-width: 639px) {
  .banner-img-wrap,
  [class*="aspect-[16/10]"] {
    aspect-ratio: 16 / 10;
  }
}

/* Internal image fill without distortion */
.img-cover,
.card-img-16-9 img,
.card-img-4-3 img,
[class*="aspect-[16/9]"] img,
[class*="aspect-[4/3]"] img,
[class*="aspect-[21/9]"] img,
[class*="aspect-[16/10]"] img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Logos & Icons: contain to avoid cropping */
.img-contain,
.logo-wrap img,
.icon-box img {
  object-fit: contain !important;
  width: 100%;
  height: 100%;
}

/* ═══ 7. PRICING TABLE & CATALOG ENHANCEMENTS ═══ */
.pricing-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

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

.pricing-table th {
  background-color: var(--background-section);
  color: var(--foreground);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.pricing-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground-secondary);
  vertical-align: middle;
}

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

.pricing-table tr:hover td {
  background-color: var(--background-subtle);
}

/* ═══ 8. HEADER, SEARCH & MOBILE BOTTOM BAR ═══ */
header.glass-header {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.glass-bottom-bar {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.85);
}

/* Category Pill Navigation */
.cat-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 700;
}

.cat-pill.active {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-primary);
}

/* ═══ 9. RESPONSIVE BREAKPOINTS & SPACING ═══ */
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  
  .marketplace-card,
  .prod-card {
    padding: 16px !important;
    border-radius: var(--radius-md) !important;
  }
  
  /* Prevent horizontal scroll */
  main, section {
    max-width: 100vw;
    overflow-x: clip;
  }
}
