/* ==========================================================================
   TRUNG TÂM ĐÀO TẠO & SÁT HẠCH LÁI XE AN PHÚ THIỆN - GIA LAI
   Design System & Responsive Stylesheet (PC & Mobile Perfected)
   ========================================================================== */

:root {
  /* Brand Color Palette */
  --primary: #0b1f44;
  --primary-dark: #07152f;
  --primary-light: #163675;
  --primary-subtle: #eff6ff;
  
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  
  --secondary: #10b981;
  --secondary-dark: #059669;
  --secondary-light: #ecfdf5;
  
  --info: #0284c7;
  --info-light: #e0f2fe;
  
  --drive-blue: #1a73e8;
  --drive-blue-hover: #1557b0;
  --drive-gradient: linear-gradient(135deg, #1a73e8 0%, #0f52ba 100%);

  /* Neutrals */
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --bg-white: #ffffff;
  --bg-surface: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;

  /* Typography Fluid Clamp */
  --font-heading: 'Outfit', 'Be Vietnam Pro', sans-serif;
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-xs: clamp(0.72rem, 0.7rem + 0.15vw, 0.8rem);
  --text-sm: clamp(0.82rem, 0.8rem + 0.2vw, 0.9rem);
  --text-base: clamp(0.92rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.08rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.22rem, 1.12rem + 0.5vw, 1.45rem);
  --text-2xl: clamp(1.4rem, 1.25rem + 0.8vw, 1.9rem);
  --text-3xl: clamp(1.65rem, 1.4rem + 1.2vw, 2.6rem);

  /* Geometry & Shadows */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 12px rgba(11, 31, 68, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(11, 31, 68, 0.1), 0 8px 10px -6px rgba(11, 31, 68, 0.04);
  --shadow-lg: 0 20px 35px -8px rgba(11, 31, 68, 0.16), 0 10px 15px -5px rgba(11, 31, 68, 0.06);
  --shadow-glow: 0 0 30px rgba(245, 158, 11, 0.35);

  --transition-fast: 0.18s ease;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.38s cubic-bezier(0.16, 1, 0.3, 1);

  --container-width: 1240px;
  --header-height: 74px;
}

/* ==========================================================================
   RESET & BULLETPROOF RESPONSIVE BASE
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Crucial: Prevent ANY horizontal scroll or viewport stretching */
html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  color: var(--text-body);
  background-color: var(--bg-body);
  line-height: 1.6;
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Automatic word breaking for all text to avoid layout blowout */
p, span, a, h1, h2, h3, h4, h5, h6, strong, div {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Offset anchors for sticky header */
section[id], div[id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem; /* >=16px prevents iOS zoom */
  max-width: 100%;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(14px, 3vw, 24px);
  padding-right: clamp(14px, 3vw, 24px);
  box-sizing: border-box;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  background: var(--primary-dark);
  color: #cbd5e1;
  font-size: var(--text-xs);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1001;
  width: 100%;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.topbar-info {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-info span, .topbar-info a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  white-space: normal;
}

.topbar-info a:hover {
  color: var(--accent);
}

.topbar-info svg {
  width: 14px;
  height: 14px;
  fill: var(--accent);
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.74rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(11, 31, 68, 0.05);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
  width: 100%;
}

.site-header.scrolled {
  box-shadow: 0 8px 25px rgba(11, 31, 68, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 12px;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 50px);
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.12));
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
}

.brand-text h1, .brand-text .title {
  font-family: var(--font-heading);
  font-size: clamp(0.92rem, 3.2vw, 1.15rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text .subtitle {
  font-size: clamp(0.62rem, 2vw, 0.72rem);
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-body);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-subtle);
}

.nav-link.active {
  color: var(--primary);
  background: #f1f5f9;
  font-weight: 700;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-drive-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--drive-gradient);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
  font-size: 0.88rem;
  margin-left: 6px;
  white-space: nowrap;
}

.nav-drive-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 115, 232, 0.4);
}

/* Mobile Toggle Hamburger Button */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  color: var(--primary);
  position: relative;
  z-index: 1010;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-toggle:focus-visible {
  outline: 2px solid var(--accent);
}

.hamburger-box {
  width: 24px;
  height: 18px;
  display: inline-block;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 24px;
  height: 2.5px;
  background-color: var(--primary);
  border-radius: 4px;
  position: absolute;
  transition: transform var(--transition), top var(--transition), opacity var(--transition);
}

.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-inner::before {
  content: '';
  top: -8px;
}

.hamburger-inner::after {
  content: '';
  top: 8px;
}

/* Transform to X when expanded */
.mobile-toggle[aria-expanded="true"] .hamburger-inner {
  transform: rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .hamburger-inner::before {
  top: 0;
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger-inner::after {
  top: 0;
  transform: rotate(-90deg);
}

/* Mobile Backdrop Overlay */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 21, 47, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.nav-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   BUTTONS (WITH SAFE WRAPPING ON MOBILE)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-align: center;
  white-space: normal; /* SAFE: Never blowout layout on mobile */
  word-break: break-word;
  max-width: 100%;
  user-select: none;
  touch-action: manipulation;
  min-height: 46px;
  line-height: 1.35;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11, 31, 68, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(11, 31, 68, 0.35);
  color: #fff;
}

.btn-accent {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
  color: #fff;
}

.btn-outline {
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-drive {
  background: var(--drive-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.28);
}

.btn-drive:hover {
  background: linear-gradient(135deg, #1557b0 0%, #0d429a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.38);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.86rem;
  border-radius: var(--radius-xs);
  min-height: 38px;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(circle at 85% 15%, #183e85 0%, #0c2044 50%, #07152f 100%);
  color: #fff;
  padding: clamp(40px, 7vw, 80px) 0 clamp(50px, 8vw, 90px);
  overflow: hidden;
  width: 100%;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: clamp(240px, 45vw, 500px);
  height: clamp(240px, 45vw, 500px);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, transparent 70%);
  top: -60px;
  right: -60px;
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4.5vw, 50px);
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #fde68a;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
  align-self: flex-start;
  max-width: 100%;
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero-title span {
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.35);
}

.hero-desc {
  font-size: var(--text-base);
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.hero-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 32px) clamp(16px, 3vw, 28px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  text-align: center;
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.hero-card-logo {
  width: clamp(90px, 14vw, 120px);
  height: clamp(90px, 14vw, 120px);
  margin: 0 auto 16px;
  background: #ffffff;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 3.5px solid #fde68a;
  flex-shrink: 0;
}

.hero-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: #ffffff;
  margin-bottom: 4px;
  font-weight: 800;
}

.hero-card p {
  color: #94a3b8;
  font-size: var(--text-xs);
  line-height: 1.5;
}

.hero-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
  width: 100%;
}

.stat-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 0;
}

.stat-box .number {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: #fbbf24;
  line-height: 1.2;
  word-break: break-all;
}

.stat-box .label {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.3;
}

/* ==========================================================================
   SECTIONS COMMON
   ========================================================================== */
.section {
  padding: clamp(40px, 6vw, 75px) 0;
  position: relative;
  width: 100%;
}

.section-header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto clamp(28px, 4.5vw, 48px);
}

.section-badge {
  display: inline-block;
  background: var(--info-light);
  color: var(--info);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.section-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4.5vw, 48px);
  align-items: center;
  width: 100%;
}

.about-card-banner {
  background: linear-gradient(135deg, #102a5e 0%, #07152f 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 36px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.about-card-banner::after {
  content: 'APT';
  position: absolute;
  right: -20px;
  bottom: -20px;
  font-size: clamp(80px, 12vw, 140px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.about-card-banner h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: 14px;
  font-weight: 800;
  color: #fbbf24;
}

.about-card-banner p {
  color: #e2e8f0;
  font-size: var(--text-sm);
  margin-bottom: 20px;
  line-height: 1.65;
}

.about-meta-list {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-meta-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--text-sm);
  color: #cbd5e1;
  line-height: 1.5;
}

.about-meta-list li svg {
  width: 18px;
  height: 18px;
  fill: #38bdf8;
  flex-shrink: 0;
  margin-top: 2px;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.about-item {
  display: flex;
  gap: 14px;
  background: var(--bg-white);
  padding: clamp(14px, 2.5vw, 20px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
}

.about-item:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.about-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-item h4 {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 4px;
  font-weight: 700;
}

.about-item p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   COURSES SECTION
   ========================================================================== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 3vw, 28px);
  width: 100%;
}

.course-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3.5vw, 30px) clamp(16px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}

.course-card.featured {
  border: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15);
}

.course-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.course-icon-wrap {
  width: 52px;
  height: 52px;
  background: var(--primary-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.course-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.course-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.55;
  flex-grow: 1;
}

.course-specs {
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  padding: 12px 0;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  gap: 8px;
}

.spec-name {
  color: var(--text-muted);
}

.spec-val {
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}

.course-card .btn {
  margin-top: auto;
  width: 100%;
}

/* ==========================================================================
   PROCESS ROADMAP SECTION
   ========================================================================== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 16px;
  width: 100%;
}

.process-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(18px, 2.5vw, 24px);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
  box-sizing: border-box;
}

.process-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.process-step-num {
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(11, 31, 68, 0.2);
  flex-shrink: 0;
}

.process-card.highlight .process-step-num {
  background: var(--secondary);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.process-card h4 {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 700;
}

.process-card p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   DRIVE TEASER BANNER SECTION
   ========================================================================== */
.drive-teaser-section {
  background: linear-gradient(135deg, #091a38 0%, #102a5c 100%);
  color: #fff;
  padding: clamp(36px, 5.5vw, 60px) 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.drive-teaser-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
}

.drive-teaser-content {
  min-width: 0;
}

.drive-teaser-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.drive-teaser-content h3 span {
  color: #60a5fa;
}

.drive-teaser-content p {
  color: #cbd5e1;
  font-size: var(--text-base);
  max-width: 650px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.drive-email-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.25);
  max-width: 100%;
  flex-wrap: wrap;
}

.drive-teaser-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  max-width: 320px;
}

/* ==========================================================================
   CONTACT & REGISTRATION SECTION
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3.5vw, 36px);
  align-items: flex-start;
  width: 100%;
}

.contact-info-card, .contact-form-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(18px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.contact-info-card h4, .contact-form-card h4 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 800;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.contact-item-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.contact-item-content {
  min-width: 0;
  flex: 1 1 auto;
}

.contact-item-content strong {
  color: var(--primary);
  font-size: var(--text-sm);
  display: block;
}

.contact-item-content p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 2px;
  word-break: break-word;
}

.contact-notice-box {
  margin-top: 20px;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  width: 100%;
  box-sizing: border-box;
}

.contact-notice-box strong {
  font-size: var(--text-sm);
  color: var(--text-dark);
}

.contact-notice-box ul {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 6px;
  list-style: disc;
  padding-left: 18px;
  line-height: 1.6;
}

/* Registration Form */
.form-group {
  margin-bottom: 14px;
  width: 100%;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 1rem; /* >= 16px prevents iOS auto-zoom */
  color: var(--text-dark);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 85px;
}

/* ==========================================================================
   DOCUMENT & GOOGLE DRIVE PAGE (tailieu.html)
   ========================================================================== */
.doc-hero {
  background: radial-gradient(circle at 75% 20%, #153e85 0%, #0c2044 60%, #07152f 100%);
  color: #fff;
  padding: clamp(40px, 6vw, 65px) 0 clamp(36px, 5vw, 50px);
  text-align: center;
  position: relative;
  width: 100%;
}

.doc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(66, 133, 244, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(66, 133, 244, 0.4);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: var(--text-xs);
  margin-bottom: 14px;
  max-width: 100%;
}

.doc-hero h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.doc-hero p {
  color: #cbd5e1;
  max-width: 740px;
  margin: 0 auto;
  font-size: var(--text-base);
  line-height: 1.6;
}

/* Google Drive Sync Card */
.drive-sync-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
  padding: clamp(18px, 3vw, 26px) clamp(16px, 3.5vw, 30px);
  margin-top: -26px;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.drive-sync-info {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 300px;
}

.drive-icon-big {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.drive-sync-text {
  min-width: 0;
}

.drive-sync-text h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.drive-sync-text p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.drive-sync-text .admin-email {
  color: #1d4ed8;
  font-weight: 700;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  display: inline-block;
  margin-top: 4px;
  font-size: var(--text-xs);
  word-break: break-all;
}

.drive-sync-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Filter & Search Bar */
.doc-filter-section {
  margin: 30px 0 20px;
  width: 100%;
}

.search-bar-wrap {
  position: relative;
  margin-bottom: 18px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.doc-search-input {
  width: 100%;
  padding: 13px 44px 13px 46px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: var(--transition);
  color: var(--text-dark);
  box-sizing: border-box;
}

.doc-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #f1f5f9;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.search-clear-btn.active {
  display: flex;
}

/* Category Tabs (Safe Horizontal Scroll On Mobile) */
.category-tabs-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.category-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.cat-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cat-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(11, 31, 68, 0.2);
}

.cat-btn .count-badge {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 0.74rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.cat-btn.active .count-badge {
  background: rgba(255, 255, 255, 0.25);
}

/* Document Cards Grid */
.doc-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-bottom: 44px;
  width: 100%;
}

.doc-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: clamp(14px, 2.5vw, 20px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  min-width: 0;
  box-sizing: border-box;
}

.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.doc-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  min-width: 0;
}

.doc-pdf-icon {
  width: 40px;
  height: 40px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.doc-meta-info {
  flex-grow: 1;
  min-width: 0;
}

.doc-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.doc-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 5px;
}

.doc-subinfo {
  display: flex;
  gap: 10px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.doc-desc {
  font-size: var(--text-xs);
  color: #475569;
  margin-top: 5px;
  line-height: 1.45;
}

.doc-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.doc-size-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Drive Help Banner */
.drive-info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: clamp(18px, 3.5vw, 30px);
  margin-bottom: 44px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.drive-info-banner h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.drive-info-banner p {
  font-size: var(--text-sm);
  color: #334155;
  line-height: 1.6;
  margin-bottom: 14px;
}

.drive-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--text-sm);
  color: #1e293b;
  font-weight: 600;
}

.step-num {
  width: 22px;
  height: 22px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-drive-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.contact-drive-card h4 {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 700;
}

.contact-drive-card p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ==========================================================================
   MODAL & TOAST
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 23, 44, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-body p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 14px;
  line-height: 1.55;
}

.drive-link-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.82rem;
  color: #1e40af;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10002;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: min(90vw, 420px);
  box-sizing: border-box;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #07152f;
  color: #cbd5e1;
  padding: clamp(40px, 6vw, 60px) 0 20px;
  margin-top: auto;
  border-top: 4px solid var(--accent);
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(20px, 3.5vw, 36px);
  margin-bottom: 36px;
  width: 100%;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
}

.footer-brand h4 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.footer-desc {
  font-size: var(--text-xs);
  line-height: 1.65;
  color: #94a3b8;
  margin-bottom: 18px;
}

.footer-col h5 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.footer-links li {
  margin-bottom: 9px;
}

.footer-links a {
  color: #94a3b8;
  font-size: var(--text-xs);
  display: inline-block;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.footer-links a:hover {
  color: #fbbf24;
  transform: translateX(4px);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  font-size: var(--text-xs);
  color: #94a3b8;
  line-height: 1.5;
}

.footer-contact svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  font-size: 0.76rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   MOBILE FLOATING ACTION BAR & BACK TO TOP
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 990;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
  max-width: 100vw;
  box-sizing: border-box;
}

.mobile-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.mobile-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: var(--radius-xs);
  color: var(--text-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  gap: 2px;
  transition: transform var(--transition-fast);
}

.mobile-bar-btn:active {
  transform: scale(0.92);
}

.mobile-bar-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.mobile-bar-btn.call {
  color: #dc2626;
}

.mobile-bar-btn.zalo {
  color: #0284c7;
}

.mobile-bar-btn.drive {
  color: var(--drive-blue);
}

.mobile-bar-btn.register {
  color: var(--accent-hover);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 84px;
  right: 16px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(11, 31, 68, 0.3);
  z-index: 980;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (FULL BREAKPOINT SYSTEM)
   ========================================================================== */

/* Laptops & Tablets Landscape (<= 1024px) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-pill {
    align-self: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-card {
    max-width: 540px;
    margin: 0 auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .drive-teaser-box {
    flex-direction: column;
    text-align: center;
  }

  .drive-teaser-btns {
    width: 100%;
    max-width: 400px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .drive-info-banner {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

/* Tablets Portrait & Mobile Devices (< 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 62px;
  }

  /* Safe padding for bottom bar */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* Topbar Mobile: Single Clean Centered Hotline */
  .topbar {
    padding: 6px 0;
  }

  .topbar .container {
    justify-content: center;
  }

  .topbar-info {
    justify-content: center;
    width: 100%;
  }

  .topbar-info span:not(.topbar-hotline) {
    display: none; /* Hide address and email on mobile topbar */
  }

  .topbar-right {
    display: none; /* Hide MST on phone topbar */
  }

  /* Header & Mobile Toggle */
  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .mobile-toggle {
    display: flex;
  }

  /* Mobile Navigation Drawer - BUG-FREE: Hidden when closed */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(290px, 80vw);
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--header-height) + 16px) 16px 24px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1005;
    transform: translateX(100%);
    transition: transform var(--transition-slow), visibility var(--transition-slow);
    overflow-y: auto;
    gap: 8px;
    visibility: hidden; /* FIX: Prevents horizontal scrolling overflow */
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link {
    font-size: 0.95rem;
    padding: 11px 14px;
    border-radius: var(--radius-xs);
  }

  .nav-link.active {
    background: var(--primary-subtle);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-drive-btn {
    margin-left: 0;
    margin-top: 10px;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.92rem;
  }

  /* Hero Section Mobile */
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-card-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Courses & Process Grids */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .process-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Drive sync card */
  .drive-sync-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    margin-top: -18px;
    padding: 18px 16px;
  }

  .drive-sync-info {
    flex-direction: column;
    text-align: center;
  }

  .drive-sync-actions {
    flex-direction: column;
    width: 100%;
  }

  .drive-sync-actions .btn {
    width: 100%;
  }

  /* Document Cards */
  .doc-list-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .doc-card-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .doc-btns {
    width: 100%;
  }

  .doc-btns .btn {
    flex: 1;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  /* Floating Bar & Back to top */
  .mobile-bottom-bar {
    display: block;
  }

  .back-to-top {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    text-align: center;
    justify-content: center;
  }
}

/* Small Smartphone Optimization (<= 480px, e.g. iPhone SE, iPhone 12/13/14/15 Mini, Galaxy A) */
@media (max-width: 480px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-pill {
    font-size: 0.72rem;
    padding: 5px 10px;
    text-align: left;
  }

  .hero-title {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .hero-desc {
    font-size: 0.88rem;
  }

  .hero-card {
    padding: 18px 14px;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .section-desc {
    font-size: 0.88rem;
  }

  .about-card-banner {
    padding: 18px 14px;
  }

  .contact-info-card, .contact-form-card {
    padding: 18px 14px;
  }

  .drive-teaser-box {
    padding: 18px 14px;
  }

  .doc-hero h1 {
    font-size: 1.55rem;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-body {
    padding: 16px 14px;
  }
}
