/* PinSync Sales — hệ thống giao diện dùng chung */

:root {
  --bg: #0B0D12;
  --bg-soft: #11141B;
  --card: #151922;
  --card-hover: #1B2029;
  --border: #242A36;
  --border-bright: #323A4A;

  --text: #EAEEF5;
  --text-muted: #99A2B3;
  --text-dim: #6B7484;

  --brand: #E60023;
  --brand-soft: rgba(230, 0, 35, 0.12);
  --accent: #6E56CF;
  --accent-soft: rgba(110, 86, 207, 0.14);
  --ok: #2FBF71;
  --ok-soft: rgba(47, 191, 113, 0.14);
  --warn: #E8A33D;
  --warn-soft: rgba(232, 163, 61, 0.14);
  --err: #E5484D;
  --err-soft: rgba(229, 72, 77, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1140px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #FF4D6D);
  display: grid; place-items: center; font-size: 16px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--text); }

/* ============ Chuyển ngôn ngữ ============ */
.lang-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; flex-shrink: 0;
}
.lang-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-dim); font-family: inherit; font-size: 11.5px; font-weight: 700;
  letter-spacing: .4px; padding: 4px 11px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--brand); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* ============ Nút ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, background .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #FF1233; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #7E68D8; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-bright); }
.btn-ghost:hover:not(:disabled) { background: var(--card-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ============ Hero ============ */
.hero { padding: 88px 0 72px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 560px; pointer-events: none;
  background: radial-gradient(ellipse, rgba(230, 0, 35, 0.16), transparent 68%);
}
.hero-inner { position: relative; text-align: center; max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  padding: 6px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--brand-soft); color: #FF7A8E; border: 1px solid rgba(230, 0, 35, 0.25);
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 54px); line-height: 1.12;
  letter-spacing: -1.4px; font-weight: 800; margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), #FF6B8A 45%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 17.5px; color: var(--text-muted); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--text-dim); }

/* ============ Khu vực tải bản cài ============ */
.download-zone { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.download-loading, .download-empty {
  font-size: 14px; color: var(--text-dim); padding: 18px 0;
}

/* Thẻ tải: cả khối là link.
   flex-basis cố định cho hai thẻ rộng bằng nhau và nằm cạnh nhau — để chúng tự
   co theo nội dung thì thẻ có nhãn "Máy của bạn" sẽ dài hơn, đẩy tổng chiều
   ngang vượt container và rơi xuống hai dòng. */
.dl-card {
  display: flex; align-items: center; gap: 13px; text-align: left;
  flex: 0 1 300px; padding: 15px 20px;
  background: var(--card); border: 1px solid var(--border-bright);
  border-radius: var(--radius); transition: border-color .18s, background .18s, transform .18s;
}
.dl-card:hover {
  background: var(--card-hover); border-color: var(--brand);
  transform: translateY(-2px);
}
.dl-card .dl-logo { width: 27px; flex-shrink: 0; color: var(--text); }
.dl-card .dl-logo svg { width: 100%; height: auto; display: block; }
.dl-card .dl-text { min-width: 0; }
.dl-card .dl-os { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.3px; }
.dl-card .dl-meta { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Nền tảng khớp với máy khách đang dùng — nổi bật lên để khỏi phải đắn đo */
.dl-card.recommended {
  background: linear-gradient(135deg, rgba(230, 0, 35, 0.16), var(--card) 62%);
  border-color: var(--brand);
}
.dl-card.recommended .dl-badge {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: var(--brand); color: #fff; vertical-align: middle;
}

/* Bản portable / kiến trúc khác — vẫn tải được nhưng không tranh sự chú ý */
.dl-alt {
  display: flex; gap: 8px 18px; justify-content: center; flex-wrap: wrap;
  width: 100%; margin-top: 4px; font-size: 12.5px;
}
.dl-alt a { color: var(--text-dim); border-bottom: 1px dashed var(--border-bright); }
.dl-alt a:hover { color: var(--text); border-bottom-color: var(--text); }

/* ============ Mục AI ============ */
.ai-section { position: relative; overflow: hidden; }
.ai-section::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 820px; height: 420px; pointer-events: none;
  background: radial-gradient(ellipse, var(--accent-soft), transparent 70%);
}
.ai-section .container { position: relative; }
.ai-section .eyebrow {
  background: var(--accent-soft); color: #A48CF0;
  border-color: rgba(110, 86, 207, 0.32);
}
.ai-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 18px;
}
.ai-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 22px;
  transition: border-color .18s, transform .18s;
}
.ai-card:hover { border-color: rgba(110, 86, 207, 0.5); transform: translateY(-2px); }
.ai-card h3 { font-size: 16px; font-weight: 700; margin: 12px 0 7px; letter-spacing: -0.3px; }
.ai-card p { font-size: 14px; color: var(--text-muted); }
.ai-note {
  margin-top: 26px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid rgba(110, 86, 207, 0.3);
  font-size: 14px; color: var(--text-muted); text-align: center;
}
.ai-note strong { color: var(--text); }

/* ============ Ảnh minh hoạ ============ */
.shots-section { background: var(--bg-soft); border-block: 1px solid var(--border); }
.shot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.shot {
  display: block; width: 100%; padding: 0; cursor: zoom-in; text-align: left;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s, transform .18s;
  /* <button> không kế thừa font và màu chữ của trang: mặc định là màu đen,
     đặt trên nền tối thành chữ vô hình. */
  color: inherit; font: inherit;
}
.shot:hover { border-color: var(--brand); transform: translateY(-3px); }

/* display:block là BẮT BUỘC — đây là thẻ <span>, để inline thì aspect-ratio
   bị bỏ qua hoàn toàn và ảnh giữ nguyên chiều cao gốc, lưới răng cưa vì bốn
   ảnh cao khác nhau (618–832px). */
.shot-thumb {
  display: block; position: relative;
  aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg);
}
.shot-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
}
/* Biểu tượng kính lúp báo cho biết bấm được */
.shot-thumb::after {
  content: '⤢'; position: absolute; right: 10px; bottom: 10px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; font-size: 14px;
  background: rgba(11, 13, 18, 0.78); color: var(--text);
  border: 1px solid var(--border-bright);
  opacity: 0; transition: opacity .18s;
}
.shot:hover .shot-thumb::after, .shot:focus-visible .shot-thumb::after { opacity: 1; }
.shot-cap { display: block; padding: 13px 16px 15px; font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.shot-cap b { display: block; color: var(--text); font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }

/* ============ Khung xem ảnh lớn ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 56px 62px;
  background: rgba(6, 8, 12, 0.93); backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }

.lb-figure { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.lb-figure img {
  max-width: 100%; max-height: calc(100vh - 150px);
  width: auto; margin: 0 auto; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border-bright);
  background: var(--bg);
}
.lb-figure figcaption {
  text-align: center; font-size: 14px; color: var(--text-muted);
  display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.lb-count { font-size: 12.5px; color: var(--text-dim); }

.lb-close, .lb-nav {
  position: absolute; z-index: 1; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border-bright); border-radius: 50%;
  transition: background .15s, border-color .15s;
}
.lb-close:hover, .lb-nav:hover { background: var(--card-hover); border-color: var(--brand); }
.lb-close { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 26px; padding-bottom: 3px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 30px; padding-bottom: 4px; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

@media (max-width: 640px) {
  .lightbox { padding: 60px 12px 20px; }
  /* Nút chuyển ảnh xuống dưới cho khỏi che mất ảnh trên màn hình hẹp */
  .lb-nav { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: 22%; }
  .lb-next { right: 22%; }
  .lb-figure img { max-height: calc(100vh - 210px); }
}

/* ============ Dải số liệu ============ */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-top: 60px;
}
.stat-box { background: var(--bg-soft); padding: 24px 18px; text-align: center; }
.stat-box .num { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; }
.stat-box .label { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }

/* ============ Section ============ */
.section { padding: 82px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 48px; }
.section-head h2 {
  font-size: clamp(25px, 3.6vw, 35px); font-weight: 800;
  letter-spacing: -0.9px; margin-bottom: 13px;
}
.section-head p { color: var(--text-muted); font-size: 16px; }

/* ============ Tính năng ============ */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; transition: border-color .18s, transform .18s;
}
.feature-card:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  margin-bottom: 16px; font-size: 20px; background: var(--accent-soft);
}
.feature-card h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.feature-card p { color: var(--text-muted); font-size: 14.2px; }
.feature-card.highlight { border-color: rgba(230, 0, 35, 0.35); background: linear-gradient(160deg, rgba(230,0,35,0.07), var(--card) 55%); }
.feature-card.highlight .feature-icon { background: var(--brand-soft); }

/* ============ Các bước ============ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 26px 24px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px;
  border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; font-size: 15px;
}
.step h3 { font-size: 16px; margin-bottom: 7px; font-weight: 700; }
.step p { color: var(--text-muted); font-size: 14.2px; }

/* ============ Bảng giá ============ */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: start; }
.plan {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; position: relative; display: flex; flex-direction: column;
  transition: border-color .18s, transform .18s;
}
.plan:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 13px; border-radius: 999px; white-space: nowrap;
}
.plan h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.plan .plan-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }
.plan .price-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.plan .price { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.plan .price-old { font-size: 15px; color: var(--text-dim); text-decoration: line-through; }
.plan .price-unit { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.plan ul { list-style: none; margin-bottom: 24px; flex: 1; }
.plan li {
  font-size: 14px; color: var(--text-muted); padding: 7px 0 7px 25px;
  position: relative;
}
.plan li::before {
  content: '✓'; position: absolute; left: 0; top: 7px;
  color: var(--ok); font-weight: 800; font-size: 13px;
}

/* ============ FAQ ============ */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 11px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600; padding: 18px 22px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-q span.mark { color: var(--text-dim); font-size: 19px; transition: transform .2s; flex-shrink: 0; }
.faq-item.open .faq-q span.mark { transform: rotate(45deg); }
.faq-a { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.faq-item.open .faq-a { padding: 0 22px 19px; max-height: 420px; }
.faq-a p { color: var(--text-muted); font-size: 14.3px; }

/* ============ Form ============ */
.form-group { margin-bottom: 17px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-muted); }
.form-input, .form-select, textarea.form-input {
  width: 100%; padding: 11px 14px; background: var(--bg-soft);
  border: 1px solid var(--border-bright); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14.5px; font-family: inherit; transition: border-color .15s;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; min-height: 76px; }

/* ============ Thẻ chung ============ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.3px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-info { background: var(--accent-soft); color: #9C86F0; }
.badge-gray { background: rgba(255,255,255,.06); color: var(--text-dim); }

.alert {
  padding: 13px 17px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 18px; border: 1px solid transparent;
}
.alert-warn { background: var(--warn-soft); border-color: rgba(232,163,61,.3); color: #F0C078; }
.alert-err { background: var(--err-soft); border-color: rgba(229,72,77,.3); color: #F08C8F; }
.alert-ok { background: var(--ok-soft); border-color: rgba(47,191,113,.3); color: #74D6A0; }
.alert-info { background: var(--accent-soft); border-color: rgba(110,86,207,.3); color: #A794F2; }

/* ============ Khối hiển thị key ============ */
.key-display {
  background: linear-gradient(150deg, rgba(47,191,113,.1), var(--bg-soft));
  border: 1px dashed var(--ok); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; margin: 22px 0;
}
.key-value {
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(17px, 3.6vw, 25px); font-weight: 700; letter-spacing: 2px;
  color: var(--ok); word-break: break-all; margin: 11px 0 17px;
}

/* ============ Bảng ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
th {
  text-align: left; padding: 12px 15px; background: var(--bg-soft);
  color: var(--text-dim); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--card-hover); }
.mono { font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inner p { color: var(--text-dim); font-size: 13.5px; }

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

.spinner {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .feature-grid, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .feature-grid, .pricing-grid, .steps, .ai-grid, .shot-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 56px 0; }
  /* Thẻ tải chiếm trọn chiều ngang để ngón tay bấm không trượt */
  .download-zone { flex-direction: column; }
  .dl-card { min-width: 0; width: 100%; }
}
