/* ==========================================================================
   site.css — giao diện dùng chung.
   Màu chủ đạo lấy từ config.js qua biến CSS, nên đổi thương hiệu không cần
   sửa file này.
   ========================================================================== */

:root {
  --primary: #0e7490;
  --primary-dark: #0b5b71;
  --primary-soft: #ecfeff;
  --accent: #ea580c;
  --accent-dark: #c2410c;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo-box { width: 42px; height: 42px; flex: 0 0 42px; display: flex; align-items: center; justify-content: center; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: .5px; font-size: 15px;
}
.logo-img { width: auto; height: 42px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; padding: 8px 12px; border-radius: 9px; }
.nav a:hover { color: var(--ink); background: var(--bg); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 11px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; font-family: var(--font);
  cursor: pointer; text-decoration: none; transition: .15s ease;
  line-height: 1.2;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-block { width: 100%; }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 12% 0%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(ellipse 60% 70% at 92% 100%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 84px 0 92px;
}
/* Đường cong mềm ngăn cách khối đầu trang với phần nội dung phía dưới */
.hero::after {
  content: ""; position: absolute; left: -5%; right: -5%; bottom: -60px; height: 120px;
  background: var(--bg); border-radius: 50% 50% 0 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 4.6vw, 47px); line-height: 1.16; margin: 0 0 18px; font-weight: 800; letter-spacing: -1px; }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); opacity: .93; margin: 0 0 30px; max-width: 620px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { padding: 14px 26px; font-size: 15.5px; }
.hero .btn-primary { box-shadow: 0 6px 20px rgba(234,88,12,.35); }

/* Dải cam kết ngay dưới nút hành động */
.hero-trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; font-size: 14px; opacity: .9; }
.hero-trust span { display: flex; align-items: center; gap: 7px; }
.hero-trust b { font-weight: 700; }
.hero .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-outline:hover { background: rgba(255,255,255,.2); }

.ref-banner {
  display: none; margin-top: 26px; padding: 12px 16px; border-radius: 11px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  font-size: 14px;
}
.ref-banner.show { display: block; }
.ref-banner b { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 1px; }

/* --- Sections ------------------------------------------------------------- */
section { padding: 68px 0; }
.section-head { margin-bottom: 34px; max-width: 720px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(23px, 3.1vw, 32px); margin: 0 0 10px; font-weight: 800; letter-spacing: -.6px; }
.section-head p { color: var(--muted); margin: 0; font-size: 16px; line-height: 1.6; }
.bg-white { background: #fff; }

/* --- Cards / grid --------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.card-pad { padding: 22px; }

/* --- Thẻ tour ------------------------------------------------------------- */
.tour-card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tour-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(15,23,42,.06), 0 18px 40px rgba(15,23,42,.12);
  border-color: #cbd5e1;
}

.tour-media { position: relative; height: 190px; overflow: hidden; background: var(--primary-soft); }
.tour-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.tour-card:hover .tour-img { transform: scale(1.05); }

/* Khi tour chưa có ảnh: dựng một nền có chiều sâu bằng CSS thay vì để ô trống.
   Mỗi tour lấy một tông màu khác nhau theo thứ tự hiển thị. */
.tour-media-blank {
  height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; position: relative;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.55), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.30), transparent 46%),
    linear-gradient(135deg, var(--tone-a), var(--tone-b));
}
.tour-media-blank::after {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.6) 0 1px, transparent 1px 13px);
}
.tour-media-blank span {
  position: relative; z-index: 1; color: #fff; font-weight: 800;
  font-size: 21px; letter-spacing: -.3px; line-height: 1.25;
  text-shadow: 0 1px 12px rgba(15,23,42,.28);
}
.tone-0 { --tone-a: #0e7490; --tone-b: #155e75; }
.tone-1 { --tone-a: #0891b2; --tone-b: #0e7490; }
.tone-2 { --tone-a: #0d9488; --tone-b: #0f766e; }
.tone-3 { --tone-a: #2563eb; --tone-b: #1e40af; }
.tone-4 { --tone-a: #7c3aed; --tone-b: #5b21b6; }

.tour-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,.94); color: var(--ink);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(15,23,42,.12);
}

.tour-body { padding: 20px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.tour-title { font-size: 18.5px; font-weight: 800; margin: 0; letter-spacing: -.3px; line-height: 1.3; }
.tour-sum { font-size: 14.5px; color: #475569; margin: 0; line-height: 1.55; }

.tour-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.tour-chip {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border: 1px solid #cffafe;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap;
}

.tour-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line);
}
.price { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1.15; letter-spacing: -.4px; }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); display: block; letter-spacing: 0; }
.tour-deposit { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* --- Steps ---------------------------------------------------------------- */
.steps { counter-reset: s; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; transition: border-color .2s ease, box-shadow .2s ease;
}
.step:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.step-num {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 800; display: flex; align-items: center;
  justify-content: center; margin-bottom: 14px; font-size: 16px;
  box-shadow: 0 4px 12px rgba(14,116,144,.28);
}
.step h3 { margin: 0 0 6px; font-size: 16.5px; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* --- Forms ---------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: var(--font); color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
}
textarea { min-height: 92px; resize: vertical; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

/* --- Alerts / badges ------------------------------------------------------ */
.alert { padding: 14px 16px; border-radius: 11px; font-size: 14.5px; margin-bottom: 18px; border: 1px solid; }
.alert-ok { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert-err { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-info { background: var(--primary-soft); border-color: #a5f3fc; color: #164e63; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-mute { background: #f1f5f9; color: var(--muted); }

/* --- Stats ---------------------------------------------------------------- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.hl { border-color: var(--primary); background: var(--primary-soft); }

/* --- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14.5px; }

/* --- Ref link box --------------------------------------------------------- */
.reflink { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.reflink input { flex: 1; min-width: 240px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; background: #f8fafc; }

/* --- Tabs ----------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab {
  padding: 12px 16px; border: none; background: none; cursor: pointer;
  font-size: 14.5px; font-weight: 700; color: var(--muted); font-family: var(--font);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.panel { display: none; }
.panel.active { display: block; }

/* --- Auth pages ----------------------------------------------------------- */
.auth-page { min-height: calc(100vh - 68px); display: flex; align-items: center; padding: 40px 0; }
.auth-card { max-width: 440px; margin: 0 auto; width: 100%; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 14px; font-family: var(--font); }

/* --- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  padding: 13px 22px; border-radius: 11px; color: #fff; font-size: 14.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s ease; z-index: 100; max-width: 92vw;
  text-align: center; box-shadow: 0 10px 30px rgba(15,23,42,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: #0f172a; }
.toast-error { background: var(--danger); }

/* --- Modal ---------------------------------------------------------------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: none; align-items: center; justify-content: center; z-index: 80; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; padding: 26px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* --- Footer --------------------------------------------------------------- */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 40px 0 32px; font-size: 14px; margin-top: 20px; }
.site-footer a { color: #e2e8f0; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 24px; }
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 10px; }
.site-footer p { margin: 4px 0; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 18px; color: #94a3b8; font-size: 13px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .hero { padding: 46px 0 52px; }
  section { padding: 44px 0; }
  .site-header .wrap { min-height: 62px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .form-card { padding: 20px; }
}
