:root{
  --bg:#ffffff;
  --fg:#0f172a;
  --muted:#475569;
  --line:#e2e8f0;
  --card:#f8fafc;
  --accent:#1f6f8b;
  --accent2:#0b5d76;
  --shadow:0 12px 30px rgba(2,6,23,.08);
  --radius:20px;
  --container:1100px;
  /* Giá trị mặc định nếu JS chưa chạy kịp */
  --header-offset: 80px; 
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;} /* Xóa scroll-padding-top ở html để quản lý ở section */

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--fg);
  background:var(--bg);
  line-height:1.65;
}
img{max-width:100%;display:block}

.container{
  width:min(var(--container), calc(100% - 2rem));
  margin-inline:auto;
}

.skip{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;height:1px;
  overflow:hidden;
}
.skip:focus{
  left:1rem; top:1rem;
  width:auto; height:auto;
  padding:.6rem .8rem;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:12px;
  z-index:9999;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(255,255,255,.95); /* Tăng độ đậm nền để tránh rối mắt */
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid rgba(226,232,240,.7);
}
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.9rem 0;
}
.header__left{display:flex;align-items:center;gap:.55rem;min-width:0}
.brand{
  text-decoration:none;
  color:var(--fg);
  font-weight:700;
  letter-spacing:-.02em;
  display:flex;
  align-items:baseline;
  gap:.35rem;
  white-space:nowrap;
}
.brand__name,.brand__cred{font-size:1.05rem}

.header__actions{
  display:flex;
  align-items:center;
  gap:.45rem;
  flex-wrap:nowrap;
  margin-left:.15rem;
}

.nav{
  display:flex;
  align-items:center;
  gap:1.1rem;
}
.nav a{
  color:var(--accent);
  text-decoration:none; /* Bỏ gạch chân mặc định cho sạch */
  font-weight:500;
  letter-spacing:-.01em;
  padding:.35rem .5rem;
  transition: all 0.2s;
  border-radius: 6px;
}
.nav a:hover { color: var(--accent2); background: rgba(31,111,139,0.05); }
.nav a.active{
  color:var(--accent2); 
  font-weight: 700;
  background: rgba(31,111,139,0.1); /* Highlight active link */
}

/* Icon buttons */
.icon-btn{
  width:44px;
  height:44px;
  border-radius:999px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--accent2);
  text-decoration:none;
  box-shadow:0 6px 18px rgba(2,6,23,.06);
  transition:transform .15s ease, box-shadow .15s ease;
}
.icon-btn:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(2,6,23,.10)}
.icon-btn i{font-size:1.15rem}
.icon-btn--sm{width:36px;height:36px}
.icon-btn--sm i{font-size:1.05rem}

/* Mobile menu button */
.nav-toggle{
  width:44px;
  height:44px;
  display:none; 
  border:1px solid var(--line);
  background:var(--bg);
  border-radius:14px;
  padding:0;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.nav-toggle i{font-size:1.45rem;color:var(--accent2)}

/* Hero */
.hero{
  /* Padding top cho hero phải lớn hơn header để không bị che */
  padding-top: calc(var(--header-offset) + 2rem); 
  padding-bottom: 2.5rem;
}
.hero__inner{
  display:grid;
  grid-template-columns: 340px 1fr;
  align-items:center;
  gap:clamp(1.5rem, 4vw, 3.2rem);
}
.avatar{
  width:min(320px, 80vw);
  aspect-ratio:1/1;
  border-radius:50%;
  overflow:hidden;
  margin-inline:auto;
  background:#fff;
  border:10px solid #f3f4f6;
  box-shadow:var(--shadow);
}
.avatar img{width:100%;height:100%;object-fit:cover}

.kicker{margin:0 0 .25rem;color:var(--muted);font-weight:600}
.hero__title{
  font-size:clamp(2.2rem, 5vw, 3.3rem);
  line-height:1.1;
  margin:.1rem 0 .25rem;
  letter-spacing:-.04em;
}
.hero__subtitle{
  font-size:clamp(1.2rem, 2vw, 1.55rem);
  margin:0;
  color:var(--fg);
}

/* --- SECTIONS LOGIC (QUAN TRỌNG CHO YÊU CẦU SÁT MÉP) --- */
main section[id]{
  /* Điểm dừng cuộn nằm chính xác ở mép dưới header */
  scroll-margin-top: var(--header-offset);
}

.section{
  /* Padding top nhỏ (20px) để chữ sát mép header nhưng không dính tịt */
  padding-top: 20px; 
  /* Đẩy khoảng trống xuống dưới để bù lại */
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.section--alt{background:linear-gradient(180deg, #f8fafc, #ffffff)}

.section__header{
  margin-bottom:1.4rem;
  /* Đảm bảo tiêu đề không có margin-top ẩn gây lệch */
  margin-top: 0; 
}
.section__title{
  margin:0;
  font-size:clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing:-.03em;
  line-height: 1.2;
}
.section__lead{
  margin:.45rem 0 0;
  color:var(--muted);
  max-width:70ch;
}

/* Cards & Components */
.card{
  background:var(--card);
  border:1px solid rgba(226,232,240,.9);
  border-radius:var(--radius);
  padding:1.2rem 1.15rem;
  box-shadow:0 10px 25px rgba(2,6,23,.05);
  transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-3px); }
.card__title{margin:.15rem 0 .6rem;font-size:1.05rem}

.bullets{margin:.2rem 0 0;padding-left:1.15rem}
.bullets li{margin:.45rem 0}

.chips{display:flex;flex-wrap:wrap;gap:.6rem}
.chip{
  padding:.45rem .7rem;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  font-weight:600;
  color:var(--fg);
  font-size:.92rem;
}

.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap:1.1rem }
.span2 { grid-column: span 2; }

/* Timeline */
.timeline{display:grid;gap:1rem}
.timeline__item{padding:1.1rem 1.15rem; border-left: 2px solid var(--line); padding-left: 1.5rem; position: relative;}
.timeline__item::before {
  content: ''; position: absolute; left: -6px; top: 1.5rem; width: 10px; height: 10px; 
  background: var(--accent); border-radius: 50%;
}
.timeline__meta{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.6rem;
}
.timeline__title{margin:0;font-size:1.05rem}
.timeline__period{margin:0;color:var(--muted);font-weight:700}

/* Lists and utils */
.items{margin:.2rem 0 0;padding:0;list-style:none}
.items li{display:flex;gap:.6rem;margin:.55rem 0}
.item__when{min-width:92px;color:var(--muted);font-weight:700}
.item__what{flex:1}
.subhead{margin:.9rem 0 .35rem;font-weight:800;color:var(--accent2)}
.muted{color:var(--muted)}
.link{color:var(--accent2);text-decoration:underline;text-underline-offset:4px}

/* Footer */
.footer{border-top:1px solid var(--line);padding:2rem 0;}
.footer__inner{
  display:grid; gap:10px; align-items:center;
  color:var(--muted); font-size:.95rem;
}
.footer__nav{display:flex;flex-wrap:wrap;gap:12px}
.footer__nav a{color:var(--accent);text-decoration:none;opacity:.9}
.footer__nav a:hover{text-decoration: underline; opacity:1}

/* Floating scroll button */
.scroll-fab{
  position:fixed;
  right:calc(18px + env(safe-area-inset-right));
  bottom:calc(18px + env(safe-area-inset-bottom));
  width:46px; height:46px;
  border-radius:999px; border:0;
  cursor:pointer; display:grid; place-items:center;
  z-index:9999;
  box-shadow:0 10px 22px rgba(0,0,0,.12);
  background:#111; color:#fff;
  opacity: 0.8; transition: opacity 0.3s;
}
.scroll-fab:hover { opacity: 1; }
.scroll-fab i{font-size:18px}

/* Reveal animations */
.reveal{opacity:0;transform:translateY(14px);transition:opacity .6s ease, transform .6s ease}
.reveal.is-visible{opacity:1;transform:translateY(0)}

/* Contact Form */
.form{display:grid;gap:.9rem;margin-top:.3rem}
.form__row{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}
.form__field{display:grid;gap:.35rem;font-weight:600;color:var(--fg)}
.form__field span{font-size:.92rem}
.form__field input,.form__field select,.form__field textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:.85rem .9rem;
  font:inherit;
  background:#fff;
  transition: border-color 0.2s;
}
.form__field input:focus, .form__field select:focus, .form__field textarea:focus {
  outline: none; border-color: var(--accent);
}
.form__field textarea{resize:vertical;min-height:130px}
.req{color:#c0262d}
.small{font-size:.92rem}
.form__actions{display:flex;gap:1rem;align-items:center;flex-wrap:wrap}

.form-status { margin-top: 0.75rem; font-size: 0.95rem; font-weight: 500; display: none; }
.text-success { color: #10b981; }
.text-error { color: #ef4444; }

.btn{
  display:inline-flex; align-items:center; gap:.55rem;
  padding:.8rem 1rem; border-radius:999px;
  border:1px solid rgba(31,111,139,.35);
  background:linear-gradient(180deg, rgba(31,111,139,.10), rgba(31,111,139,.04));
  color:var(--accent2); font-weight:800; cursor:pointer; text-decoration: none;
}
.btn:hover{transform:translateY(-1px)}

/* Responsive Media Queries */
@media (max-width: 900px){
  .hero__inner{grid-template-columns:1fr; text-align:center}
  .header__inner{gap:.75rem}
}

@media (max-width: 860px){
  .nav-toggle{display:inline-flex}
  .footer__inner{grid-template-columns:1fr}
  .footer__nav{justify-content:flex-start}
  
  /* Mobile Nav */
  .nav{
    position:fixed; left:0; right:0; top: var(--header-offset);
    background:rgba(255,255,255,.98);
    border-bottom:1px solid var(--line);
    padding:1rem;
    flex-direction:column; gap:.85rem;
    opacity: 0; transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  }
  .nav.is-open{
    opacity: 1; transform: translateY(0); pointer-events: auto;
  }
  .nav a{padding:.6rem 0; width:100%; text-align:center; background: transparent !important;}
  .grid2{grid-template-columns:1fr}
  .form__row{grid-template-columns:1fr}
  .span2{grid-column:auto}
  
  /* Timeline Responsive */
  .timeline__meta{flex-direction:column; gap:0.2rem; align-items:flex-start;}
}

@media (min-width: 860px){
  .footer__inner{grid-template-columns:1fr auto}
  .footer__nav{justify-content:flex-end; order:2}
}

@media (max-width: 420px){
  .brand__name,.brand__cred{font-size:1rem}
  .icon-btn--sm{width:32px;height:32px}
  .icon-btn--sm i{font-size:.95rem}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .reveal{transition:none}
  .icon-btn{transition:none}
}
/* Tùy chỉnh Layout mới cho Form */
.form__new-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1rem;
}

.form__inputs {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Custom Checkbox hình tròn giống mẫu */
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  cursor: pointer;
  font-weight: 500;
  position: relative;
}

.request-item input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0; width: 0;
}

.checkmark {
  height: 22px;
  width: 22px;
  background-color: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.request-item:hover input ~ .checkmark {
  background-color: #f0f0f0;
}

.request-item input:checked ~ .checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}

.request-item input:checked ~ .checkmark:after {
  content: "";
  display: block;
  margin: 4px auto;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .form__new-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
