/* ==========================================================================
   1. CMS - APTC DESIGN TOKENS (from FE/cms/src/theme/core/colors.json & palette.js)
   ========================================================================== */
:root {
  /* Fonts */
  --font-primary: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Primary Palette (Emerald) */
  --primary-lighter: #C8FAD6;
  --primary-light: #5BE49B;
  --primary-main: #00A76F;
  --primary-dark: #007867;
  --primary-darker: #004B50;
  --primary-rgb: 0, 167, 111;

  /* Secondary Palette (Purple) */
  --secondary-lighter: #EFD6FF;
  --secondary-light: #C684FF;
  --secondary-main: #8E33FF;
  --secondary-dark: #5119B7;
  --secondary-darker: #27097A;
  --secondary-rgb: 142, 51, 255;

  /* Info Palette (Cyan) */
  --info-lighter: #CAFDF5;
  --info-light: #61F3F3;
  --info-main: #00B8D9;
  --info-dark: #006C9C;
  --info-darker: #003768;
  --info-rgb: 0, 184, 217;

  /* Success Palette */
  --success-lighter: #D3FCD2;
  --success-light: #77ED8B;
  --success-main: #22C55E;
  --success-dark: #118D57;
  --success-darker: #065E49;
  --success-rgb: 34, 197, 94;

  /* Warning Palette (Amber) */
  --warning-lighter: #FFF5CC;
  --warning-light: #FFD666;
  --warning-main: #FFAB00;
  --warning-dark: #B76E00;
  --warning-darker: #7A4100;
  --warning-rgb: 255, 171, 0;

  /* Error Palette */
  --error-lighter: #FFE9D5;
  --error-light: #FFAC82;
  --error-main: #FF5630;
  --error-dark: #B71D18;
  --error-darker: #7A0916;
  --error-rgb: 255, 86, 48;

  /* Grey Scale */
  --grey-50: #FCFDFD;
  --grey-100: #F9FAFB;
  --grey-200: #F4F6F8;
  --grey-300: #DFE3E8;
  --grey-400: #C4CDD5;
  --grey-500: #919EAB;
  --grey-600: #637381;
  --grey-700: #454F5B;
  --grey-800: #1C252E;
  --grey-900: #141A21;
  --grey-500-rgb: 145, 158, 171;

  /* Light Mode Semantic Tokens */
  --bg-default: #FFFFFF;
  --bg-paper: #FFFFFF;
  --bg-neutral: #F4F6F8;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --text-primary: #1C252E;
  --text-primary-rgb: 28, 37, 46;
  --text-secondary: #637381;
  --text-disabled: #919EAB;
  --divider: rgba(145, 158, 171, 0.2);
  --border-subtle: rgba(145, 158, 171, 0.16);
  --action-hover: rgba(145, 158, 171, 0.08);
  --action-selected: rgba(145, 158, 171, 0.16);

  /* CMS Custom Shadows (from FE/cms/src/theme/core/custom-shadows.js) */
  --shadow-z1: 0 1px 2px 0 rgba(145, 158, 171, 0.16);
  --shadow-z4: 0 4px 8px 0 rgba(145, 158, 171, 0.16);
  --shadow-z8: 0 8px 16px 0 rgba(145, 158, 171, 0.16);
  --shadow-z16: 0 16px 32px -4px rgba(145, 158, 171, 0.16);
  --shadow-z24: 0 24px 48px 0 rgba(145, 158, 171, 0.16);
  --shadow-card: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 12px 24px -4px rgba(145, 158, 171, 0.12);
  --shadow-dropdown: 0 0 2px 0 rgba(145, 158, 171, 0.24), -20px 20px 40px -4px rgba(145, 158, 171, 0.24);
  --shadow-dialog: -40px 40px 80px -8px rgba(0, 0, 0, 0.24);
  --shadow-primary: 0 8px 16px 0 rgba(0, 167, 111, 0.24);
  --shadow-secondary: 0 8px 16px 0 rgba(142, 51, 255, 0.24);
  --shadow-info: 0 8px 16px 0 rgba(0, 184, 217, 0.24);
  --shadow-warning: 0 8px 16px 0 rgba(255, 171, 0, 0.24);
  --shadow-error: 0 8px 16px 0 rgba(255, 86, 48, 0.24);

  /* Layout & Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 16px;
  --radius-xl: 24px;
  --header-height: 72px;
  --container-max: 1200px;
}

html[data-theme="dark"] {
  --bg-default: #141A21;
  --bg-paper: #1C252E;
  --bg-neutral: #28323D;
  --bg-glass: rgba(20, 26, 33, 0.82);
  --text-primary: #FFFFFF;
  --text-primary-rgb: 255, 255, 255;
  --text-secondary: #919EAB;
  --text-disabled: #637381;
  --divider: rgba(145, 158, 171, 0.2);
  --border-subtle: rgba(145, 158, 171, 0.14);
  --shadow-card: 0 0 2px 0 rgba(0, 0, 0, 0.32), 0 12px 24px -4px rgba(0, 0, 0, 0.28);
  --shadow-z8: 0 8px 16px 0 rgba(0, 0, 0, 0.36);
  --shadow-z16: 0 16px 32px -4px rgba(0, 0, 0, 0.44);
  --shadow-z24: 0 24px 48px 0 rgba(0, 0, 0, 0.52);
}

/* ==========================================================================
   2. BASELINE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-default);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

ul {
  list-style: none;
}

img, svg {
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   3. CMS ARCHITECTURAL SVG DECORATIONS (FloatLine, FloatPlusIcon)
   ========================================================================== */
.cms-section {
  position: relative;
  padding: 96px 0;
  overflow: hidden;
}

.cms-section--neutral {
  background-color: var(--bg-neutral);
}

.float-line-h {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background-image: linear-gradient(to right, rgba(145, 158, 171, 0.28) 50%, transparent 50%);
  background-size: 6px 1px;
  pointer-events: none;
  z-index: 1;
}

.float-line-v {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background-image: linear-gradient(to bottom, rgba(145, 158, 171, 0.28) 50%, transparent 50%);
  background-size: 1px 6px;
  pointer-events: none;
  z-index: 1;
  display: none;
}

.float-plus {
  position: absolute;
  width: 16px;
  height: 16px;
  color: var(--grey-500);
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
  display: none;
}

@media (min-width: 1360px) {
  .float-line-v, .float-plus {
    display: block;
  }
}

/* ==========================================================================
   4. CMS TYPOGRAPHY & SECTION TITLES (FE/cms/src/sections/home/components/section-title.jsx)
   ========================================================================== */
.section-header {
  max-width: 680px;
  margin-bottom: 64px;
}

.section-header--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text-disabled);
  margin-bottom: 16px;
}

.section-caption__dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-main);
  box-shadow: 0 0 0 4px rgba(0, 167, 111, 0.16);
}

.section-title {
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.txt-gradient-faded {
  display: inline-block;
  background: linear-gradient(to right, var(--text-primary), rgba(var(--text-primary-rgb), 0.22));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.txt-gradient-brand {
  background: linear-gradient(
    300deg,
    var(--primary-main) 0%,
    var(--warning-main) 25%,
    var(--primary-main) 50%,
    var(--warning-main) 75%,
    var(--primary-main) 100%
  );
  background-size: 400% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cmsGradientFlow 18s linear infinite alternate;
}

@keyframes cmsGradientFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.section-description {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ==========================================================================
   5. CMS BUTTONS & SOFT CHIPS (FE/cms/src/theme/core/components/button.jsx & chip.jsx)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.71;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn--lg {
  height: 48px;
  padding: 0 22px;
  font-size: 0.9375rem;
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

/* MuiButton contained inherit (dark solid in light mode, white in dark mode) */
.btn--contained-inherit {
  background-color: var(--grey-800);
  color: #FFFFFF;
}
.btn--contained-inherit:hover {
  background-color: var(--grey-700);
  box-shadow: var(--shadow-z8);
  transform: translateY(-1px);
}
html[data-theme="dark"] .btn--contained-inherit {
  background-color: #FFFFFF;
  color: var(--grey-800);
}
html[data-theme="dark"] .btn--contained-inherit:hover {
  background-color: var(--grey-300);
}

/* MuiButton contained primary */
.btn--contained-primary {
  background-color: var(--primary-main);
  color: #FFFFFF;
}
.btn--contained-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

/* MuiButton soft primary */
.btn--soft-primary {
  background-color: rgba(var(--primary-rgb), 0.16);
  color: var(--primary-dark);
}
html[data-theme="dark"] .btn--soft-primary {
  color: var(--primary-light);
}
.btn--soft-primary:hover {
  background-color: rgba(var(--primary-rgb), 0.28);
}

/* MuiButton outlined */
.btn--outlined {
  background-color: transparent;
  border-color: rgba(var(--grey-500-rgb), 0.32);
  color: var(--text-primary);
}
.btn--outlined:hover {
  border-color: currentColor;
  box-shadow: 0 0 0 0.75px currentColor;
  background-color: var(--action-hover);
}

/* CMS Soft Badges / Chips */
.cms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cms-chip--primary {
  background-color: rgba(var(--primary-rgb), 0.16);
  color: var(--primary-dark);
}
html[data-theme="dark"] .cms-chip--primary { color: var(--primary-light); }

.cms-chip--secondary {
  background-color: rgba(var(--secondary-rgb), 0.16);
  color: var(--secondary-dark);
}
html[data-theme="dark"] .cms-chip--secondary { color: var(--secondary-light); }

.cms-chip--info {
  background-color: rgba(var(--info-rgb), 0.16);
  color: var(--info-dark);
}
html[data-theme="dark"] .cms-chip--info { color: var(--info-light); }

.cms-chip--success {
  background-color: rgba(var(--success-rgb), 0.16);
  color: var(--success-dark);
}
html[data-theme="dark"] .cms-chip--success { color: var(--success-light); }

.cms-chip--warning {
  background-color: rgba(var(--warning-rgb), 0.16);
  color: var(--warning-dark);
}
html[data-theme="dark"] .cms-chip--warning { color: var(--warning-light); }

.cms-chip--error {
  background-color: rgba(var(--error-rgb), 0.16);
  color: var(--error-dark);
}
html[data-theme="dark"] .cms-chip--error { color: var(--error-light); }

/* ==========================================================================
   6. HEADER / NAVBAR (FE/cms/src/layouts/core/header-base.jsx)
   ========================================================================== */
.cms-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
}

.cms-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand__badge {
  font-family: var(--font-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(var(--info-rgb), 0.16);
  color: var(--info-dark);
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="dark"] .brand__badge {
  color: var(--info-light);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
}

@media (min-width: 960px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-main);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-main);
}

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

/* Language Switcher (?lang=vi | ?lang=en) */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-neutral);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

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

.lang-btn.active {
  background-color: var(--bg-paper);
  color: var(--primary-main);
  box-shadow: var(--shadow-z1);
}

/* Theme Toggle IconButton */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-paper);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--action-hover);
  color: var(--text-primary);
  transform: rotate(12deg);
}

@media (max-width: 680px) {
  :root {
    --header-height: 64px;
  }
  .container {
    padding: 0 16px;
  }
  .cms-section {
    padding: 64px 0;
  }
  .brand {
    gap: 8px;
    font-size: 1.0625rem;
  }
  .brand__logo {
    width: 30px;
    height: 30px;
  }
  .brand__badge {
    display: none;
  }
  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .header-actions > .btn {
    display: none;
  }
  .lang-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
}


/* ==========================================================================
   13. FOOTER (FE/cms/src/layouts/main/footer.jsx)
   ========================================================================== */
.cms-footer {
  background-color: var(--bg-default);
  border-top: 1px solid var(--divider);
  padding: 72px 0 40px;
}

.cms-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 56px;
}

@media (max-width: 860px) {
  .cms-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .cms-footer__grid {
    grid-template-columns: 1fr;
  }
}

.cms-footer__headline {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.cms-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cms-footer__link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.18s ease;
}

.cms-footer__link:hover {
  color: var(--primary-main);
}

.cms-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 12px;
}
