/**
 * VNPT TP.HỒ CHÍ MINH — DESIGN SYSTEM 2026
 * File: assets/css/base.css
 * Tiêu chuẩn nền tảng, Typography, Reset ngữ nghĩa & Hỗ trợ tiếp cận (a11y)
 */

/* ==========================================================================
   1. RESET & BOX MODEL CHUẨN HÓA
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--font-weight-regular);
  color: var(--vnpt-text, #0f172a);
  background-color: var(--vnpt-bg, #ffffff);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  accent-color: var(--vnpt-primary);
}

::selection {
  color: #ffffff;
  background: var(--vnpt-primary);
}

/* ==========================================================================
   2. TYPOGRAPHY & HEADING HIERARCHY
   ========================================================================== */
h1, h2, .display-title, .hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--vnpt-text);
  margin-top: 0;
  margin-bottom: var(--space-4);
  text-wrap: balance;
}

h3, h4, h5, h6, .card-title {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--vnpt-text);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.metric-number {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}

.pricing-value, .table-data-numeric, .numeric-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--vnpt-text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--text-sm);
}

a {
  color: var(--vnpt-primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--vnpt-primary-dark);
}

/* ==========================================================================
   3. MEDIA & EMBEDS (CHỐNG TRÀN LAYOUT)
   ========================================================================== */
img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   4. FORM CONTROLS NỀN TẢNG
   ========================================================================== */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button, .btn, .nav-link {
  font-weight: 600;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  min-height: 44px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--vnpt-text-muted);
  opacity: 0.86;
}

/* Fix mũi tên dư trong ô nhập số */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ==========================================================================
   5. HỖ TRỢ TIẾP CẬN (ACCESSIBILITY - WCAG 2.2 AA)
   ========================================================================== */
/* Bỏ qua điều hướng để vào nội dung chính */
.site-skip-link {
  position: fixed;
  z-index: 9999;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: #ffffff;
  background: var(--vnpt-dark-navy);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-floating);
}

.site-skip-link:focus {
  transform: translateY(0);
  color: #ffffff;
  outline: 3px solid var(--vnpt-cyan);
  outline-offset: 2px;
}

/* Viền chỉ báo phím Tab rõ ràng, không che khuất nội dung */
:focus-visible {
  outline: 3px solid var(--vnpt-primary);
  outline-offset: 2px;
  box-shadow: var(--vnpt-focus-ring);
}

/* Không để nội dung dài phá vỡ viewport trên mobile. */
:where(p, li, h1, h2, h3, h4, h5, h6, code, pre) {
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  input, select, textarea {
    font-size: 1rem;
  }
}

/* Tôn trọng tùy chọn giảm chuyển động của người dùng */
@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;
    scroll-behavior: auto !important;
  }
}
