/* ============================================================================
   theme-a-huyen-bi.css — Theme A "Huyền bí vũ trụ"
   Bảng màu đã chốt (mục 21 PROJECT_SPEC):
     - Nền: gradient tím đen #1a1330 -> #0a0714 + ảnh nền vũ trụ mờ
     - Điểm nhấn: vàng đồng #c9a24b, kem #f4e9c1
     - Chữ phụ: tím nhạt #c9bce8 / #a89bc9
     - Font: Georgia serif
     - Khối full report: nền "giấy da" be nhạt #f4ecd8, chữ tối #3a2f1f (nổi bật
       trên nền tối để không mỏi mắt khi đọc đoạn dài) - áp dụng ở ket-qua.php
       (chưa làm đợt này, chuẩn bị sẵn class .report-text cho lượt sau).

   LƯU Ý: ảnh nền `media/bg-cosmic.png` cần người dùng tự upload (mục 21).
   Trước khi upload, background vẫn hiển thị đúng nhờ lớp gradient màu làm nền
   dự phòng (không bị trắng/vỡ giao diện nếu ảnh chưa có).
   ============================================================================ */

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

body {
  font-family: Georgia, 'Times New Roman', serif;
  background-color: #0a0714; /* nền dự phòng nếu ảnh chưa tải/chưa upload */
  background-image:
    linear-gradient(180deg, rgba(26,19,48,0.55) 0%, rgba(10,7,20,0.75) 100%),
    url('bg-cosmic.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #f4e9c1;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- Khung chung: header / nav / footer ---------- */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

.site-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.site-header .logo-area { display: flex; align-items: center; gap: 12px; }
.site-header img.logo { height: 44px; filter: drop-shadow(0 0 4px rgba(201,162,75,0.4)); }
.site-header strong { color: #f4e9c1; }
.site-header .tagline { color: #c9bce8; font-size: 14px; }

nav.site-nav {
  background: rgba(26,19,48,0.55);
  border: 1px solid rgba(201,162,75,0.25);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  backdrop-filter: blur(6px);
}
nav.site-nav a { text-decoration: none; color: #f4e9c1; font-weight: 600; font-size: 14px; }
nav.site-nav a:hover { color: #c9a24b; }
nav.site-nav a.active { color: #c9a24b; }

.site-footer { text-align: center; padding: 24px 0 8px; color: #a89bc9; font-size: 13px; }

/* ---------- Card / container dùng chung ---------- */
.container { max-width: 640px; margin: 0 auto; }
.card {
  background: rgba(26,19,48,0.55);
  border: 1px solid rgba(201,162,75,0.25);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  margin-bottom: 16px;
  color: #f4e9c1;
}
h1 { font-size: 24px; margin-bottom: 8px; color: #f4e9c1; }
.subtitle { color: #c9bce8; margin-bottom: 24px; }
.empty-msg { color: #a89bc9; font-size: 13px; }

/* ---------- index.php: layout 3 cột + form + tier-table ---------- */
.main-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px; align-items: start; margin-bottom: 24px; }
@media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }
.ad-box {
  background: rgba(26,19,48,0.4);
  border: 1px solid rgba(201,162,75,0.2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-box img { width: 100%; height: auto; display: block; }
.ad-box.empty { color: #a89bc9; font-size: 13px; border: 1px dashed rgba(201,162,75,0.3); box-shadow: none; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .content-grid { grid-template-columns: 1fr; } }
.list-card {
  background: rgba(26,19,48,0.55);
  border: 1px solid rgba(201,162,75,0.25);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
}
.list-card h2 { font-size: 16px; margin-bottom: 12px; color: #c9a24b; }
.list-card .item { padding: 10px 0; border-bottom: 1px solid rgba(201,162,75,0.2); font-size: 14px; }
.list-card .item:last-child { border-bottom: none; }
.list-card .item a { color: #f4e9c1; text-decoration: none; font-weight: 600; }
.list-card .item a:hover { color: #c9a24b; }
.list-card .item .excerpt { color: #a89bc9; font-size: 13px; margin-top: 3px; }
.list-card .empty-msg { color: #a89bc9; font-size: 13px; }

label { display: block; font-weight: 600; margin-bottom: 6px; margin-top: 16px; font-size: 14px; color: #f4e9c1; }
label:first-child { margin-top: 0; }
input, select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,162,75,0.35);
  border-radius: 8px;
  font-size: 15px;
  color: #f4e9c1;
}
input::placeholder { color: #a89bc9; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }
button {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: #c9a24b;
  color: #1a1330;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { background: #dab668; }
.error { color: #e8a4a4; margin-top: 10px; font-size: 14px; }
.hidden { display: none; }

/* Khối full report - nền "giấy da" nổi bật để đọc đoạn dài không mỏi mắt (mục 21) */
.report-text {
  white-space: pre-wrap;
  font-size: 15px;
  background: #f4ecd8;
  color: #3a2f1f;
  padding: 20px;
  border-radius: 10px;
}
/* LỖI THẬT ĐÃ GẶP: ".card p" (dùng cho gioi-thieu.php/lien-he.php) vô tình khớp luôn
   vào thẻ <p> bên trong .report-text (vì .report-text cũng nằm trong 1 .card ở
   ket-qua.php) - khiến chữ bị đổi thành màu kem #f4e9c1, gần như trùng màu nền
   be #f4ecd8 của khối "giấy da", chữ gần như vô hình. Cố định lại bằng selector
   đặc hiệu hơn (.card .report-text p có 3 class, thắng .card p chỉ có 2 class,
   không phụ thuộc thứ tự khai báo trong file). */
.card .report-text p { color: #3a2f1f; }
.fade-section {
  position: relative;
  max-height: 120px;
  overflow: hidden;
  margin-top: 8px;
}
.fade-section::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, rgba(244,236,216,0), #f4ecd8);
}
.unlock-box {
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(201,162,75,0.4);
  border-radius: 10px;
  margin-top: 12px;
}
.unlock-box p { margin-bottom: 14px; font-weight: 600; color: #f4e9c1; }

.tier-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  border: 1px solid rgba(201,162,75,0.3);
  border-radius: 8px;
  overflow: hidden;
}
.tier-table th, .tier-table td {
  text-align: center;
  padding: 12px 8px;
  border: 1px solid rgba(201,162,75,0.15);
  font-size: 13px;
}
.tier-table th { background: rgba(201,162,75,0.15); font-weight: 600; font-size: 14px; color: #f4e9c1; }
.tier-table td { cursor: pointer; color: #f4e9c1; }
.tier-table td.selected { background: rgba(201,162,75,0.2); }
.tier-table input[type="radio"] { width: 18px; height: 18px; margin-bottom: 6px; }
.tier-table label { font-weight: normal; margin: 0; display: block; cursor: pointer; color: #c9bce8; }

/* Ép ghi đè nền vàng mà trình duyệt tự tô khi autofill (email, v.v.) - trick chuẩn dùng
   box-shadow inset. Ở Theme A đặc biệt quan trọng: chữ input màu kem sáng (#f4e9c1),
   nếu để nền autofill vàng nhạt mặc định của trình duyệt đè lên, chữ kem sáng trên nền
   vàng nhạt gần như không đọc được (sáng trên sáng) - ĐÂY LÀ LỖI THẬT ĐÃ GẶP. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px rgba(26,19,48,0.95) inset;
  -webkit-text-fill-color: #f4e9c1;
  caret-color: #f4e9c1;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---------- gioi-thieu.php / lien-he.php: nội dung văn bản dài ---------- */
.card h1 { font-size: 24px; margin-bottom: 16px; color: #f4e9c1; }
.card h2 { font-size: 17px; margin-top: 24px; margin-bottom: 10px; color: #c9a24b; }
.card > p.intro { color: #c9bce8; margin-bottom: 20px; font-size: 15px; }
.card p { margin-bottom: 12px; font-size: 15px; color: #f4e9c1; }
.card ol, .card ul { margin: 0 0 12px 20px; font-size: 15px; color: #f4e9c1; }
.card ol li, .card ul li { margin-bottom: 8px; }
.closing { text-align: center; font-style: italic; color: #c9bce8; margin-top: 20px; font-size: 14px; }

/* ---------- lien-he.php: khối liên hệ + FAQ ---------- */
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,162,75,0.2);
  border-radius: 10px;
}
.contact-item .icon { font-size: 22px; line-height: 1; margin-top: 2px; }
.contact-item .label { font-weight: 600; font-size: 14px; margin-bottom: 3px; color: #f4e9c1; }
.contact-item a { color: #c9a24b; text-decoration: none; font-weight: 600; }
.contact-item a:hover { text-decoration: underline; }
.contact-item .note { color: #a89bc9; font-size: 13px; margin-top: 3px; }
.faq-box { border-top: 1px solid rgba(201,162,75,0.25); padding-top: 18px; margin-top: 6px; }
.faq-box h2 { font-size: 16px; margin-bottom: 10px; color: #c9a24b; }
.faq-box .q { font-weight: 600; font-size: 14px; margin-top: 12px; color: #f4e9c1; }
.faq-box .a { font-size: 14px; color: #c9bce8; margin-top: 3px; }

/* ---------- bai-viet.php: bài viết chi tiết + danh sách ---------- */
.meta { color: #a89bc9; font-size: 13px; margin-bottom: 20px; }
.content { white-space: pre-wrap; font-size: 15px; color: #f4e9c1; }
.section-title { font-size: 18px; font-weight: 700; color: #c9a24b; margin: 20px 0 8px; white-space: normal; }
.section-title:first-child { margin-top: 0; }
.post-list-item { display: block; padding: 16px 0; border-bottom: 1px solid rgba(201,162,75,0.2); text-decoration: none; color: inherit; }
.post-list-item:last-child { border-bottom: none; }
.post-list-item h3 { color: #c9a24b; font-size: 17px; margin-bottom: 6px; }
.post-list-item p { color: #c9bce8; font-size: 14px; }
.back-link { display: inline-block; margin-bottom: 16px; color: #c9a24b; text-decoration: none; font-size: 14px; }
.inline-link { color: #c9a24b; }

/* ---------- tin-tuc.php: danh sách tin ---------- */
.news-item { padding: 16px 0; border-bottom: 1px solid rgba(201,162,75,0.2); }
.news-item:last-child { border-bottom: none; }
.news-item h3 { color: #c9a24b; font-size: 16px; margin-bottom: 6px; }
.news-item .date { font-size: 12px; color: #a89bc9; margin-bottom: 8px; }
.news-item p { font-size: 14px; white-space: pre-wrap; color: #f4e9c1; }

/* ============================================================================
   ket-qua.php: trang kết quả (3 giai đoạn: khám phá / teaser+thanh toán / mở khóa)
   ============================================================================ */
h2 { font-size: 17px; margin-bottom: 10px; color: #f4e9c1; }
.highlight { color: #1a1330; background: #c9a24b; padding: 1px 4px; border-radius: 4px; }

/* Giai đoạn A: câu hỏi gợi ý */
.question-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.question-btn {
  text-align: left; padding: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(201,162,75,0.25);
  border-radius: 10px; cursor: pointer; font-size: 14px; color: #f4e9c1;
}
.question-btn:hover { background: rgba(201,162,75,0.15); border-color: #c9a24b; }
.question-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #c9a24b; margin-bottom: 4px; }
textarea#custom-question {
  width: 100%; padding: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(201,162,75,0.35);
  border-radius: 8px; font-size: 14px; color: #f4e9c1;
  font-family: inherit; min-height: 70px; resize: vertical; margin-top: 6px;
}
textarea#custom-question::placeholder { color: #a89bc9; }
.asked-question { background: rgba(255,255,255,0.05); padding: 12px 14px; border-radius: 8px; font-style: italic; margin-bottom: 14px; font-size: 14px; color: #c9bce8; }

/* Giai đoạn B: QR thanh toán */
.qr-box { text-align: center; padding: 20px; border: 1px dashed rgba(201,162,75,0.4); border-radius: 10px; margin-top: 16px; }
.qr-box img { width: 220px; height: 220px; margin: 12px 0; border-radius: 8px; }
.code { font-size: 20px; font-weight: 700; color: #c9a24b; letter-spacing: 1px; }
.amount { font-size: 18px; font-weight: 700; margin-top: 4px; color: #f4e9c1; }
.amount .old-amount { font-size: 13px; color: #a89bc9; text-decoration: line-through; font-weight: normal; margin-right: 6px; }
.pending-msg { text-align: center; padding: 20px; color: #c9bce8; }
.save-hint { font-size: 13px; color: #e8a4a4; margin-top: 12px; text-align: center; }

/* voucher */
.voucher-row { display: flex; gap: 6px; margin-bottom: 14px; }
.voucher-row input { flex: 1; padding: 9px 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(201,162,75,0.35); border-radius: 6px; font-size: 13px; color: #f4e9c1; }
.voucher-row button { width: auto; margin: 0; padding: 9px 14px; font-size: 13px; }
.voucher-msg { font-size: 12.5px; margin-bottom: 10px; padding: 8px 10px; border-radius: 6px; }
.voucher-msg.ok { background: rgba(201,162,75,0.2); color: #c9a24b; }
.voucher-msg.err { background: rgba(232,164,164,0.15); color: #e8a4a4; }

/* timeline đếm giờ SePay */
.timeline-step { display: flex; gap: 10px; margin-bottom: 14px; }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.timeline-dot.done { background: #c9a24b; color: #1a1330; }
.timeline-dot.active { border: 2px solid #c9a24b; border-top-color: transparent; animation: spin 0.8s linear infinite; }
.timeline-dot.pending { border: 1px solid rgba(201,162,75,0.3); }
@keyframes spin { to { transform: rotate(360deg); } }
.timeline-title { font-size: 12.5px; font-weight: 600; color: #f4e9c1; }
.timeline-sub { font-size: 11px; color: #a89bc9; }
.fallback-link { display: block; text-align: center; font-size: 12px; color: #e8a4a4; text-decoration: underline; margin-top: 14px; cursor: pointer; }

/* Giai đoạn C: bản đồ sao + full report */
.chart-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; font-size: 13px; }
.legend-item { padding: 4px 0; }
.legend-glyph { display: inline-block; width: 20px; color: #c9a24b; font-weight: 700; }
.legend-name { color: #c9bce8; }
.wheel-wrap { text-align: center; }
.wheel-wrap svg { width: 100%; max-width: 400px; }

/* bản đồ sao mờ ở preview (chưa thanh toán) */
.wheel-preview-wrap { position: relative; text-align: center; overflow: hidden; border-radius: 12px; }
.wheel-preview-wrap svg { width: 100%; max-width: 300px; filter: blur(7px) saturate(1.3); opacity: 0.85; pointer-events: none; user-select: none; }
.wheel-preview-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.wheel-preview-lock { font-size: 30px; }
.wheel-preview-text { font-size: 13px; font-weight: 600; color: #1a1330; background: rgba(244,233,193,0.92); padding: 7px 16px; border-radius: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

/* câu hỏi mở rộng cuối full report - nằm trong khối "giấy da" .report-text nên dùng tông sáng tương thích */
.followup-box { background: #efe2c0; border: 1px solid #d8c290; border-radius: 10px; padding: 14px; margin-top: 16px; }
.followup-label { font-size: 11px; color: #8a6a2f; font-weight: 700; margin-bottom: 5px; }
.followup-question { font-size: 13px; font-style: italic; margin-bottom: 10px; color: #3a2f1f; }
.followup-answer { font-size: 13px; line-height: 1.8; white-space: pre-wrap; margin-top: 10px; color: #3a2f1f; }

/* icon hành tinh/cung theo mục nội dung + timeline giai đoạn + trích dẫn tâm lý học (v9)
   - nằm trong khối "giấy da" .report-text nên dùng tông tối/vàng trầm thay vì vàng sáng/kem
     (đủ tương phản trên nền be nhạt #f4ecd8 của report-text) */
.chomsao-report-heading { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; }
.chomsao-report-heading:first-child { margin-top: 0; }
.chomsao-report-heading-text { font-size: 17px; font-weight: 700; color: #8a6a2f; }
.chomsao-timeline-wrap { margin: 16px 0; text-align: center; }
.chomsao-psych-quote {
  margin: 18px 0; padding: 12px 16px; border-left: 3px solid #8a6a2f; border-radius: 0;
  font-style: italic; background: #eadfc4;
}
.chomsao-psych-quote-text { margin: 0 0 4px; font-size: 14px; color: #3a2f1f; }
.chomsao-psych-quote-source { display: block; font-style: normal; font-size: 12.5px; color: #6b5a3a; }
