/* ========== Auth Server — Design system (common) ========== */
/*
 * File CSS chung cho toàn Auth Server (login tập trung).
 * Màu sắc, button, table, panel config tại đây, dùng chung cho Root, Admin, Client.
 * Phối màu:
 * - Nền: surface / surface-elevated / surface-muted / hero-bg
 * - Chữ: text-primary, text-secondary, text-muted, heading-color
 * - Nhấn: brand-primary (indigo) cho CTA, link
 * - Nguy hiểm: auth-danger (đỏ) cho xóa, hủy
 */
:root {
  /* Brand */
  --brand-primary: #4f46e5;
  --brand-primary-dark: #4338ca;
  --brand-secondary: #0ea5e9;
  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0ea5e9 100%);
  --brand-gradient-soft: linear-gradient(180deg, rgba(79, 70, 229, 0.08) 0%, transparent 65%);
  /* Nền */
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --surface-muted: #f1f5f9;
  --hero-bg: #fafbff;
  /* Chữ & tiêu đề */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --heading-color: #0f172a;
  /* UI chung */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);
  /* Auth common: navbar (Admin/Client) */
  --navbar-auth-bg: #1e293b;
  --navbar-auth-text: rgba(255, 255, 255, 0.9);
  --navbar-auth-hover: #334155;
  --navbar-auth-active: var(--brand-primary);
  /* Auth common: buttons */
  --btn-primary-bg: var(--brand-primary);
  --btn-primary-border: var(--brand-primary-dark);
  --btn-primary-hover-bg: var(--brand-primary-dark);
  --btn-secondary-bg: var(--text-muted);
  --btn-secondary-border: #94a3b8;
  --btn-danger-bg: #dc2626;
  --btn-danger-border: #b91c1c;
  --btn-danger-hover-bg: #b91c1c;
  /* Auth common: table */
  --table-header-bg: var(--surface-muted);
  --table-header-color: var(--heading-color);
  --table-border: rgba(0, 0, 0, 0.08);
  --table-stripe: rgba(79, 70, 229, 0.03);
  /* Auth common: panel / card */
  --panel-bg: var(--surface-elevated);
  --panel-border: rgba(0, 0, 0, 0.08);
  --panel-radius: var(--radius-lg);
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--surface);
  line-height: 1.6;
}

/* Override Bootstrap focus for accessibility */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--text-muted);
  text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
  text-align: start;
}

/* ========== Auth Server Common: Buttons (dùng chung) ========== */
.btn-primary,
.btn-auth-primary {
  background-color: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: #fff !important;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-primary:hover,
.btn-auth-primary:hover {
  background-color: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-border);
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-secondary,
.btn-auth-secondary {
  background-color: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: #fff !important;
  font-weight: 500;
  border-radius: var(--radius);
}

.btn-secondary:hover,
.btn-auth-secondary:hover {
  background-color: var(--btn-secondary-border);
  border-color: var(--btn-secondary-border);
  color: #fff !important;
}

.btn-danger,
.btn-auth-danger {
  background-color: var(--btn-danger-bg);
  border-color: var(--btn-danger-border);
  color: #fff !important;
  font-weight: 500;
  border-radius: var(--radius);
}

.btn-danger:hover,
.btn-auth-danger:hover {
  background-color: var(--btn-danger-hover-bg);
  border-color: var(--btn-danger-border);
  color: #fff !important;
}

.btn-outline-primary,
.btn-auth-outline {
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
  background: transparent;
  font-weight: 500;
  border-radius: var(--radius);
}

.btn-outline-primary:hover,
.btn-auth-outline:hover {
  background-color: var(--brand-primary);
  color: #fff !important;
  border-color: var(--brand-primary);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--table-border);
  border-radius: var(--radius);
}

.btn-outline-secondary:hover {
  background-color: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--table-border);
}

.btn-outline-danger {
  color: var(--btn-danger-bg);
  border: 2px solid var(--btn-danger-bg);
  background: transparent;
  border-radius: var(--radius);
}

.btn-outline-danger:hover {
  background-color: var(--btn-danger-bg);
  color: #fff !important;
  border-color: var(--btn-danger-bg);
}

/* ========== Auth Server Common: Table (dùng chung) ========== */
.auth-table,
.table.auth-table,
.table-striped {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: var(--table-stripe);
  --bs-table-border-color: var(--table-border);
  border-radius: var(--panel-radius);
  overflow: hidden;
}

.auth-table thead th,
.table.auth-table thead th,
.table-striped thead th {
  background-color: var(--table-header-bg) !important;
  color: var(--table-header-color);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--table-border);
}

.auth-table tbody td,
.table.auth-table tbody td,
.table-striped tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.auth-table tbody tr:hover,
.table.auth-table tbody tr:hover {
  background-color: var(--table-stripe);
}

.auth-table-container {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ========== Auth Server Common: Panel / Card (dùng chung) ========== */
.auth-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

.auth-card,
.card.auth-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.auth-card:hover,
.card.auth-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.15);
}

.auth-card .card-body,
.card.auth-card .card-body {
  padding: 1.25rem 1.5rem;
}

.auth-card .card-title,
.card.auth-card .card-title {
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.auth-card .card-text,
.card.auth-card .card-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.auth-page-title {
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.auth-page-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Dashboard: card trong khu vực Admin/Client dùng chung style */
.auth-dashboard .card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.auth-dashboard .card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.15);
}

.auth-dashboard .card .card-body {
  padding: 1.25rem 1.5rem;
}

.auth-dashboard .card .card-title {
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.auth-dashboard .card .card-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ========== Auth Server Common: Navbar (Admin/Client) ========== */
.navbar-auth {
  background-color: var(--navbar-auth-bg) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

.navbar-auth .navbar-brand {
  font-weight: 700;
  color: var(--navbar-auth-text) !important;
}

.navbar-auth .nav-link {
  color: var(--navbar-auth-text) !important;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem !important;
  transition: background-color 0.2s, color 0.2s;
}

.navbar-auth .nav-link:hover {
  background-color: var(--navbar-auth-hover);
  color: #fff !important;
}

.navbar-auth .dropdown-menu {
  background-color: var(--navbar-auth-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.navbar-auth .dropdown-item {
  color: var(--navbar-auth-text);
}

.navbar-auth .dropdown-item:hover {
  background-color: var(--navbar-auth-hover);
  color: #fff;
}

.navbar-auth .dropdown-item.active {
  background-color: var(--navbar-auth-active);
  color: #fff;
}

/* ========== Layout: Nav (Promo) ========== */
.navbar-promo {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar-promo .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary) !important;
}

.navbar-promo .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.navbar-promo .nav-link:hover {
  color: var(--brand-primary) !important;
  background: rgba(79, 70, 229, 0.06);
}

.navbar-promo .btn-cta {
  background: var(--brand-gradient);
  color: #fff !important;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.navbar-promo .btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: #fff !important;
}

/* ========== Layout: Main & Footer ========== */
main {
  min-height: 60vh;
}

.footer-promo {
  background: var(--heading-color);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  margin-top: 4rem;
  border: none;
}

.footer-promo a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-promo a:hover {
  color: #fff;
}

/* ========== Hero (landing) ========== */
.hero-promo {
  position: relative;
  padding: 3.5rem 0 4rem;
  overflow: hidden;
  background: var(--hero-bg);
}

@media (min-width: 768px) {
  .hero-promo {
    padding: 4.5rem 0 5.5rem;
  }
}

.hero-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-gradient-soft);
  pointer-events: none;
}

.hero-promo .container {
  position: relative;
  z-index: 1;
}

.hero-promo .display-4,
.hero-promo .display-5,
.hero-promo .display-md-3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

@media (min-width: 768px) {
  .hero-promo .display-md-3 {
    font-size: calc(1.5rem + 3vw);
  }
}

.hero-promo .lead {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Buttons ========== */
.btn-brand {
  background: var(--brand-gradient);
  color: #fff !important;
  font-weight: 600;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-brand:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-brand-outline {
  background: transparent;
  color: var(--brand-primary);
  font-weight: 600;
  border: 2px solid var(--brand-primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

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

/* Trong card dùng stretched-link: không transform nút để tránh chớp khi hover cả card */
.product-card .btn-brand-outline:hover {
  transform: none;
}

/* ========== Product cards (promo grid) ========== */
.product-card {
  background: var(--surface-elevated);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  height: 100%;
}

/* (product-card hover moved to animation block below for clarity) */

.product-card .card-body {
  padding: 1.75rem;
}

.product-card .card-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--heading-color);
}

.product-card .card-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.product-card .product-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  background: var(--brand-gradient-soft);
}

.product-card .stretched-link::after {
  border-radius: var(--radius);
}

/* ========== Section headings ========== */
.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

/* ========== Product icon float ========== */
.product-icon {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.hero-promo .product-icon-wrap-hero {
  width: 6rem;
  height: 6rem;
  border-radius: var(--radius-xl);
  background: var(--brand-gradient-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

/* ========== CTA strip ========== */
.cta-strip {
  background: var(--brand-gradient);
  color: #fff;
  padding: 2.5rem 0;
  text-align: center;
}

.cta-strip .lead {
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1rem;
}

.cta-strip .btn-light {
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
}

/* ========== Breadcrumb ========== */
.breadcrumb-promo .breadcrumb {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-promo .breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-promo .breadcrumb-item a:hover {
  color: var(--brand-primary);
}

.breadcrumb-promo .breadcrumb-item.active {
  color: var(--text-secondary);
}

/* Section bg alternation */
section.bg-light {
  background: var(--surface-muted) !important;
}

/* ========== Feature cards (product detail) ========== */
.feature-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: 100%;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.15);
}

.feature-card .card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--heading-color);
}

.feature-card .card-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.feature-card code {
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  background: var(--surface-muted);
  border-radius: 0.25rem;
}

/* ========== Animations (rõ ràng, không bị override) ========== */
/* Hero: chỉ animate transform, không ẩn chữ — nội dung banner luôn thấy */
@keyframes fadeInUp {
  from {
    transform: translateY(32px);
    opacity: 0.85;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes iconGlow {

  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(79, 70, 229, 0.3));
  }

  50% {
    filter: drop-shadow(0 4px 12px rgba(79, 70, 229, 0.25));
  }
}

/* Hero: xuất hiện lần lượt từ dưới lên (chữ luôn hiển thị) */
.animate-hero {
  opacity: 1;
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-hero.animate-hero-delay-1 {
  animation-delay: 0.15s;
}

.animate-hero.animate-hero-delay-2 {
  animation-delay: 0.35s;
}

.animate-hero.animate-hero-delay-3 {
  animation-delay: 0.55s;
}

.animate-hero.animate-hero-delay-4 {
  animation-delay: 0.75s;
}

/* Scroll reveal: ẩn rồi trượt lên + hiện khi vào viewport */
.animate-reveal {
  opacity: 0 !important;
  transform: translateY(48px) !important;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

.animate-reveal.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: calc(var(--reveal-delay, 0) * 0.1s);
}

.reveal-delay-0 {
  --reveal-delay: 0;
}

.reveal-delay-1 {
  --reveal-delay: 1;
}

.reveal-delay-2 {
  --reveal-delay: 2;
}

.reveal-delay-3 {
  --reveal-delay: 3;
}

.reveal-delay-4 {
  --reveal-delay: 4;
}

.reveal-delay-5 {
  --reveal-delay: 5;
}

/* Icon trong card: float nhẹ */
.product-icon-wrap .product-icon,
.product-icon-wrap-hero .product-icon {
  animation: float 2.5s ease-in-out infinite;
}

/* Card hover: chỉ đổi bóng đổ (không transform để tránh chớp do chuột ra ngoài vùng hover) */
.product-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.2);
}

.feature-card:hover {
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
  border-color: rgba(79, 70, 229, 0.15);
}

@media (prefers-reduced-motion: reduce) {

  .animate-hero,
  .animate-reveal {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-reveal.revealed {
    opacity: 1;
    transform: none;
  }

  .product-icon {
    animation: none;
  }

  .product-card:hover,
  .feature-card:hover {
    transform: none;
  }
}