/* =========================================================
   GEM LEGAL – Landing page stylesheet
   Mobile-first: style gốc cho điện thoại, mở rộng bằng min-width.
   Sửa màu / phông / khoảng cách tại mục 1 (Design tokens).
   ========================================================= */

/* ---------- 1. DESIGN TOKENS (theo Bộ nhận diện GEM Legal) ---------- */
:root {
  /* Bảng màu chính thức */
  --ruby:        #7A1F2B; /* Đỏ hồng ngọc – màu chủ đạo 60% */
  --ruby-dark:   #5E1721; /* hover / nền sâu (dẫn xuất) */
  --gold:        #B08A4A; /* Vàng đồng – điểm nhấn trên nền sáng (chỉ viền, đường kẻ, chữ lớn) */
  --gold-light:  #D9B676; /* Vàng sáng – điểm nhấn trên nền tối */
  --ivory:       #F7F2E8; /* Kem ngà – nền web */
  --ink:         #22201C; /* Than mực – chữ nội dung */
  --stone:       #5E574D; /* Xám đá – chữ phụ */
  /* Trung tính dẫn xuất */
  --paper:       #FFFDF9;
  --line:        #E4DCCB;
  --error:       #A3192B;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Lưới khoảng cách 8px */
  --sp-1: .25rem;  /* 4  */
  --sp-2: .5rem;   /* 8  */
  --sp-3: .75rem;  /* 12 */
  --sp-4: 1rem;    /* 16 */
  --sp-5: 1.5rem;  /* 24 */
  --sp-6: 2rem;    /* 32 */
  --sp-7: 3rem;    /* 48 */
  --sp-8: 4rem;    /* 64 */
  --sp-9: 6rem;    /* 96 */

  --radius: 2px;              /* logo vuông vức → góc gần như vuông */
  --container: 72rem;         /* 1152px */
  --header-h: 4rem;
  --shadow: 0 10px 30px rgba(34, 32, 28, .08);
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1rem/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
address { font-style: normal; }
a { color: var(--ruby); text-underline-offset: 3px; }
h1, h2, h3 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 8vw, 4rem); }
h2 { font-size: clamp(2rem, 5.5vw, 2.9rem); }
h3 { font-size: 1.5rem; }
p  { margin: 0 0 var(--sp-4); }
ul { margin: 0; padding: 0; }

/* Focus rõ ràng cho bàn phím */
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.on-light :focus-visible, main :focus-visible { outline-color: var(--ruby); }

/* Chỉ dành cho trình đọc màn hình */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  background: var(--paper); color: var(--ruby); padding: var(--sp-2) var(--sp-4);
  font-weight: 600;
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- 3. LAYOUT HELPERS ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-4); }
.section   { padding-block: var(--sp-8); }
.section-head { max-width: 40rem; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ruby);
}
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--gold); }
.lead { font-size: 1.08rem; color: var(--stone); }

/* Slogan: G · E · M luôn tô vàng */
.slogan { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .06em; }
.slogan b { font-weight: 700; color: var(--gold-light); }

/* ---------- 4. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 3rem; padding: 0 var(--sp-5);
  border: 1.5px solid transparent; border-radius: var(--radius);
  font: 600 .95rem/1 var(--font-body); letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
.btn--primary  { background: var(--ruby); color: var(--paper); }
.btn--primary:hover  { background: var(--ruby-dark); }
.btn--gold     { background: var(--gold-light); color: var(--ink); }
.btn--gold:hover     { background: #E6C78E; }
.btn--outline  { border-color: currentColor; color: var(--ruby); background: transparent; }
.btn--outline:hover  { background: var(--ruby); color: var(--paper); border-color: var(--ruby); }
.btn--ghost    { border-color: rgba(247, 242, 232, .55); color: var(--ivory); }
.btn--ghost:hover    { background: rgba(247, 242, 232, .1); border-color: var(--ivory); }
.btn--block    { width: 100%; }

/* ---------- 5. LOGO ---------- */
.logo { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--ruby); }
.logo__mark { width: 2.5rem; height: 2.5rem; flex: none; }
.logo__divider { width: 1px; height: 2.25rem; background: var(--gold); }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name { font: 600 1.35rem/1 var(--font-display); letter-spacing: .14em; }
.logo__sub  { margin-top: .35rem; font: 500 .6rem/1 var(--font-body); letter-spacing: .38em; color: var(--ink); }
.logo--light { color: var(--ivory); }
.logo--light .logo__sub { color: var(--gold-light); }
.logo--light .logo__divider { background: var(--gold-light); }

/* ---------- 6. HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 242, 232, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.site-header .logo__divider, .site-header .logo__sub { display: none; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--ruby); cursor: pointer;
}
.nav-toggle svg { width: 1.6rem; height: 1.6rem; }
.site-nav {
  position: absolute; inset: var(--header-h) 0 auto 0;
  display: none; padding: var(--sp-4);
  background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; display: grid; gap: var(--sp-1); }
.site-nav a:not(.btn) {
  display: block; padding: var(--sp-3) var(--sp-2);
  color: var(--ink); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.site-nav a:not(.btn):hover { color: var(--ruby); }
.site-nav .btn { margin-top: var(--sp-3); width: 100%; }

/* ---------- 7. HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ruby); color: var(--ivory);
  padding-block: var(--sp-8) var(--sp-8);
}
/* Vạch dọc trang trí – lấy từ ảnh bìa trong bộ nhận diện */
.hero::before {
  content: ""; position: absolute; inset: 0 auto 0 8%;
  width: 22%;
  border-left: 1px solid rgba(217, 182, 118, .25);
  border-right: 1px solid rgba(217, 182, 118, .25);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; gap: var(--sp-7); }
.hero .eyebrow { color: var(--gold-light); }
.hero .eyebrow::before { background: var(--gold-light); }
.hero h1 { color: var(--ivory); }
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero__lead { max-width: 34rem; font-size: 1.08rem; color: rgba(247, 242, 232, .88); }
.hero__actions { display: flex; flex-direction: column; gap: var(--sp-3); margin-block: var(--sp-6) var(--sp-5); }
.hero__facts { list-style: none; display: grid; gap: var(--sp-2); font-size: .92rem; color: rgba(247, 242, 232, .85); }
.hero__facts li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.hero__facts svg { width: 1.1rem; height: 1.1rem; margin-top: .3rem; color: var(--gold-light); flex: none; }

.hero__portrait { position: relative; max-width: 22rem; width: 100%; margin-inline: auto; }
.hero__portrait::before {          /* khung vuông kép giống logo */
  content: ""; position: absolute; inset: -.75rem;
  border: 1px solid var(--gold-light);
}
.hero__portrait img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.hero__portrait figcaption {
  position: relative; margin-top: var(--sp-5); text-align: center;
  font-size: .9rem; color: rgba(247, 242, 232, .85);
}
.hero__portrait figcaption strong { display: block; font: 600 1.35rem/1.2 var(--font-display); color: var(--ivory); }

/* ---------- 8. CREDENTIALS STRIP ---------- */
.creds { background: var(--paper); border-bottom: 1px solid var(--line); padding-block: var(--sp-6); }
.creds__list { list-style: none; display: grid; gap: var(--sp-5); }
.creds__item { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: .92rem; line-height: 1.5; color: var(--stone); }
.creds__item strong { display: block; color: var(--ink); font-weight: 600; }
.icon-box {
  display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--gold); color: var(--ruby);
}
.icon-box svg { width: 1.3rem; height: 1.3rem; }

/* ---------- 9. SERVICES ---------- */
.services__grid { list-style: none; display: grid; gap: var(--sp-4); }
.service-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  padding: var(--sp-6) var(--sp-5);
  background: var(--paper); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.service-card::before {          /* vạch vàng trên đầu – "vạch giữa" của logo */
  content: ""; position: absolute; top: -1px; left: var(--sp-5);
  width: 2.5rem; height: 3px; background: var(--gold);
}
.service-card:hover, .service-card:focus-within { border-color: var(--gold); box-shadow: var(--shadow); }
.service-card .icon-box { margin-bottom: var(--sp-4); }
.service-card p { color: var(--stone); font-size: .95rem; flex: 1; }
.service-card__link { font-weight: 600; font-size: .9rem; text-decoration: none; }
.service-card__link:hover { text-decoration: underline; }

/* ---------- 10. BENEFITS ---------- */
.benefits { background: var(--paper); border-block: 1px solid var(--line); }
.benefits__inner { display: grid; gap: var(--sp-7); }
.benefits__list { list-style: none; display: grid; gap: var(--sp-6); counter-reset: benefit; }
.benefit { position: relative; padding-left: var(--sp-8); counter-increment: benefit; }
.benefit::before {
  content: counter(benefit, decimal-leading-zero);
  position: absolute; left: 0; top: -.2rem;
  font: 600 2.2rem/1 var(--font-display); color: var(--ruby);
}
.benefit h3 { margin-bottom: var(--sp-2); }
.benefit p  { margin: 0; color: var(--stone); }
.benefits__quote {
  margin: 0; padding: var(--sp-6);
  background: var(--ruby); color: var(--ivory);
  outline: 1px solid var(--gold-light); outline-offset: -.6rem;
}
.benefits__quote p { font: 500 1.45rem/1.45 var(--font-display); margin-bottom: var(--sp-4); }
.benefits__quote footer { font-size: .9rem; color: var(--gold-light); }

/* ---------- 11. TESTIMONIALS ---------- */
.testimonials__grid { list-style: none; display: grid; gap: var(--sp-4); }
.testimonial {
  height: 100%; margin: 0;
  display: flex; flex-direction: column;
  padding: var(--sp-6) var(--sp-5);
  background: var(--paper); border: 1px solid var(--line);
}
.testimonial__mark { font: 600 3.5rem/.6 var(--font-display); color: var(--gold); margin-bottom: var(--sp-3); }
.testimonial blockquote { margin: 0 0 var(--sp-5); flex: 1; }
.testimonial blockquote p { margin: 0; font-size: 1rem; }
.testimonial figcaption { padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: .88rem; color: var(--stone); }
.testimonial figcaption strong { display: block; color: var(--ink); font-weight: 600; }

/* ---------- 12. CTA + FORM ---------- */
.cta { background: var(--ink); color: var(--ivory); }
.cta__inner { display: grid; gap: var(--sp-7); }
.cta h2 { color: var(--ivory); }
.cta .eyebrow { color: var(--gold-light); }
.cta .eyebrow::before { background: var(--gold-light); }
.cta .lead { color: rgba(247, 242, 232, .8); }
.contact-list { list-style: none; display: grid; gap: var(--sp-4); margin-block: var(--sp-6); }
.contact-list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.contact-list svg { width: 1.25rem; height: 1.25rem; margin-top: .25rem; color: var(--gold-light); flex: none; }
.contact-list a { color: var(--ivory); text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--gold-light); text-decoration: underline; }
.map { width: 100%; aspect-ratio: 16 / 10; border: 1px solid rgba(217, 182, 118, .4); filter: grayscale(.4); }

.form { padding: var(--sp-6) var(--sp-5); background: var(--ivory); color: var(--ink); }
.form h3 { margin-bottom: var(--sp-1); }
.form__hint { font-size: .88rem; color: var(--stone); margin-bottom: var(--sp-5); }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; margin-bottom: var(--sp-2); font-size: .88rem; font-weight: 600; }
.field label span[aria-hidden] { color: var(--ruby); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: var(--sp-3) var(--sp-4);
  font: 400 1rem var(--font-body); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.field textarea { min-height: 7.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ruby); box-shadow: 0 0 0 3px rgba(122, 31, 43, .15);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field__error { display: none; margin-top: var(--sp-1); font-size: .82rem; color: var(--error); }
.field [aria-invalid="true"] + .field__error { display: block; }
.consent { display: flex; gap: var(--sp-2); align-items: flex-start; margin-bottom: var(--sp-5); font-size: .85rem; color: var(--stone); }
.consent input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; accent-color: var(--ruby); flex: none; }
.form__status { margin: var(--sp-3) 0 0; font-size: .9rem; min-height: 1.5em; }

/* ---------- 13. FOOTER ---------- */
.site-footer { background: var(--ruby-dark); color: rgba(247, 242, 232, .78); font-size: .9rem; padding-block: var(--sp-7) var(--sp-5); }
.site-footer__grid { display: grid; gap: var(--sp-6); margin-bottom: var(--sp-6); }
.site-footer h2 { font: 600 .75rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); margin-bottom: var(--sp-4); }
.site-footer ul { list-style: none; display: grid; gap: var(--sp-2); }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); text-decoration: underline; }
.site-footer .slogan { margin-top: var(--sp-4); font-size: 1.1rem; }
.site-footer__legal { border-top: 1px solid rgba(217, 182, 118, .25); padding-top: var(--sp-5); font-size: .8rem; display: grid; gap: var(--sp-2); }

/* Thanh gọi nhanh cố định trên điện thoại */
.quick-bar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line);
}
body { padding-bottom: 4.25rem; }

/* =========================================================
   14. BREAKPOINTS (mobile-first)
   ========================================================= */
@media (min-width: 40em) {          /* ≥ 640px */
  .container { padding-inline: var(--sp-5); }
  .hero__actions { flex-direction: row; flex-wrap: wrap; }
  .creds__list { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .site-header .logo__divider, .site-header .logo__sub { display: block; }
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
  .form { padding: var(--sp-7) var(--sp-6); }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
}

@media (min-width: 64em) {          /* ≥ 1024px */
  :root { --header-h: 5rem; }
  .section { padding-block: var(--sp-9); }
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: block; padding: 0;
    background: none; border: 0; box-shadow: none;
  }
  .site-nav ul { display: flex; align-items: center; gap: var(--sp-5); }
  .site-nav a:not(.btn) { padding: var(--sp-2) 0; border: 0; font-size: .95rem; }
  .site-nav .btn { margin: 0 0 0 var(--sp-3); width: auto; }

  .hero { padding-block: var(--sp-9); }
  .hero__inner { grid-template-columns: 1.25fr .75fr; align-items: center; gap: var(--sp-9); }
  .hero__facts { grid-template-columns: repeat(3, auto); gap: var(--sp-5); }

  .creds__list { grid-template-columns: repeat(4, 1fr); }
  .services__grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
  .benefits__inner { grid-template-columns: 1.3fr .7fr; align-items: center; gap: var(--sp-9); }
  .testimonials__grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
  .cta__inner { grid-template-columns: 1fr 1fr; align-items: start; gap: var(--sp-8); }
  .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .site-footer__legal { grid-template-columns: 1fr auto; }

  .quick-bar { display: none; }
  body { padding-bottom: 0; }
}

/* Tôn trọng người dùng tắt chuyển động */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* In ấn gọn */
@media print {
  .site-header, .quick-bar, .form, .map, .hero::before { display: none !important; }
  .hero, .cta, .site-footer { background: #fff !important; color: #000 !important; }
}
