/* =========================================================
   Xanh Toàn Cầu — Landing Page
   Phong cách: Xanh · Bền vững · Hiện đại
   ========================================================= */

:root {
  --primary: #006241;
  --primary-dark: #004d33;
  --primary-soft: #e6f3ee;
  --accent: #76C043;
  --accent-glow: rgba(118, 192, 67, 0.45);
  --bg: #ffffff;
  --sage: #f4f7f5;
  --text: #1f2937;
  --muted: #4b5563;
  --line: #d7e2dc;
  --header-h: 80px;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(0, 98, 65, 0.1);
  --shadow-lg: 0 20px 48px rgba(0, 98, 65, 0.16);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Montserrat", "Inter", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

.container {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

.skip-link:focus { top: 12px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 13px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 98, 65, 0.28);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 28px rgba(0, 98, 65, 0.36);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.btn-cta {
  background: var(--accent);
  color: #143018;
  padding: 10px 16px;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px var(--accent-glow);
}

.btn-cta:hover { background: #86d04f; }

.btn-sm {
  background: #fff;
  color: var(--primary);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-block { width: 100%; }

/* ---------- Header kính mờ (glassmorphic) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(0, 98, 65, 0.08);
  transition: box-shadow 0.3s, background 0.3s, height 0.3s;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(0, 98, 65, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.header-inner > * {
  pointer-events: auto;
}

.main-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: auto;
}

main section[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}

.brand-img {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(220px, 46vw);
  object-fit: contain;
}

.nav-list {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  position: relative;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--primary);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.menu-toggle {
  display: flex;
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--primary);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

@media (min-width: 861px) {
  .menu-toggle { display: none; }
}

.menu-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* Hamburger → dấu X */
.menu-toggle.is-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Hero full-bleed ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}

.hero-media,
.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-overlay {
  background:
    linear-gradient(110deg, rgba(0, 40, 28, 0.82) 0%, rgba(0, 98, 65, 0.55) 48%, rgba(0, 30, 20, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 80px 0 100px;
  max-width: 860px;
  margin-left: max(20px, calc((100% - 1160px) / 2));
  width: min(860px, calc(100% - 40px));
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(118, 192, 67, 0.55);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 18px 0 18px;
  text-wrap: balance;
}

.hero-lead {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Section chung ---------- */
.section { padding: 96px 0; }

.section--sage { background: var(--sage); }

.section-header {
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-eyebrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  color: var(--primary);
}

.section-header h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
}

.section-desc { color: var(--muted); }

/* ---------- Giới thiệu & sơ đồ tổ chức ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-copy p { color: var(--muted); }
.about-copy strong { color: var(--text); }

.about-highlights {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.about-highlights li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--text);
}

.about-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.director-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 16px;
  background: var(--sage);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.director-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
}

.director-card figcaption { display: flex; flex-direction: column; }
.director-card span { color: var(--muted); font-size: 0.9rem; }

.org-chart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 20px;
  box-shadow: var(--shadow);
}

.org-label {
  text-align: center;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.org-level,
.org-depts,
.org-teams {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.org-node {
  background: var(--sage);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 140px;
  text-align: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
  cursor: default;
}

.org-node:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px var(--accent-glow);
}

.org-node h3 {
  font-size: 0.82rem;
  margin: 0;
  color: var(--primary);
}

.org-node p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.org-node--top {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  min-width: 200px;
}

.org-node--top h3,
.org-node--top p { color: #fff; }

.org-node--mid {
  background: var(--primary-soft);
  border-color: #b7d4c6;
  min-width: 180px;
}

.org-node--team {
  background: #fff;
  border-style: dashed;
}

.org-line {
  display: block;
  width: 2px;
  height: 18px;
  background: var(--accent);
  margin: 6px auto;
}

.org-line--branch {
  width: 72%;
  height: 2px;
  position: relative;
}

.org-line--branch::before,
.org-line--branch::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 14px;
  background: var(--accent);
}

.org-line--branch::before { top: -14px; }
.org-line--branch::after { bottom: -14px; }

.org-depts { margin-top: 16px; }
.org-teams { margin-top: 12px; }

/* ---------- Dịch vụ ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.service-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px 20px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 36px var(--accent-glow);
}

.service-card--featured {
  grid-column: span 1;
  background: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
  border-color: #b7d4c6;
}

.service-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #143018;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.service-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--sage);
  margin-bottom: 14px;
}

.service-card h3 {
  font-size: 0.98rem;
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Năng lực — counter ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.stat-card {
  text-align: center;
  padding: 36px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, var(--sage));
  border: 1px solid var(--line);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 0 0 10px;
}

.stat-card h3 { font-size: 1.05rem; }
.stat-card p { color: var(--muted); margin: 0; font-size: 0.92rem; }

/* ---------- Portfolio ---------- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  transition: opacity 0.35s, transform 0.35s;
}

.project-card.is-hidden {
  display: none;
}

.project-card figure {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 40, 28, 0.82));
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s, transform 0.35s;
}

.project-overlay h3 {
  color: #fff;
  font-size: 1.05rem;
  margin: 0;
}

.project-card:hover img { transform: scale(1.08); }
.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay {
  opacity: 1;
  transform: none;
}

/* ---------- Liên hệ ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.contact-form-wrap,
.contact-info {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.contact-form-wrap h3,
.contact-info h3 {
  color: var(--primary);
  margin-bottom: 18px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--sage);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: #b42318;
  background: #fff5f4;
}

.field-error {
  min-height: 1.2em;
  margin: 4px 0 0;
  color: #b42318;
  font-size: 0.8rem;
}

.contact-info address {
  font-style: normal;
  color: var(--muted);
}

.contact-info a { font-weight: 600; }

.map-frame {
  margin: 20px 0 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.map-frame iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

.map-frame figcaption {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--sage);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #003827;
  color: rgba(255, 255, 255, 0.82);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img,
.footer-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
}

.footer-brand strong {
  display: block;
  color: #fff;
}

.footer-brand p {
  margin: 0;
  font-size: 0.75rem;
  max-width: 360px;
}

.copyright { margin: 0; font-size: 0.9rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 14, 0.72);
  backdrop-filter: blur(6px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.35s var(--ease);
}

.lightbox-dialog img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.lightbox-dialog h3,
.lightbox-dialog p { padding: 0 22px; }

.lightbox-dialog h3 { margin-top: 18px; color: var(--primary); }
.lightbox-dialog p { color: var(--muted); padding-bottom: 24px; }

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 160px;
  z-index: 220;
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: min(360px, calc(100% - 32px));
  animation: fadeInUp 0.35s var(--ease);
}

.toast[hidden] { display: none; }

/* ---------- Nút Zalo nổi ---------- */
.zalo-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 91;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 54px;
  height: 54px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: #0068ff;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 104, 255, 0.38);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.zalo-float:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 104, 255, 0.48);
  color: #fff;
}

.zalo-float-icon { flex-shrink: 0; }

.zalo-float-label { font-size: 0.95rem; }

@media (max-width: 640px) {
  .zalo-float { padding: 0; width: 54px; justify-content: center; }
  .zalo-float-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.zalo-text-link { color: #0068ff; }

/* ---------- Nút về đầu trang ---------- */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.3s var(--ease);
  box-shadow: 0 8px 20px rgba(0, 98, 65, 0.3);
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.scroll-top:hover { background: var(--primary-dark); }

/* ---------- Scroll Reveal (chỉ ẩn khi JS đã bật) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .header-cta span { display: none; }
  .header-cta {
    padding: 10px;
    min-width: 44px;
    flex-shrink: 0;
  }

  .menu-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: auto;
    right: 0;
    width: min(320px, 86vw);
    height: calc(100vh - var(--header-h));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: -12px 0 32px rgba(0, 40, 28, 0.12);
    transform: translateX(110%);
    transition: transform 0.4s var(--ease);
    padding: 24px 18px;
    z-index: 120;
  }

  .main-nav.is-open { transform: none; }

  .nav-list {
    flex-direction: column;
    gap: 4px;
  }

  .nav-link { padding: 12px 14px; font-size: 1.05rem; }

  .about-grid,
  .contact-grid,
  .stat-grid { grid-template-columns: 1fr; }

  .hero-content { margin-left: 20px; }

  .org-depts { grid-template-columns: 1fr 1fr; display: grid; }
}

@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .service-grid,
  .portfolio-grid,
  .org-depts { grid-template-columns: 1fr; }

  .project-overlay {
    opacity: 1;
    transform: none;
  }

  .lightbox-dialog img { height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal,
  .btn,
  .service-card,
  .project-card img,
  .project-overlay {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
