/* ═══════════════════════════════════════════
   AURORA ENGLISH CENTER — Main Stylesheet
   Dùng chung cho toàn bộ website
   ═══════════════════════════════════════════ */

/* ═══ DESIGN TOKENS ═══ */
:root {
  --navy: #0F172A;
  --navy-light: #1E293B;
  --blue: #1E40AF;
  --blue-light: #DBEAFE;
  --blue-vivid: #3B82F6;
  --green: #059669;
  --green-light: #D1FAE5;
  --orange: #F97316;
  --orange-light: #FFF7ED;
  --orange-deep: #EA580C;
  --red: #EF4444;
  --amber: #F59E0B;
  --purple: #8B5CF6;
  --pink: #EC4899;
  --text: #1E293B;
  --text-sub: #475569;
  --text-muted: #94A3B8;
  --bg: #FFFFFF;
  --bg-warm: #FEFCE8;
  --bg-cool: #F8FAFC;
  --bg-blue: #EFF6FF;
  --border: #E2E8F0;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.1);
  --shadow-xl: 0 20px 60px rgba(15,23,42,.12);
}

/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
img, svg { max-width: 100%; display: block; }

/* ═══ LAYOUT ═══ */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sec { padding: 88px 0; }
.sec-alt { background: var(--bg-cool); }
.sec-warm { background: var(--bg-warm); }
.sec-title {
  font-family: 'Merriweather', serif;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -.02em;
  color: var(--navy);
}
.sec-sub {
  text-align: center;
  color: var(--text-sub);
  max-width: 860px;
  margin: 0 auto 56px;
  font-size: 16px;
  line-height: 1.7;
}
.text-center { text-align: center; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 15px;
  transition: all .25s;
  min-height: 48px;
  gap: 8px;
  letter-spacing: -.01em;
}
.btn-cta { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(249,115,22,.35); }
.btn-cta:hover { background: var(--orange-deep); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(249,115,22,.45); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(30,64,175,.25); }
.btn-blue:hover { background: #1E3A8A; transform: translateY(-1px); }
.btn-white { background: #fff; color: var(--blue); border: 1.5px solid var(--border); }
.btn-white:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline-white { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.btn-outline-white:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #047857; transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--blue); background: var(--bg-blue); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,64,175,.15); }
.btn-glow:hover { animation: glow-border .6s ease-in-out; }
@keyframes glow-border {
  0% { box-shadow: 0 0 0 0 rgba(59,130,246,.4), 0 4px 14px rgba(249,115,22,.35); }
  50% { box-shadow: 0 0 0 8px rgba(59,130,246,0), 0 6px 24px rgba(249,115,22,.45); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0), 0 6px 24px rgba(249,115,22,.45); }
}

/* ═══ HEADER ═══ */
.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.hdr-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img {
  height: 44px; width: auto; display: block;
  border-radius: 8px;
  box-shadow:
    0 0 8px rgba(250,204,21,1),
    0 0 16px rgba(253,224,71,.85),
    0 0 24px rgba(250,204,21,.6),
    0 0 32px rgba(254,240,138,.4);
  transition: box-shadow .3s ease;
}
.logo:hover img,
.logo:active img,
.logo:focus img {
  box-shadow:
    0 0 8px rgba(34,197,94,1),
    0 0 16px rgba(74,222,128,.85),
    0 0 24px rgba(34,197,94,.6),
    0 0 32px rgba(187,247,208,.4);
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { font-size: 14px; font-weight: 500; color: var(--text-sub); transition: color .2s; position: relative; }
.nav a:hover { color: var(--blue); }
.nav a:not(.btn)::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0; height: 2px; background: var(--blue); transition: width .2s;
}
.nav a:not(.btn):hover::after { width: 100%; }
.nav .btn-cta { padding: 10px 22px; font-size: 14px; min-height: 42px; }
.menu-btn {
  display: none; font-size: 26px; color: var(--text);
  background: var(--bg-cool); width: 42px; height: 42px;
  border-radius: var(--r-sm); align-items: center; justify-content: center;
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.nav-drawer a:hover { background: var(--bg-cool); color: var(--blue); }
.nav-drawer .btn-cta {
  margin: 12px 24px;
  border-radius: var(--r-md);
  justify-content: center;
}

/* ═══ LANDING PAGES ═══ */
.landing-hero {
  padding: 72px 0 64px;
  background: linear-gradient(170deg, #EFF6FF 0%, #F0FDF4 58%, #FFFBEB 100%);
}
.landing-hero .wrap { max-width: 960px; }
.landing-kicker {
  display: inline-flex; align-items: center;
  color: var(--green); background: #fff; border: 1px solid var(--green-light);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.landing-hero h1 {
  font-family: 'Merriweather', serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15; color: var(--navy); margin-bottom: 18px; letter-spacing: -.02em;
}
.landing-hero p {
  max-width: 760px; color: var(--text-sub); font-size: 17px; line-height: 1.8; margin-bottom: 28px;
}
.landing-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.landing-section { padding: 64px 0; }
.landing-section h2 {
  font-family: 'Merriweather', serif; color: var(--navy);
  font-size: clamp(24px, 3vw, 34px); line-height: 1.25; margin-bottom: 18px;
}
.landing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.landing-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 22px; box-shadow: var(--shadow); min-height: 160px;
}
.landing-card h3 { color: var(--navy); font-size: 18px; margin-bottom: 10px; line-height: 1.35; }
.landing-card p, .landing-card li { color: var(--text-sub); font-size: 14px; line-height: 1.7; }
.landing-list { padding-left: 18px; }
.landing-band {
  background: var(--bg-cool); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.landing-band p { max-width: 780px; color: var(--text-sub); font-size: 16px; line-height: 1.8; margin-bottom: 22px; }

/* ═══ FOOTER ═══ */
.ftr { background: var(--navy); color: rgba(255,255,255,.7); padding: 64px 0 0; }
.ftr-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1.4fr; gap: 40px; padding-bottom: 40px; }
.ftr-col h4 { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 18px; text-transform: uppercase; letter-spacing: .08em; }
.ftr a, .ftr p { display: block; font-size: 14px; margin-bottom: 9px; transition: color .2s; line-height: 1.65; }
.ftr a:hover { color: #fff; }
.ftr-col p { margin-bottom: 14px; }
.ftr-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 24px 0; font-size: 13px; color: rgba(255,255,255,.5); text-align: center; }

/* ═══ CHAT WIDGET ═══ */
.chat-fab { position: fixed; bottom: 24px; right: 24px; z-index: 99; }
.chat-fab a {
  display: flex; width: 62px; height: 62px;
  border-radius: 50%; background: var(--green); color: #fff;
  font-size: 28px; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(5,150,105,.4);
  transition: all .25s;
  animation: pulse 2.5s infinite;
}
.chat-fab a:hover { transform: scale(1.1) rotate(8deg); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,.45), 0 6px 24px rgba(5,150,105,.4); }
  50% { box-shadow: 0 0 0 16px rgba(5,150,105,0), 0 6px 24px rgba(5,150,105,.4); }
}

/* ═══ MOBILE ═══ */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
  .ftr-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .sec { padding: 56px 0; }
  .landing-grid { grid-template-columns: 1fr; }
  .landing-hero, .landing-section { padding: 52px 0; }
}
@media (max-width: 500px) {
  .ftr-grid { grid-template-columns: 1fr; }
  .landing-actions .btn { width: 100%; }
}

/* ═══ CORE WEB VITALS OPTIMIZATIONS ═══ */

/* Defer rendering of off-screen sections (huge LCP/INP win on long pages) */
.sec, .sec-alt, .ftr, .cta-bottom {
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}

/* Reserve space for images to prevent layout shift (CLS) */
img, svg, video {
  height: auto;
  max-width: 100%;
}

/* GPU acceleration for hover transforms (smoother INP) */
/* Lưu ý: KHÔNG include .hero-topic-card vì nó dùng translate(-50%,0) trong animation float-center */
.btn, .srv-card, .mat-card, .test-card, .usp-card,
.problem-card, .tl-card, .post-card,
.contact-card, .strat-card, .grade-card, .price-card {
  will-change: auto;
  backface-visibility: hidden;
}

/* Smooth scroll for anchor links without paint thrashing */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Prevent FOUT — match font metrics during font load */
@supports (font: -apple-system-body) {
  body { font-synthesis: style weight; }
}

/* Optimize repeated background images */
.hdr {
  contain: layout style;
}

/* Fixed dimension placeholder for chat FAB to avoid CLS */
.chat-fab a {
  contain: layout style paint;
}

/* ── Registration Form ── */
.reg-form { max-width:700px; margin:0 auto; }
.reg-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.reg-input {
  flex:1 1 180px;
  padding:13px 16px;
  border:2px solid #e2e8f0;
  border-radius:10px;
  font-size:.95rem;
  font-family:inherit;
  background:#fff;
  color:#1e293b;
  transition:border-color .2s;
}
.reg-input:focus { outline:none; border-color:var(--primary,#3b82f6); }
select.reg-input { cursor:pointer; }
.reg-btn { width:100%; margin-top:4px; padding:15px; font-size:1rem; }
.reg-note { text-align:center; margin-top:12px; font-size:.82rem; color:#94a3b8; }
.reg-success {
  display:none;
  text-align:center;
  padding:20px;
  background:#f0fdf4;
  border:2px solid #86efac;
  border-radius:12px;
  color:#166534;
  font-weight:600;
  margin-top:16px;
}

/* ── Maps Section ── */
.maps-wrap { margin-top:24px; border-radius:14px; overflow:hidden; box-shadow:0 4px 20px rgba(0,0,0,.1); }
.map-tel { color:var(--primary,#3b82f6); font-weight:700; text-decoration:none; }
.map-tel:hover { text-decoration:underline; }

/* ── Mobile sticky call button ── */
.mob-call {
  display:none;
  position:fixed;
  bottom:80px;
  left:16px;
  background:#22c55e;
  color:#fff;
  padding:11px 18px;
  border-radius:50px;
  font-weight:700;
  font-size:.88rem;
  text-decoration:none;
  box-shadow:0 4px 16px rgba(34,197,94,.4);
  z-index:999;
  align-items:center;
  gap:6px;
}
@media (max-width:768px) { .mob-call { display:flex; } }
