/* ==========================================================
   Album Phú Quốc Media — giao diện khách
   Tông màu: xanh biển Phú Quốc + vàng cát
   ========================================================== */
:root {
  --ocean-950: #041c2c;
  --ocean-900: #06283d;
  --ocean-800: #0a3a57;
  --ocean-700: #0b4f6c;
  --ocean-600: #126a8f;
  --ocean-500: #1a85b0;
  --sea-400: #3cc4cf;
  --sea-300: #7fdce2;
  --sand-600: #c98f2a;
  --sand-500: #e2b04a;
  --sand-400: #eac46e;
  --sand-300: #f2d898;
  --sand-100: #fbf3e2;
  --coral: #f0745a;
  --heart: #ff4d6d;

  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #efe9de;
  --line: #e4dccd;
  --text: #0f2533;
  --text-2: #4a5d69;
  --text-3: #7b8b95;
  --accent: var(--ocean-700);
  --on-accent: #fff;

  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 12px 32px -12px rgba(6, 40, 61, 0.28);
  --shadow-lg: 0 24px 60px -20px rgba(6, 40, 61, 0.45);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061923;
    --surface: #0c2330;
    --surface-2: #123040;
    --line: #1d3e50;
    --text: #e9f1f4;
    --text-2: #a8bcc6;
    --text-3: #7c939f;
    --accent: var(--sea-400);
    --on-accent: var(--ocean-950);
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 16px; border: 0;
  font-weight: 600; font-size: 17px; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-sand {
  background: linear-gradient(135deg, var(--sand-300), var(--sand-500));
  color: var(--ocean-900);
  box-shadow: 0 10px 24px -10px rgba(226, 176, 74, .9), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-ocean { background: var(--ocean-700); color: #fff; box-shadow: 0 10px 24px -12px rgba(11,79,108,.8); }
.btn-glass {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-block { width: 100%; }
.btn-lg { min-height: 60px; font-size: 18px; border-radius: 18px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: inline-grid; place-items: center; background: transparent;
  transition: background .2s, transform .15s;
}
.icon-btn:active { transform: scale(.9); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: auto; height: 34px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.logo-full { display: block; width: auto; height: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text b { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.logo-text span { font-size: 10.5px; letter-spacing: .38em; font-weight: 600; opacity: .85; }
.lang-btn {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(10px);
}

/* ==========================================================
   Màn hình chào mừng
   ========================================================== */
.welcome {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; color: #fff;
  display: flex; flex-direction: column;
  background: linear-gradient(175deg, #041c2c 0%, #0a3a57 30%, #126a8f 58%, #3cc4cf 86%, #f2d898 100%);
}
.welcome::before { /* bầu trời chuyển màu chậm */
  content: ''; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 30% at 80% 18%, rgba(242,216,152,.55), transparent 70%),
    radial-gradient(50% 40% at 10% 40%, rgba(60,196,207,.35), transparent 70%);
  animation: skyShift 18s ease-in-out infinite alternate;
}
.sun { /* mặt trời lặn trên biển, nằm dưới phần chữ */
  position: absolute; right: 12%; bottom: 15vh; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6da, #f6d27a 45%, #e2a23b 75%);
  box-shadow: 0 0 80px 30px rgba(246,210,122,.45);
  animation: sunFloat 8s ease-in-out infinite;
}
.sparkles span {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  opacity: 0; animation: twinkle 4s ease-in-out infinite;
}
.waves { position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; min-height: 180px; pointer-events: none; }
.waves svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.waves .w1 { animation: waveMove 16s linear infinite; opacity: .45; }
.waves .w2 { animation: waveMove 11s linear infinite reverse; opacity: .6; bottom: -10px; }
.waves .w3 { animation: waveMove 8s linear infinite; bottom: -20px; }

.welcome-top {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + var(--safe-t)) 18px 0;
}
.welcome-main {
  position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 24px 18px 34vh; max-width: 520px; width: 100%; margin: 0 auto;
}
.welcome h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.12; margin: 6px 0 10px; font-weight: 800; letter-spacing: -.02em; }
.welcome .hi { font-size: 18px; font-weight: 600; color: var(--sand-300); display: flex; align-items: center; gap: 8px; }
.welcome .lead { font-size: 18px; opacity: .9; margin: 0 0 24px; }
.glass-card {
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg);
}
.code-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; opacity: .95; }
.code-input {
  width: 100%; height: 76px; border: 0; border-radius: 18px; background: #fff; color: var(--ocean-900);
  text-align: center; font-size: 34px; font-weight: 800; letter-spacing: .38em; text-indent: .38em;
  text-transform: uppercase; outline: none; box-shadow: inset 0 0 0 3px transparent; transition: box-shadow .2s;
}
.code-input::placeholder { color: #b9c4ca; font-weight: 600; font-size: 22px; letter-spacing: .08em; text-indent: 0; }
.code-input:focus { box-shadow: inset 0 0 0 3px var(--sand-400); }
.code-hint { font-size: 14px; opacity: .85; margin: 10px 2px 16px; }
.err { color: #ffd2c7; font-weight: 600; font-size: 15px; margin: 10px 2px 0; min-height: 1px; }
.shake { animation: shake .45s; }
.recent { margin-top: 20px; }
.recent h3 { font-size: 14px; font-weight: 600; opacity: .85; margin: 0 0 10px; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list button {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff;
  border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px; backdrop-filter: blur(8px);
}
.recent-list small { opacity: .75; font-weight: 500; margin-left: 6px; }
.welcome-foot {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(14px + var(--safe-b));
  text-align: center; font-size: 14px; color: var(--ocean-900); font-weight: 600;
}
.welcome-foot a { text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Trang chủ: trời sáng 3/4 trên, biển 1/4 dưới ---------- */
body.is-home { background: #f7f3ec; }
.home-page { /* luôn tông sáng, kể cả khi điện thoại để chế độ tối */
  --bg: #f7f3ec; --surface: #fff; --surface-2: #efe9de; --line: #e4dccd;
  --text: #0f2533; --text-2: #4a5d69; --text-3: #7b8b95; --accent: var(--ocean-700);
  background: var(--bg); color: var(--text); color-scheme: light;
}
.home {
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px calc(10px + var(--safe-b));
}
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, #eef9fc 0%, #d6f0f8 36%, #b2e3f0 60%, #93d7e9 76%); }
.home-sun {
  position: absolute; left: 7%; top: calc(16px + var(--safe-t)); width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fffaf0, #ffe39a 55%, #f6c35a);
  box-shadow: 0 0 50px 22px rgba(255,214,120,.45); animation: sunFloat 8s ease-in-out infinite;
}
.cloud {
  position: absolute; left: -30%; height: 22px; border-radius: 999px; background: #fff; opacity: .9;
  box-shadow: 22px -10px 0 2px #fff, 46px -2px 0 -2px #fff;
  animation: drift 46s linear infinite;
}
.cloud.c1 { width: 64px; top: 17%; animation-delay: -6s; }
.cloud.c2 { width: 48px; top: 31%; animation-duration: 60s; animation-delay: -34s; opacity: .7; }
.cloud.c3 { width: 80px; top: 9%; animation-duration: 74s; animation-delay: -52s; opacity: .8; }
.sea {
  position: absolute; left: 0; right: 0; bottom: 0; height: 25%;
  background: linear-gradient(180deg, #2a9cc4 0%, #1a85b0 30%, #0b4f6c 100%);
}
.sea-waves { position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); height: 30px; overflow: hidden; }
.sea-waves svg { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; }
.sea-waves .w1 { bottom: 7px; animation: waveMove 14s linear infinite; }
.sea-waves .w2 { bottom: 3px; animation: waveMove 10s linear infinite reverse; }
.sea-waves .w3 { animation: waveMove 7s linear infinite; }
.home-top {
  position: relative; z-index: 2; width: 100%; max-width: 520px; display: flex; justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 0 0;
}
.home .lang-btn { color: var(--ocean-900); border-color: rgba(6,40,61,.16); background: rgba(255,255,255,.7); }
.home-intro { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 520px; }
.home-logo { height: clamp(70px, 12vh, 112px); width: auto; margin: clamp(2px, 1vh, 12px) 0 clamp(12px, 2.4vh, 24px); }
.home-intro h1 {
  margin: 0 0 6px; font-size: clamp(24px, 6.8vw, 36px); line-height: 1.15; font-weight: 800;
  letter-spacing: -.02em; color: var(--ocean-900); text-wrap: balance;
}
.home-intro .lead { margin: 0; font-size: clamp(12px, 3.7vw, 16px); color: #33505f; white-space: nowrap; }
.home .code-card {
  position: relative; z-index: 2; width: 100%; max-width: 440px; margin-top: clamp(14px, 2.8vh, 28px);
  padding: 18px; border-radius: 24px; border-color: rgba(6,40,61,.06);
  box-shadow: 0 22px 50px -20px rgba(6,40,61,.5);
}
.home .code-card-head { margin-bottom: 14px; }
.home .code-card-ic { width: 44px; height: 44px; border-radius: 14px; }
.home .code-card h2 { font-size: 19px; }
.home .code-card-head p { font-size: 14px; }
.home .code-input { height: 64px; font-size: 30px; }
.home .recent { margin-top: 14px; padding-top: 12px; }
.home .recent h3 { margin-bottom: 8px; font-size: 13px; }
.home .recent-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.home .recent-list::-webkit-scrollbar { display: none; }
.home .recent-list button { flex: none; }
@media (max-height: 720px) { /* điện thoại màn thấp (iPhone SE…): bỏ dòng phụ trùng với khung nhập mã */
  .home-intro .lead { display: none; }
  .home-logo { height: 64px; }
  .home .code-input { height: 58px; }
  .home .forgot { margin-top: 4px; padding: 6px 4px; }
  .home .recent { margin-top: 8px; padding-top: 8px; }
}
.home .scroll-hint {
  position: relative; z-index: 2; margin: auto auto 4px; padding: 10px 20px; color: #fff; font-size: 16px;
  border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,40,70,.18);
}
.home .scroll-hint:hover { background: rgba(255,255,255,.26); }

/* ---------- Khung nhập mã ---------- */
.code-card {
  max-width: 480px; margin: 0 auto; padding: 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.code-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.code-card-ic {
  width: 50px; height: 50px; border-radius: 16px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sand-300), var(--sand-500)); color: var(--ocean-900);
}
.code-card-ic .ic { width: 26px; height: 26px; }
.code-card h2 { margin: 2px 0 0; font-size: 21px; line-height: 1.25; }
.code-card-head p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.code-card .code-input { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.code-card .code-input:focus { box-shadow: inset 0 0 0 3px var(--sea-400); }
.code-card .err { color: var(--coral); margin: 8px 2px; }
.code-card .err:empty { margin: 6px 0; }
.code-card .recent { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-card .recent h3 { color: var(--text-2); opacity: 1; }
.code-card .recent-list button { border-color: var(--line); background: var(--surface-2); color: var(--text); backdrop-filter: none; }
.scroll-hint {
  display: flex; align-items: center; gap: 6px; margin: 22px auto 0; padding: 8px 14px;
  border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: 15px;
}
.scroll-hint .ic { animation: nudge 1.8s ease-in-out infinite; }
.scroll-hint[aria-expanded="true"] .ic { animation: none; transform: rotate(180deg); }

/* ---------- Giới thiệu công ty ---------- */
.about { padding: 34px 0 calc(40px + var(--safe-b)); }
.about-in { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.about-title { font-size: clamp(26px, 6.4vw, 40px); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -.02em; text-wrap: balance; }
.about-text { color: var(--text-2); font-size: 17px; max-width: 720px; margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0 0; }
@media (min-width: 700px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-row div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat-row b { display: block; font-size: 30px; line-height: 1.1; font-weight: 800; color: var(--accent); }
.stat-row span { color: var(--text-2); font-size: 14px; }
.about-h3 { font-size: 21px; margin: 38px 0 14px; }
.about-h3.center { text-align: center; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.svc-ic {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--sea-400), var(--ocean-600));
}
.svc-ic .ic { width: 24px; height: 24px; }
.svc b { display: block; margin: 14px 0 4px; font-size: 17px; line-height: 1.3; }
.svc p { margin: 0; color: var(--text-2); font-size: 15px; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 700px) { .why { grid-template-columns: 1fr 1fr; } }
.why li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--surface-2); }
.why .ic { width: 26px; height: 26px; color: var(--sand-600); margin-top: 2px; }
.why b { display: block; }
.why span { color: var(--text-2); font-size: 15px; }
.marquee {
  overflow: hidden; padding: 4px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee > div { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { padding: 0 20px; font-weight: 800; font-size: 15px; letter-spacing: .08em; color: var(--text-3); white-space: nowrap; }
.cta {
  margin-top: 34px; padding: 28px 22px; border-radius: var(--radius-lg); text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--ocean-900), var(--ocean-600)); box-shadow: var(--shadow);
}
.cta h3 { margin: 0 0 6px; font-size: 23px; }
.cta p { margin: 0 0 18px; opacity: .85; }
.cta-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.about .co-info { margin-top: 24px; }
.about .legal { text-align: center; color: var(--text-3); }

.reveal > * { opacity: 0; transform: translateY(18px); animation: fadeUp .8s var(--ease) forwards; }
.reveal > *:nth-child(2) { animation-delay: .08s; }
.reveal > *:nth-child(3) { animation-delay: .16s; }
.reveal > *:nth-child(4) { animation-delay: .24s; }
.reveal > *:nth-child(5) { animation-delay: .32s; }

/* ---------- Màn hình chờ ---------- */
.loader-screen {
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center;
  background: linear-gradient(175deg, #041c2c, #0b4f6c); color: #fff;
}
.spinner {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 16px;
  border: 4px solid rgba(255,255,255,.2); border-top-color: var(--sand-400);
  animation: spin .9s linear infinite;
}

/* ==========================================================
   Album
   ========================================================== */
.hero {
  position: relative; min-height: 74vh; min-height: 74svh; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; background: var(--ocean-900);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-bg img.loaded { opacity: 1; animation: heroZoom 24s ease-out forwards; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4,28,44,.55) 0%, rgba(4,28,44,0) 28%, rgba(4,28,44,.15) 50%, rgba(4,28,44,.92) 100%);
}
.hero-top, .hero-body { position: relative; z-index: 2; }
.hero-top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 16px 0; }
.hero-top-r { display: flex; gap: 8px; align-items: center; }
.hero-body { padding: 0 18px 26px; max-width: 900px; width: 100%; margin: 0 auto; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pill.warn { background: rgba(240,116,90,.85); border-color: transparent; }
.hero h1 { font-size: clamp(30px, 7.6vw, 54px); line-height: 1.08; margin: 14px 0 8px; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.hero .sub { font-size: 17px; opacity: .92; margin: 0 0 6px; }
.hero .welcome-msg { font-size: 16px; opacity: .88; margin: 10px 0 0; max-width: 640px; white-space: pre-line; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.hero-actions .btn-sand { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .hero-actions { display: flex; flex-wrap: wrap; }
  .hero-actions .btn-sand { grid-column: auto; }
}

.banner {
  display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 14px 16px;
  border-radius: var(--radius); background: var(--sand-100); color: #6a4a0c; font-size: 15px; font-weight: 500;
}
.banner.info { background: color-mix(in srgb, var(--sea-400) 18%, var(--surface)); color: var(--text); }
.banner .ic { width: 22px; height: 22px; }
.banner .grow { flex: 1; }
.banner .btn { min-height: 40px; }
.banner.drive { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.banner.drive .grow { min-width: 0; }
.banner.drive small { display: block; color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner.stack { flex-wrap: wrap; }
.banner.stack .grow { flex: 1 1 60%; }
.banner.stack .btn { flex: 1 1 auto; }
@media (max-width: 599px) { .banner.stack .grow { flex-basis: 100%; } }
@media (prefers-color-scheme: dark) { .banner { background: #3a2f17; color: var(--sand-300); } }

/* Thanh tab nhóm ảnh */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: var(--safe-t);
}
.toolbar-in { display: flex; align-items: center; gap: 8px; max-width: 1400px; margin: 0 auto; padding: 10px 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; scroll-snap-type: x proximity; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, color .2s, border-color .2s; scroll-snap-align: start;
}
.chip small { color: var(--text-3); font-weight: 500; }
.chip.on { background: var(--ocean-700); border-color: var(--ocean-700); color: #fff; }
.chip.on small { color: rgba(255,255,255,.75); }
.chip .ic { width: 18px; height: 18px; }
.chip.fav .ic { color: var(--heart); }
.chip.fav.on .ic { color: #fff; }
.toolbar .select-toggle { flex: none; }

/* Lưới ảnh */
.gallery { max-width: 1400px; margin: 0 auto; padding: 4px 0 16px; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 22px 14px 10px; font-weight: 700; font-size: 19px;
}
.sec-head small { color: var(--text-3); font-weight: 500; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 8px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 0 14px; } }
.tile {
  position: relative; aspect-ratio: 1; overflow: hidden; border: 0; padding: 0; background: var(--surface-2);
  content-visibility: auto; contain-intrinsic-size: 160px;
}
@media (min-width: 600px) { .tile { border-radius: 10px; } }
.tile img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06);
  transition: opacity .5s ease, transform .6s var(--ease), border-radius .2s;
}
.tile img.loaded { opacity: 1; transform: scale(1); }
@media (hover: hover) { .tile:hover img.loaded { transform: scale(1.04); } }
.tile .fav-dot {
  position: absolute; right: 6px; bottom: 6px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  display: none;
}
.tile .fav-dot .ic { width: 20px; height: 20px; fill: var(--heart); stroke: var(--heart); }
.tile.is-fav .fav-dot { display: block; }
.tile .check {
  position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid #fff; background: rgba(0,0,0,.18); display: none; place-items: center; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.tile .check .ic { width: 18px; height: 18px; opacity: 0; stroke-width: 3; }
.selecting .tile .check { display: grid; }
.tile.sel .check { background: var(--sea-400); border-color: var(--sea-400); }
.tile.sel .check .ic { opacity: 1; }
.tile.sel img { transform: scale(.86) !important; border-radius: 12px; }
.tile.sel { background: color-mix(in srgb, var(--sea-400) 25%, var(--surface-2)); }

.empty { text-align: center; color: var(--text-2); padding: 60px 24px; }
.empty .ic { width: 48px; height: 48px; color: var(--text-3); margin: 0 auto 12px; display: block; }

/* Chân trang */
.footer { text-align: center; color: var(--text-3); font-size: 14px; padding: 26px 20px calc(96px + var(--safe-b)); }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 4px 8px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.footer .row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.foot-logo-link { display: inline-block; margin: 14px 0 8px; }
.foot-logo { height: 96px; margin: 0 auto; }
.footer .slogan { color: var(--text); font-weight: 700; font-size: 16px; margin: 4px 0 2px; }
.footer .since { margin: 0 0 6px; font-size: 13px; }
.promo {
  max-width: 560px; margin: 22px auto 0; padding: 16px 18px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 14px; text-align: left; color: #fff;
  background: linear-gradient(120deg, var(--ocean-800), var(--ocean-600));
}
.promo > div { flex: 1; }
.promo b { display: block; font-size: 16px; }
.promo span { display: block; font-size: 13.5px; opacity: .85; margin-top: 2px; }
@media (max-width: 480px) { .promo { flex-direction: column; align-items: stretch; text-align: center; } }
.co-info { list-style: none; padding: 0; margin: 20px auto 6px; max-width: 520px; display: grid; gap: 8px; text-align: left; color: var(--text-2); }
.co-info li { display: flex; gap: 10px; align-items: flex-start; }
.co-info .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--text-3); }
.co-info a { color: var(--text); font-weight: 600; text-decoration: none; }
.legal { font-size: 12px; margin: 16px 0 0; }
.welcome-logo { height: 92px; width: auto; align-self: flex-start; margin: 0 0 18px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
@media (max-height: 700px) { .welcome-logo { height: 70px; margin-bottom: 10px; } }

/* Thanh chọn ảnh */
.selbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 40;
  max-width: 720px; margin: 0 auto; padding: 10px 10px 10px 18px; border-radius: 22px;
  background: var(--ocean-900); color: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  transform: translateY(140%); transition: transform .35s var(--ease);
}
.selbar.show { transform: none; }
.selbar .count { flex: 1; font-weight: 700; }
.selbar .btn { min-height: 46px; }

/* Nút liên hệ nổi */
.fab-wrap { position: fixed; right: 16px; bottom: calc(18px + var(--safe-b)); z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; transition: opacity .25s, transform .25s; }
.fab-wrap.hide { opacity: 0; transform: translateY(20px); pointer-events: none; }
.fab {
  width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sea-400), var(--ocean-600)); color: #fff; box-shadow: var(--shadow-lg);
  animation: ring 3.5s ease-in-out infinite;
}
.fab .ic { width: 26px; height: 26px; }
.fab-menu { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab-menu a {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; text-decoration: none;
  background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px) scale(.95); pointer-events: none; transition: all .25s var(--ease);
}
.fab-menu a .badge { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.fab-wrap.open .fab-menu a { opacity: 1; transform: none; pointer-events: auto; }
.fab-wrap.open .fab-menu a:nth-child(1) { transition-delay: .05s; }

/* ==========================================================
   Bảng trượt (sheet) / hộp thoại
   ========================================================== */
.sheet-bg {
  position: fixed; inset: 0; z-index: 200; background: rgba(4,20,30,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .25s;
}
.sheet-bg.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface);
  border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + var(--safe-b)); box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .38s var(--ease);
}
.sheet-bg.show .sheet { transform: none; }
.sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
@media (min-width: 640px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 28px; transform: translateY(30px) scale(.97); padding-bottom: 24px; }
  .sheet::before { display: none; }
}
.sheet h2 { font-size: 22px; margin: 4px 0 6px; line-height: 1.25; }
.sheet p.muted { color: var(--text-2); margin: 0 0 16px; font-size: 16px; }
.sheet .actions { display: grid; gap: 10px; margin-top: 18px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-head .grow { flex: 1; }
.sheet-head .icon-btn { margin: -6px -10px 0 0; background: var(--surface-2); width: 42px; height: 42px; }

.qcard {
  width: 100%; text-align: left; display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  border-radius: 18px; border: 2px solid var(--line); background: var(--surface); margin-bottom: 10px;
  transition: border-color .2s, background .2s, transform .15s;
}
.qcard:active { transform: scale(.98); }
.qcard:hover { border-color: var(--sea-400); }
.qcard .qi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.qcard .qi .ic { width: 24px; height: 24px; }
.qcard.light .qi { background: color-mix(in srgb, var(--sea-400) 20%, transparent); color: var(--ocean-600); }
.qcard.orig .qi { background: color-mix(in srgb, var(--sand-500) 25%, transparent); color: var(--sand-600); }
.qcard b { display: block; font-size: 18px; }
.qcard .d { display: block; color: var(--text-2); font-size: 15px; margin-top: 2px; }
.qcard .s { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.qcard .rec { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; color: #fff; background: var(--ocean-600); padding: 3px 9px; border-radius: 999px; vertical-align: middle; }

.progress { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 14px 0 8px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sea-400), var(--ocean-500)); transition: width .3s var(--ease); }
.status { color: var(--text-2); font-size: 15px; min-height: 22px; }
.done-icon {
  width: 76px; height: 76px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sea-300), var(--sea-400)); color: var(--ocean-900);
  animation: pop .5s var(--ease);
}
.done-icon .ic { width: 38px; height: 38px; stroke-width: 3; }
.center { text-align: center; }

/* Minh họa bước "Lưu hình ảnh" của iPhone */
.ios-hint {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); font-size: 15px; color: var(--text-2);
}
.ios-hint .fake-row {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; background: var(--surface);
  color: var(--text); font-weight: 600; box-shadow: 0 0 0 2px var(--sea-400); animation: pulseRing 1.8s ease-in-out infinite;
}

/* Biểu mẫu */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 17px; outline: none; transition: border-color .2s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sea-400); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; flex: none; }

.stars { display: flex; justify-content: center; gap: 6px; color: var(--sand-500); margin: 4px 0 10px; }
.stars .ic { width: 36px; height: 36px; fill: currentColor; animation: pop .5s var(--ease) backwards; }
.stars .ic:nth-child(2) { animation-delay: .06s; } .stars .ic:nth-child(3) { animation-delay: .12s; }
.stars .ic:nth-child(4) { animation-delay: .18s; } .stars .ic:nth-child(5) { animation-delay: .24s; }

.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-grid a, .share-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px;
  background: var(--surface-2); border: 0; text-decoration: none; font-weight: 600; font-size: 14px;
}
.share-grid .ic { width: 28px; height: 28px; }

/* ==========================================================
   Xem ảnh toàn màn hình
   ========================================================== */
.lb {
  position: fixed; inset: 0; z-index: 100; background: #000; color: #fff;
  opacity: 0; transition: opacity .25s; touch-action: none; user-select: none; -webkit-user-select: none;
}
.lb.show { opacity: 1; }
.lb-stage { position: absolute; inset: 0; overflow: hidden; }
.lb-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; will-change: transform; }
.lb-slide img {
  max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none;
  transform-origin: center; will-change: transform; -webkit-touch-callout: none;
}
.lb-slide img.hi-pending { filter: blur(6px); }
.tile img { -webkit-touch-callout: none; -webkit-user-drag: none; }
.tile { -webkit-user-select: none; user-select: none; }
.lb-slide .lb-spin { position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .9s linear infinite; opacity: 0; transition: opacity .2s; }
.lb-slide.loading .lb-spin { opacity: 1; }
.lb-top, .lb-bottom {
  position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 10px 10px; transition: opacity .25s, transform .25s;
}
.lb-top { top: 0; padding-top: calc(10px + var(--safe-t)); background: linear-gradient(rgba(0,0,0,.6), transparent); }
.lb-bottom {
  bottom: 0; padding-bottom: calc(14px + var(--safe-b)); justify-content: center;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}
.lb.chrome-off .lb-top { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.lb.chrome-off .lb-bottom { opacity: 0; transform: translateY(20px); pointer-events: none; }
.lb-top .count { flex: 1; text-align: center; font-weight: 600; font-size: 16px; }
.lb .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
.lb .icon-btn .ic { width: 24px; height: 24px; }
.lb .icon-btn.fav-on .ic { fill: var(--heart); stroke: var(--heart); animation: pop .4s var(--ease); }
.lb-bottom .btn { min-height: 54px; }
.lb-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); display: none; }
@media (hover: hover) and (min-width: 800px) { .lb-nav { display: grid; } }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb .lb-nav { width: 56px; height: 56px; }

/* ---------- Trình chiếu ---------- */
.ss { position: fixed; inset: 0; z-index: 150; background: #000; overflow: hidden; cursor: none; }
.ss.ui { cursor: default; }
.ss-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.ss-layer.on { opacity: 1; }
.ss-layer .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.55); }
.ss-layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ss-layer.on img { animation: kenburns 7s ease-out forwards; }
.ss-ctrl {
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 2;
  display: flex; gap: 10px; padding: 8px; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity .3s;
}
.ss.ui .ss-ctrl { opacity: 1; }
.ss-ctrl .icon-btn { color: #fff; background: rgba(255,255,255,.1); width: 54px; height: 54px; }
.ss-bar { position: absolute; left: 0; top: 0; height: 3px; background: var(--sand-400); z-index: 2; }
.ss-caption { position: absolute; left: 20px; top: calc(18px + var(--safe-t)); z-index: 2; color: #fff; opacity: .85; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* ---------- Thông báo nhỏ ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 300; transform: translate(-50%, 20px);
  background: var(--ocean-900); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .3s var(--ease); pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Hiệu ứng ---------- */
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes drift { to { transform: translateX(170vw); } }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes sunFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(14px); } }
@keyframes skyShift { from { transform: translate(0,0) scale(1); } to { transform: translate(-4%, 3%) scale(1.08); } }
@keyframes twinkle { 0%,100% { opacity: 0; transform: scale(.6); } 50% { opacity: .9; transform: scale(1); } }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes ring { 0%,86%,100% { transform: rotate(0); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(12deg); } 96% { transform: rotate(-6deg); } }
@keyframes pulseRing { 0%,100% { box-shadow: 0 0 0 2px var(--sea-400); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sea-400) 35%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Quên mã đoàn ---------- */
.forgot {
  display: block; width: 100%; margin-top: 10px; padding: 8px 4px; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--text-2); cursor: pointer;
}
.forgot b { color: var(--ocean-700); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btn-zalo { background: #0068ff; color: #fff; }

/* ---------- Đang mở trong Zalo / Facebook ---------- */
.inapp-bar {
  display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t, 0px)) 12px 8px 14px;
  background: #fff4d6; color: #5b4300; font-size: 14px; line-height: 1.35; border-bottom: 1px solid #f0dca0;
}
.inapp-bar > .ic { flex: none; width: 20px; height: 20px; }
.inapp-bar .grow { flex: 1; }
.inapp-bar .btn { flex: none; }
.inapp-bar .icon-btn { flex: none; width: 34px; height: 34px; background: transparent; color: #5b4300; }
.steps { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 10px; font-size: 16px; line-height: 1.45; }
.kbd {
  display: inline-block; min-width: 30px; padding: 0 8px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); font-weight: 800; text-align: center;
}

/* ---------- Video ---------- */
.tile .vid-badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 5px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tile .vid-badge .ic { width: 13px; height: 13px; fill: #fff; stroke: none; }
.lb-play {
  position: absolute; display: none; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.5); color: #fff; cursor: pointer; backdrop-filter: blur(6px);
  box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}
.lb-play .ic { width: 32px; height: 32px; fill: #fff; stroke: none; margin-left: 4px; }
.lb-slide.is-video .lb-play { display: grid; }
.lb-slide.playing .lb-play, .lb-slide.playing img { display: none; }
.lb-slide video { max-width: 100%; max-height: 100%; background: #000; touch-action: auto; }
.q-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 2px 0; font-size: 14px; }
.q-note .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
