/* ==========================================================================
   LÁ SỐ TỬ VI - GIAO DIỆN HIỆN ĐẠI & SANG TRỌNG
   Phong cách Á Đông Đương Đại (Modern Oriental Mystery & Luxury)
   ========================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-card: #131c2e;
  --bg-card-hover: #1a263f;
  --bg-inner: #0e1626;
  --border-color: #27354f;
  --border-gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-gold: #f6c85f;
  
  --primary-accent: #c2410c;
  --primary-hover: #ea580c;
  --good-color: #10b981;
  --bad-color: #f43f5e;
  --blue-color: #38bdf8;
  --purple-color: #c084fc;

  /* Màu Ngũ Hành */
  --hanh-kim: #f8fafc;
  --hanh-moc: #4ade80;
  --hanh-thuy: #38bdf8;
  --hanh-hoa: #f87171;
  --hanh-tho: #fbbf24;

  --font-serif: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #030712;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Bầu Trời Sao Lung Linh Huyền Ảo (Sparkling Celestial Sky) */
.sparkling-sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: 
    radial-gradient(ellipse at 50% -10%, rgba(212, 175, 55, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(56, 189, 248, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 90% 65%, rgba(168, 85, 247, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 45% 95%, rgba(244, 63, 94, 0.09) 0%, transparent 45%),
    linear-gradient(180deg, #030712 0%, #070e22 50%, #020617 100%);
}

/* Lớp sao 1: Các ngôi sao lớn lấp lánh kim cương & vàng */
.star-layer-1 {
  position: absolute;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='%23f6c85f'%3E%3Cpath d='M110 98 L113 107 L122 110 L113 113 L110 122 L107 113 L98 110 L107 107 Z' fill='%23fef08a' fill-opacity='0.9' filter='drop-shadow(0 0 4px %23f59e0b)'/%3E%3Cpath d='M35 25 L37 33 L45 35 L37 37 L35 45 L33 37 L25 35 L33 33 Z' fill='%23bae6fd' fill-opacity='0.85'/%3E%3Cpath d='M180 40 L182 46 L188 48 L182 50 L180 56 L178 50 L172 48 L178 46 Z' fill='%23fde047' fill-opacity='0.8'/%3E%3Ccircle cx='70' cy='180' r='1.8' fill='%23ffffff' fill-opacity='0.9'/%3E%3Ccircle cx='195' cy='165' r='2' fill='%23fde047' fill-opacity='0.85'/%3E%3C/g%3E%3C/svg%3E");
  animation: twinkleSparkle1 4s ease-in-out infinite alternate;
}

/* Lớp sao 2: Chòm sao và tinh tú xanh băng */
.star-layer-2 {
  position: absolute;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23ffffff'%3E%3Cpath d='M80 20 L81.5 26 L87.5 27.5 L81.5 29 L80 35 L78.5 29 L72.5 27.5 L78.5 26 Z' fill='%23e0f2fe' fill-opacity='0.75'/%3E%3Ccircle cx='30' cy='90' r='1.2' fill='%23fef08a' fill-opacity='0.7'/%3E%3Ccircle cx='140' cy='110' r='1.5' fill='%23ffffff' fill-opacity='0.8'/%3E%3Ccircle cx='120' cy='30' r='1' fill='%2338bdf8' fill-opacity='0.75'/%3E%3Ccircle cx='60' cy='140' r='1.4' fill='%23fde047' fill-opacity='0.7'/%3E%3Cpath d='M30 90 L60 140 M120 30 L140 110' stroke='%2338bdf8' stroke-width='0.4' stroke-opacity='0.15' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  animation: twinkleSparkle2 5.5s ease-in-out infinite alternate 1.5s;
}

/* Lớp sao 3: Bụi sao nhuyễn lung linh xa xăm */
.star-layer-3 {
  position: absolute;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23ffffff' fill-opacity='0.5'%3E%3Ccircle cx='15' cy='15' r='0.75'/%3E%3Ccircle cx='85' cy='25' r='0.6'/%3E%3Ccircle cx='45' cy='75' r='0.8'/%3E%3Ccircle cx='70' cy='60' r='0.5'/%3E%3Ccircle cx='30' cy='45' r='0.65'/%3E%3C/g%3E%3C/svg%3E");
  animation: shimmerDust 8s linear infinite alternate;
}

@keyframes twinkleSparkle1 {
  0% { opacity: 0.45; transform: scale(0.97); }
  50% { opacity: 0.95; transform: scale(1.02); filter: drop-shadow(0 0 8px rgba(246, 200, 95, 0.6)); }
  100% { opacity: 0.55; transform: scale(0.99); }
}

@keyframes twinkleSparkle2 {
  0% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.9; transform: scale(1.03); filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5)); }
  100% { opacity: 0.45; transform: scale(0.96); }
}

@keyframes shimmerDust {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.35; }
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-mark-svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(246, 200, 95, 0.35));
}

.logo-group:hover .logo-mark-svg {
  transform: rotate(15deg) scale(1.06);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Playfair Display', var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.brand-slogan {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-gold);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
button, .btn-primary, .btn-outline, .btn-action {
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff;
  border: 1px solid #f59e0b;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 0 15px var(--gold-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--border-gold);
  color: var(--text-gold);
}

.btn-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-action:hover {
  border-color: var(--text-gold);
  color: var(--text-gold);
}

/* Layout */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.site-footer {
  position: relative;
  z-index: 1;
}

.form-section {
  position: relative;
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.95) 0%, rgba(14, 22, 38, 0.95) 100%);
  border: 2px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.65), 0 0 30px rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  color: var(--text-gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.hero-desc {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-desc strong {
  color: var(--text-main);
}

/* Cards Box */
.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 2.5rem;
}

/* Form */
.section-title-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-gold);
  margin-bottom: 0.3rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.req {
  color: var(--bad-color);
}

input, select {
  background: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.date-inputs {
  display: flex;
  gap: 0.5rem;
}

.date-inputs input {
  flex: 1;
  text-align: center;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #b45309, #d97706);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.3);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

/* Bàn Cờ 12 Cung Tử Vi */
.chart-display-section {
  margin-top: 2rem;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.toolbar-title h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-gold);
}

.live-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--good-color);
  color: var(--good-color);
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 0.3rem;
}

.toolbar-btns {
  display: flex;
  gap: 0.75rem;
}

.highlight-pulse {
  animation: pulseGold 2s infinite;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 10px rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.7); }
}

/* Bố cục Lưới 4x4 Chuẩn Tử Vi (Khổ A4 Tinh Khôi Màu Trắng & Kem) */
.ban-co-wrapper {
  max-width: 840px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 2px solid #b4832a;
  outline: 1px solid rgba(180, 131, 42, 0.4);
  outline-offset: -5px;
  background: #faf6ee;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 35px rgba(180, 131, 42, 0.08);
  position: relative;
}

.ban-co-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(136px, 1fr));
  gap: 1.5px;
  background: #d8c7a6;
  width: 100%;
  min-width: 0;
}

/* Ô Cung đơn lẻ (Nền Trắng Sứ & Kem Nhẹ Nhàng) */
.cung-item {
  background: #ffffff;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 136px;
  font-size: 0.78rem;
  color: #1e293b;
}

.cung-item:hover {
  background: #fffdf5;
  outline: 2px solid #b4832a;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(180, 131, 42, 0.2);
}

.cung-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid #ebdcc5;
  padding-bottom: 0.25rem;
  margin-bottom: 0.35rem;
}

.cung-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.cung-name {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.9rem;
  color: #991b1b; /* Đỏ chu sa cổ truyền */
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.cung-badge-than {
  background: #dc2626;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.cung-can-chi {
  font-size: 0.74rem;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.cung-hanh-tag {
  font-size: 0.65rem;
  color: #b45309;
  font-weight: 600;
}

.cung-stars-body {
  flex-grow: 1;
  display: flex;
  gap: 0.4rem;
  overflow: hidden;
}

.col-chinh-tinh {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.star-chinh {
  font-size: 0.84rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.25;
}

/* Màu Ngũ Hành Chính Tinh trên nền Trắng Kem */
.s-hanh-Kim { color: #334155; } /* Xám thép đậm */
.s-hanh-Moc { color: #15803d; } /* Xanh lục đậm */
.s-hanh-Thuy { color: #0284c7; } /* Xanh lam sáng */
.s-hanh-Hoa { color: #dc2626; } /* Đỏ cờ thắm */
.s-hanh-Tho { color: #d97706; } /* Vàng nâu hổ phách */

.dac-tinh-tag {
  font-size: 0.62rem;
  padding: 0.02rem 0.2rem;
  border-radius: 2px;
  font-weight: 800;
  line-height: 1;
}

.dac-tinh-M { color: #b45309; border: 1px solid #d97706; background: #fef3c7; } /* Miếu */
.dac-tinh-V { color: #15803d; border: 1px solid #16a34a; background: #dcfce7; } /* Vượng */
.dac-tinh-Đ { color: #0369a1; border: 1px solid #0284c7; background: #e0f2fe; } /* Đắc */
.dac-tinh-B { color: #475569; border: 1px solid #94a3b8; background: #f1f5f9; } /* Bình */
.dac-tinh-H { color: #b91c1c; border: 1px solid #ef4444; background: #fee2e2; } /* Hãm */

.col-phu-tinh {
  flex: 1.3;
  font-size: 0.68rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.star-cat {
  color: #0369a1;
  font-weight: 600;
}

.star-hung {
  color: #b91c1c;
  font-weight: 600;
}

.star-luu {
  color: #ea580c;
  font-weight: 800;
}

.tuan-triet-badge {
  display: inline-block;
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
  font-weight: 800;
  font-size: 0.62rem;
  line-height: 1;
}

.cung-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ebdcc5;
  padding-top: 0.2rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: #64748b;
}

.cung-footer strong {
  color: #0f172a;
  font-weight: 700;
}

.badge-trang-sinh {
  color: #6d28d9;
  font-weight: 700;
  font-size: 0.65rem;
  background: #f5f3ff;
  padding: 0.02rem 0.25rem;
  border-radius: 2px;
  border: 1px solid #ddd6fe;
}

.cung-score {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.02rem 0.25rem;
  border-radius: 2px;
}
.score-vuong { color: #15803d; background: #dcfce7; border: 1px solid #86efac; }
.score-cat { color: #0369a1; background: #e0f2fe; border: 1px solid #7dd3fc; }
.score-binh { color: #475569; background: #f1f5f9; border: 1px solid #cbd5e1; }
.score-hung { color: #b91c1c; background: #fee2e2; border: 1px solid #fca5a5; }

/* Thiên Bàn (Trung Cung 2x2 - Khổ A4 Vàng Kem Hoàng Gia) */
.thien-ban-cell {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  background: #faf4e6;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 2px solid #b4832a;
  outline: 1px solid rgba(180, 131, 42, 0.4);
  outline-offset: -4px;
  box-shadow: inset 0 0 20px rgba(180, 131, 42, 0.08);
}

/* Logo Sao Lành trên Thiên Bàn lá số */
.thien-ban-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed rgba(180, 131, 42, 0.4);
}

.thien-ban-logo-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.thien-ban-logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
}

.thien-ban-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.thien-ban-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #151c38;
  line-height: 1.1;
  letter-spacing: 0.3px;
}

.thien-ban-brand-slogan {
  font-size: 0.52rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 1px;
}

.thien-ban-title {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: #991b1b;
  border-bottom: 2px solid #dfcfb2;
  padding-bottom: 0.3rem;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.thien-ban-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 0.74rem;
  margin: 0.45rem 0;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  line-height: 1.35;
}

.meta-label {
  color: #64748b;
  font-weight: 500;
}

.meta-val {
  color: #0f172a;
  font-weight: 700;
}

.thien-ban-luu-box {
  background: #ffffff;
  border: 1px dashed #b4832a;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.74rem;
  color: #b45309;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(180, 131, 42, 0.06);
}

.click-hint {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-card.modal-large {
  max-width: 950px;
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-serif);
  color: var(--text-gold);
  font-size: 1.25rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

.free-summary-box {
  background: var(--bg-inner);
  border-left: 4px solid var(--border-gold);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.free-summary-box h4 {
  color: var(--text-gold);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.modal-cta-box {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid #d97706;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  margin-top: 1.5rem;
}

.modal-cta-box p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* Package Selection Grid */
.package-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.package-card {
  background: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
}

.package-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.package-card.featured {
  border: 2px solid #f59e0b;
  background: linear-gradient(180deg, #18233a 0%, #10192b 100%);
}

.pkg-badge {
  position: absolute;
  top: -12px;
  right: 15px;
  background: #f59e0b;
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.pkg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.pkg-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.pkg-price {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-gold);
}

.pkg-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.btn-select-pkg {
  width: 100%;
  padding: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-select-pkg:hover, .btn-pkg-featured {
  background: linear-gradient(135deg, #b45309, #d97706);
  border-color: #f59e0b;
  color: #fff;
}

/* VietQR Step */
.qr-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: center;
}

.qr-image-wrap {
  text-align: center;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius-md);
}

.qr-image-wrap img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.qr-status-indicator {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #0b0f19;
  font-weight: 600;
}

.pulsing-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.price-display {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-gold);
  margin: 0.5rem 0 1rem 0;
}

.transfer-details {
  background: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}

.highlight-row {
  background: rgba(212, 175, 55, 0.1);
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}

.color-gold { color: var(--text-gold); }

.qr-instructions {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sandbox-test-wrap {
  margin-top: 1rem;
}

.btn-sandbox {
  width: 100%;
  padding: 0.6rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--good-color);
  color: var(--good-color);
  font-size: 0.85rem;
}

.btn-sandbox:hover {
  background: var(--good-color);
  color: #000;
}

/* Report Section */
.report-section {
  border: 1px solid var(--border-gold);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.report-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.report-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.report-code {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.report-code strong {
  color: var(--text-gold);
}

/* Markdown Styling */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #cbd5e1;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: var(--font-serif);
  color: var(--text-gold);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.markdown-body h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.markdown-body h3 {
  font-size: 1.25rem;
  color: #fff;
}

.markdown-body p, .markdown-body ul, .markdown-body ol {
  margin-bottom: 1.25rem;
}

.markdown-body ul {
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body strong {
  color: #fff;
}

.markdown-body blockquote {
  border-left: 4px solid var(--border-gold);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

/* Lookup Modal */
.lookup-tip {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.lookup-input-group {
  display: flex;
  gap: 0.5rem;
}

.lookup-input-group input {
  flex: 1;
}

.lookup-result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-inner);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: #070a12;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Free Analysis Section */
.free-analysis-section {
  margin-top: 2.5rem;
  padding: 2.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.free-analysis-header {
  text-align: center;
  margin-bottom: 2rem;
}

.free-badge {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--text-gold);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.free-analysis-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  color: var(--text-gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.free-analysis-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

.free-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.analysis-card {
  background: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.analysis-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.analysis-card.highlight-2027 {
  border-color: rgba(246, 200, 95, 0.45);
  background: linear-gradient(145deg, #131c2e 0%, #1c2844 100%);
}

.analysis-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.analysis-icon {
  font-size: 1.5rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.analysis-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
}

.analysis-tag.tag-gold {
  color: var(--text-gold);
}

.analysis-card-header h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-top: 0.15rem;
  line-height: 1.4;
  font-weight: 600;
}

.analysis-card-body {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.65;
  margin: 0;
  flex-grow: 1;
}

/* Teaser Paywall Card */
.teaser-paywall-box {
  background: linear-gradient(135deg, rgba(26, 39, 66, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.teaser-paywall-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4af37, #ea580c, #d4af37);
}

.teaser-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f43f5e;
  letter-spacing: 1.2px;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.teaser-title {
  font-size: 1.25rem;
  font-family: var(--font-serif);
  color: var(--text-gold);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.teaser-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.teaser-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #a7f3d0;
  font-weight: 500;
}

.teaser-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.btn-large {
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-glow {
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.4);
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.4);
  }
  50% {
    box-shadow: 0 0 35px rgba(234, 88, 12, 0.75);
  }
}

.teaser-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Homepage Articles Grid */
.home-articles-section {
  padding: 2.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.home-article-card {
  background: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.home-article-thumb-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #0f172a;
}

.home-article-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.home-article-card:hover .home-article-thumb-wrap img {
  transform: scale(1.05);
}

.home-article-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 15, 25, 0.88);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.home-article-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.home-article-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

.home-article-summary {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-gold);
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
  .qr-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .free-analysis-grid {
    grid-template-columns: 1fr;
  }
  .home-articles-grid {
    grid-template-columns: 1fr;
  }
  .teaser-paywall-box {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  .teaser-features {
    justify-content: center;
  }
}

/* Print Stylesheet (Xuất PDF đẹp làm quà tặng) */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .site-header, .hero-section, .form-section, .modal-overlay, .site-footer, .report-actions, .chart-toolbar, .click-hint {
    display: none !important;
  }
  .report-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .markdown-body {
    color: #111 !important;
    font-size: 11pt !important;
  }
  .markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #000 !important;
    page-break-after: avoid;
  }
  .ban-co-wrapper {
    box-shadow: none !important;
    border: 1px solid #333 !important;
    page-break-after: always;
  }
}


/* ============================================================
   TIỆN ÍCH PHONG THỦY CỘT PHẢI (SAO LÀNH SIDEBAR)
   ============================================================ */
.home-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 1024px) {
  .home-top-grid {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }
}

.fengshui-sidebar {
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.95) 0%, rgba(14, 22, 38, 0.95) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.sidebar-header {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(246, 200, 95, 0.2);
}

.sidebar-title {
  font-size: 1.15rem;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem 0;
  font-family: 'Playfair Display', serif;
}

.sidebar-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.fs-tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  background: rgba(10, 16, 29, 0.85);
  padding: 0.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fs-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.45rem 0.15rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.fs-tab-btn.active, .fs-tab-btn:hover {
  background: rgba(246, 200, 95, 0.18);
  color: var(--text-gold);
  border: 1px solid rgba(246, 200, 95, 0.35);
}

.fs-tab-pane {
  display: none;
}

.fs-tab-pane.active {
  display: block;
}

.fs-field-group {
  margin-bottom: 0.75rem;
}

.fs-field-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.fs-input-row {
  display: flex;
  gap: 0.5rem;
}

.fs-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: rgba(10, 16, 29, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.fs-input:focus {
  border-color: var(--text-gold);
}

.fs-btn-calc {
  width: 100%;
  padding: 0.6rem;
  background: linear-gradient(135deg, #d4af37 0%, #f6c85f 100%);
  color: #0b1120;
  font-weight: 700;
  font-size: 0.82rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 0.4rem;
}

.fs-btn-calc:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(246, 200, 95, 0.3);
}

.fs-result-box {
  margin-top: 0.85rem;
  padding: 0.75rem;
  background: rgba(10, 16, 29, 0.85);
  border: 1px solid rgba(246, 200, 95, 0.25);
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.fs-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.fs-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

.fs-badge.good { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.fs-badge.bad { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.fs-badge.gold { background: rgba(246, 200, 95, 0.2); color: #f6c85f; }

.fs-huong-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.45rem 0;
}

.fs-huong-item {
  padding: 0.35rem 0.45rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
}

.fs-huong-item.good { border-left: 3px solid #10b981; }
.fs-huong-item.bad { border-left: 3px solid #ef4444; }

.fs-huong-name {
  font-weight: 700;
  display: block;
  font-size: 0.78rem;
}

.fs-huong-sao {
  font-size: 0.7rem;
  color: var(--text-muted);
}
