/* ==============================================================================
   BPV-XR (BIM Pro VN XR Platform) — Design System & Global Styles
   Thẩm mỹ: Kiến trúc BIM Kỹ thuật số + Spatial Computing Dark Glassmorphism
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  --bpv-brand: #06b6d4;
  --bpv-brand-dark: #0891b2;
  --bpv-brand-rgb: 6, 182, 212;
  --bpv-accent: #3b82f6;
  --bpv-emerald: #10b981;
  --bpv-amber: #f59e0b;
  --bpv-danger: #ef4444;

  --bg-body: #060a13;
  --bg-surface: #0d1424;
  --bg-elevated: #121c32;
  --bg-glass: rgba(13, 20, 36, 0.78);
  --bg-glass-strong: rgba(9, 14, 26, 0.92);

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-brand: rgba(var(--bpv-brand-rgb), 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 28px rgba(var(--bpv-brand-rgb), 0.22);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(var(--bpv-brand-rgb), 0.12), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.1), transparent 42%),
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==============================================================================
   NAVBAR & BRAND IDENTITY
   ============================================================================== */
.bpv-navbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(6, 10, 19, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.bpv-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.bpv-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.bpv-brand-logo-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--bpv-brand-rgb), 0.2), rgba(59, 130, 246, 0.22));
  border: 1px solid var(--border-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.bpv-brand-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bpv-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.bpv-brand-name {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.bpv-brand-name span {
  color: var(--bpv-brand);
}

.bpv-brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.bpv-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.bpv-nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.18s ease;
}

.bpv-nav-links a:hover,
.bpv-nav-links a.active {
  color: var(--bpv-brand);
}

.bpv-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==============================================================================
   LANGUAGE SWITCHER WITH COUNTRY FLAGS + KEYBOARD SHORTCUT (TOP-RIGHT)
   ============================================================================== */
.bpv-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.bpv-lang-floating-corner {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 95;
}

.bpv-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 20, 36, 0.9);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.bpv-lang-trigger:hover {
  border-color: var(--bpv-brand);
  box-shadow: 0 0 14px rgba(var(--bpv-brand-rgb), 0.25);
}

.bpv-flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.bpv-lang-kbd {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 5px;
  padding: 1px 5px;
}

.bpv-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 196px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(9, 14, 26, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-brand);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 250;
}

.bpv-lang-menu.open {
  display: flex;
}

.bpv-lang-menu-hdr {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bpv-lang-menu-hdr kbd {
  font-size: 0.66rem;
  background: rgba(56, 189, 248, 0.14);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.bpv-lang-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.bpv-lang-opt:hover {
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
}

.bpv-lang-opt.active {
  background: rgba(var(--bpv-brand-rgb), 0.18);
  color: #67e8f9;
  font-weight: 700;
}

@media (max-width: 640px) {
  .bpv-lang-kbd { display: none; }
}

/* Demo Mode Pill */
.demo-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.74rem;
  font-weight: 600;
}

.demo-mode-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* ==============================================================================
   BUTTONS
   ============================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--bpv-brand), var(--bpv-accent));
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(var(--bpv-brand-rgb), 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(var(--bpv-brand-rgb), 0.38);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.85);
  border-color: var(--bpv-brand);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--bpv-brand);
  color: var(--bpv-brand);
  background: rgba(var(--bpv-brand-rgb), 0.08);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
}

/* ==============================================================================
   CARDS, BADGES, FORMS
   ============================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-brand {
  background: rgba(var(--bpv-brand-rgb), 0.16);
  color: #67e8f9;
  border: 1px solid rgba(var(--bpv-brand-rgb), 0.32);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-slate {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(6, 10, 19, 0.8);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--bpv-brand);
  box-shadow: 0 0 0 3px rgba(var(--bpv-brand-rgb), 0.18);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bpv-brand), var(--bpv-emerald));
  transition: width 0.35s ease;
}

/* ==============================================================================
   LANDING PAGE SECTIONS
   ============================================================================== */
.hero-section {
  padding: 54px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 38px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4vw, 3.3rem);
  font-weight: 700;
  line-height: 1.13;
  margin: 14px 0 18px;
  letter-spacing: -0.02em;
}

.hero-title .gradient-text {
  background: linear-gradient(120deg, #67e8f9 0%, #3b82f6 52%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.04rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
  max-width: 580px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.device-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-viewer-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-brand);
  background: radial-gradient(circle at 50% 35%, #16243d 0%, #090e1a 82%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), var(--shadow-glow);
}

.hero-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(6, 10, 19, 0.72);
}

.hero-model-viewer {
  width: 100%;
  height: 410px;
  background: transparent;
  --poster-color: transparent;
}

.hero-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 10, 19, 0.8);
}

/* Section generic */
.section {
  padding: 68px 0;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  margin: 10px 0 12px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* Pricing cards */
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-brand);
}

.pricing-card.featured {
  background: linear-gradient(180deg, rgba(var(--bpv-brand-rgb), 0.12) 0%, var(--bg-surface) 45%);
  border: 1.5px solid var(--bpv-brand);
  box-shadow: var(--shadow-glow);
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 700;
  margin: 12px 0 4px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--bpv-emerald);
  font-weight: 800;
  flex-shrink: 0;
}

/* ==============================================================================
   MODALS & TOASTS
   ============================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 15, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
}

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-brand);
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}

.toast.success { border-color: rgba(16, 185, 129, 0.6); }
.toast.error { border-color: rgba(239, 68, 68, 0.7); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   FOOTER
   ============================================================================== */
.bpv-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 10, 19, 0.9);
  padding: 44px 0 32px;
  margin-top: 40px;
}

.bpv-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.bpv-footer h4 {
  font-size: 0.9rem;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.bpv-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bpv-footer ul a:hover {
  color: var(--bpv-brand);
}

.bpv-footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==============================================================================
   RESPONSIVE
   ============================================================================== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bpv-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bpv-nav-links { display: none; }
  .grid-3, .grid-4, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .bpv-footer-grid { grid-template-columns: 1fr; }
  .hero-model-viewer { height: 320px; }
}
