/* ============================================
   Project-Specific Styles — XongNgay Homepage
   ============================================ */

/* Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

form-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-base);
  transition: all .2s var(--ease-out);
  outline: none;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-input::placeholder { color: var(--muted); }
.form-group { margin-bottom: var(--space-4); }
.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.form-error { color: var(--bad); font-size: var(--fs-xs); margin-top: 4px; }
.form-hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ---- Legacy Aliases ---- */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-base);
  transition: all .2s var(--ease-out);
  outline: none;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-input::placeholder { color: var(--muted); }
.form-group { margin-bottom: var(--space-4); }
.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.form-error { color: var(--bad); font-size: var(--fs-xs); margin-top: 4px; }
.form-hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ---- Toast container ---- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Header ---- */
.header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.header-logo {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.header-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-sm);
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
  transition: all .2s var(--ease-out);
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---- Mobile Nav ---- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text);
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  border-radius: 1px;
  transition: all .2s var(--ease-out);
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  z-index: 99;
  padding: var(--space-4);
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  animation: slide-down .25s var(--ease-out);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  font-size: var(--fs-base);
  color: var(--text);
}
.mobile-menu a:hover { color: var(--brand); }
@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #2563eb 100%);
  color: #fff;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/hero-bg.png') center/cover no-repeat;
  opacity: 0.12;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: content-fade .6s var(--ease-out);
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}
.hero p {
  font-size: var(--fs-lg);
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}
.hero .btn {
  font-size: var(--fs-md);
  padding: 12px 28px;
  border-radius: var(--radius);
}
.hero .btn.primary {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero .btn.primary:hover {
  background: #f0f4ff;
  box-shadow: 0 6px 28px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}
.hero .btn.ghost {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  background: transparent;
}
.hero .btn.ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.stat-item {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform .2s var(--ease-out), background .2s var(--ease-out);
}
.stat-item:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.15);
}
.stat-value {
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.2;
}
.stat-label {
  font-size: var(--fs-sm);
  opacity: 0.75;
  margin-top: var(--space-1);
  font-weight: 500;
}

/* ---- Section Headings ---- */
.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  text-align: center;
}
.section-subtitle {
  color: var(--muted);
  text-align: center;
  margin-bottom: var(--space-8);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--fs-base);
}

/* ---- Categories ---- */
.categories { padding: 80px 0; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: all .25s var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.cat-card-icon {
  font-size: 44px;
  margin-bottom: var(--space-4);
  transition: transform .25s var(--ease-out);
}
.cat-card:hover .cat-card-icon { transform: scale(1.1); }
.cat-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  transition: transform .25s var(--ease-out);
}
.cat-card:hover .cat-card-img { transform: scale(1.03); }
.cat-card-icon-fallback {
  display: none;
  font-size: 44px;
  margin-bottom: var(--space-4);
}
.cat-card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.cat-card p {
  font-size: var(--fs-sm);
  color: var(--muted);
}
.cat-card-fb:hover {
  border-color: var(--facebook);
  box-shadow: 0 8px 30px rgba(24,119,242,0.15);
}
.cat-card-tt:hover {
  border-color: var(--tiktok);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.cat-card-sp:hover {
  border-color: var(--shopee);
  box-shadow: 0 8px 30px rgba(238,77,45,0.15);
}

/* ---- Services ---- */
.services { padding: var(--space-8) 0 80px; }
.services:nth-child(odd) { background: var(--panel2); }
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}
.svc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  transition: all .25s var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.svc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.svc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform .2s var(--ease-out);
}
.svc-card:hover .svc-card-icon { transform: scale(1.08); }
.svc-card-icon-fb { background: rgba(24,119,242,0.1); color: var(--facebook); }
.svc-card-icon-tt { background: rgba(0,0,0,0.05); color: var(--tiktok); }
.svc-card-icon-sp { background: rgba(238,77,45,0.1); color: var(--shopee); }
.svc-card-body { flex: 1; min-width: 0; }
.svc-card h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 4px;
}
.svc-card p {
  font-size: var(--fs-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.svc-card .badge { margin-top: var(--space-2); }

/* ---- CTA Section ---- */
.cta {
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-soft));
  padding: 80px 0;
  text-align: center;
}
.cta h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.cta p {
  color: var(--muted);
  margin-bottom: var(--space-6);
  font-size: var(--fs-md);
}
.cta .btn.primary {
  font-size: var(--fs-md);
  padding: 14px 36px;
}

/* ---- Footer ---- */
.footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 48px 0 var(--space-6);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
}
.footer h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-links a {
  color: var(--muted);
  font-size: var(--fs-sm);
  transition: color .2s var(--ease-out);
}
.footer-links a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header-nav, .header-actions { display: none; }
  .mobile-toggle { display: block; }

  .hero { padding: 56px 0; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: var(--fs-base); }

  .cat-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .svc-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}

@media (max-width: 430px) {
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.5rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .stat-item { padding: var(--space-3) var(--space-2); }
  .stat-value { font-size: var(--fs-lg); }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero .btn { width: 100%; max-width: 280px; justify-content: center; }
}
