/*
 * TNTOPUP — Trang tải App
 * Liquid Glass UI / 2026 refresh
 * Tương thích trực tiếp với cấu trúc Tai-App.html hiện tại.
 */

:root {
  color-scheme: dark;

  --bg-0: #030811;
  --bg-1: #07111e;
  --bg-2: #0a1d31;

  --surface: rgba(10, 27, 45, 0.62);
  --surface-strong: rgba(9, 25, 42, 0.82);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.085);

  --line: rgba(167, 218, 255, 0.14);
  --line-strong: rgba(116, 210, 255, 0.29);
  --highlight: rgba(255, 255, 255, 0.2);

  --text: #f7fbff;
  --text-2: #c9d9e7;
  --text-3: #8fa8bd;

  --cyan: #27d9ff;
  --cyan-2: #65efff;
  --blue: #3487ff;
  --blue-2: #66a9ff;
  --green: #40e5a4;
  --warning: #ffcc72;
  --danger-soft: #ffb782;

  --accent-gradient: linear-gradient(135deg, #26ddff 0%, #3797ff 48%, #755dff 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(38, 221, 255, 0.17), rgba(55, 151, 255, 0.12) 50%, rgba(117, 93, 255, 0.12));

  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 18px 46px rgba(0, 0, 0, 0.28);
  --shadow-accent: 0 12px 34px rgba(42, 173, 255, 0.26);

  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;

  --page-width: 1080px;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-0);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(43, 209, 255, 0.17), transparent 30rem),
    radial-gradient(circle at 86% 22%, rgba(80, 99, 255, 0.15), transparent 32rem),
    radial-gradient(circle at 50% 100%, rgba(22, 114, 186, 0.12), transparent 34rem),
    linear-gradient(180deg, #06101c 0%, #040a12 48%, #03070d 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(10px);
  opacity: .9;
}

body::before {
  width: 34rem;
  height: 34rem;
  top: -19rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(39, 217, 255, 0.24), rgba(39, 217, 255, 0));
}

body::after {
  width: 36rem;
  height: 36rem;
  right: -18rem;
  bottom: -18rem;
  background: radial-gradient(circle, rgba(80, 91, 255, 0.19), rgba(80, 91, 255, 0));
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

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

.page {
  width: min(calc(100% - 32px), var(--page-width));
  margin: 0 auto;
  padding:
    max(22px, env(safe-area-inset-top))
    0
    max(34px, calc(22px + env(safe-area-inset-bottom)));
}

/* ---------- Glass foundation ---------- */
.hero,
.store-card,
.guide-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.018) 42%, rgba(52, 135, 255, 0.028)),
    var(--surface);
  box-shadow:
    inset 0 1px 0 var(--highlight),
    inset 0 -1px 0 rgba(255, 255, 255, 0.025),
    var(--shadow-md);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.hero::before,
.store-card::before,
.guide-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.115), transparent 18%, transparent 75%, rgba(91, 196, 255, 0.055));
  opacity: .66;
}

.hero::after,
.store-card::after,
.guide-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 16rem;
  height: 16rem;
  top: -10rem;
  right: -7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 198, 255, 0.18), transparent 68%);
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  border-radius: var(--radius-xl);
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.23),
    0 30px 80px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(20, 184, 255, 0.02);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo,
.app-icon {
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(8, 29, 48, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 16px 34px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(39, 217, 255, 0.12);
}

.logo {
  width: 82px;
  height: 82px;
  padding: 6px;
  border-radius: 24px;
}

.logo img,
.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.logo .fallback,
.app-icon .fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: inherit;
  color: #fff;
  background: var(--accent-gradient);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.16);
}

.logo .fallback {
  font-size: 28px;
}

.brand > div:last-child {
  min-width: 0;
}

.brand h1,
.platform-head h2,
.guide-title h3,
.brand p,
.platform-head .sub {
  margin: 0;
}

.brand h1 {
  width: fit-content;
  max-width: 100%;
  color: #fff;
  font-size: clamp(30px, 4.5vw, 44px);
  line-height: .98;
  letter-spacing: -0.045em;
  font-weight: 900;
  text-shadow: 0 3px 28px rgba(44, 187, 255, 0.18);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand h1 {
    background: linear-gradient(112deg, #ffffff 0%, #dff8ff 28%, #75e6ff 62%, #8bb8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.brand p {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 650;
}

.version {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(101, 239, 255, 0.17);
  border-radius: 999px;
  color: #bfeefe;
  background: rgba(39, 217, 255, 0.07);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 700;
}

.version::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(64, 229, 164, 0.09), 0 0 14px rgba(64, 229, 164, 0.58);
}

/* ---------- Platform selector ---------- */
.selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(3, 12, 22, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

.platform-btn {
  min-width: 132px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 15px;
  outline: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #a9bdce;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  transition:
    color .24s var(--ease),
    background-color .24s var(--ease),
    border-color .24s var(--ease),
    box-shadow .24s var(--ease),
    transform .2s var(--ease);
}

.platform-btn svg,
.platform-btn .apple-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}

.platform-btn .apple-icon {
  filter: brightness(0) invert(1);
  opacity: .72;
}

.platform-btn:hover {
  color: #e9f8ff;
  background: rgba(255, 255, 255, 0.055);
}

.platform-btn:active {
  transform: scale(.975);
}

.platform-btn.active {
  color: #fff;
  border-color: rgba(110, 224, 255, 0.24);
  background:
    linear-gradient(145deg, rgba(67, 211, 255, 0.22), rgba(49, 123, 255, 0.17)),
    rgba(21, 87, 135, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 24px rgba(27, 146, 229, 0.17),
    0 0 0 1px rgba(51, 188, 255, 0.04);
}

.platform-btn.active .apple-icon {
  opacity: 1;
}

.platform-btn:focus-visible,
.cta:focus-visible {
  outline: 3px solid rgba(101, 239, 255, 0.38);
  outline-offset: 3px;
}

/* ---------- Main panels ---------- */
.store {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  gap: 18px;
  align-items: start;
  animation: panelIn .36s var(--ease) both;
}

.hidden {
  display: none !important;
}

.store-card,
.guide-card {
  border-radius: var(--radius-lg);
}

.store-card {
  padding: 24px;
}

.guide-card {
  overflow: hidden;
}

.platform-head {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}

.app-icon {
  width: 70px;
  height: 70px;
  padding: 5px;
  border-radius: 20px;
}

.app-icon .fallback {
  font-size: 22px;
}

.platform-head > div:last-child {
  min-width: 0;
}

.platform-head h2 {
  color: #f9fdff;
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 850;
}

.platform-head .sub {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 560;
}

.cta-row {
  margin-top: 15px;
}

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: fit-content;
  min-height: 48px;
  max-width: 100%;
  padding: 0 19px;
  border: 1px solid rgba(151, 238, 255, 0.34);
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.29),
    0 12px 28px rgba(44, 159, 255, 0.24),
    0 0 28px rgba(39, 217, 255, 0.1);
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: -0.01em;
  transition: transform .2s var(--ease), box-shadow .24s var(--ease), filter .24s var(--ease);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 1px 12% auto;
  height: 40%;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.cta:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 16px 34px rgba(44, 159, 255, 0.3),
    0 0 34px rgba(39, 217, 255, 0.13);
}

.cta:active {
  transform: translateY(0) scale(.985);
}

.badges {
  margin-top: 21px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(119, 213, 255, 0.14);
  border-radius: 999px;
  color: #cce9f8;
  background: rgba(68, 171, 224, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 700;
}

.info-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info {
  min-width: 0;
  min-height: 96px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(3, 15, 26, 0.27);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color .22s var(--ease), background-color .22s var(--ease), transform .22s var(--ease);
}

.info:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 211, 255, 0.16);
  background-color: rgba(11, 56, 87, 0.22);
}

.info b {
  color: #edf9ff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.info span {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
}

/* ---------- Install guide ---------- */
.guide-title {
  min-height: 68px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.022);
}

.guide-title h3 {
  color: #f4fbff;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 820;
}

.guide-title .badge {
  flex: 0 0 auto;
  color: #ddf7ff;
  border-color: rgba(75, 211, 255, 0.18);
  background: rgba(39, 217, 255, 0.08);
}

.guide-body {
  padding: 18px 20px 20px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.step {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  gap: 11px;
  background: rgba(3, 14, 24, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.step .num {
  width: 33px;
  height: 33px;
  border: 1px solid rgba(108, 225, 255, 0.24);
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(46, 210, 255, 0.28), rgba(54, 111, 255, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.17), 0 6px 15px rgba(28, 133, 215, 0.12);
  font-size: 13px;
  font-weight: 900;
}

.step > div:last-child {
  min-width: 0;
  padding-top: 1px;
}

.step b,
.step span {
  display: block;
}

.step b {
  color: #ecf8ff;
  font-size: 12.5px;
  line-height: 1.42;
  font-weight: 800;
}

.step span {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 500;
}

.notice {
  position: relative;
  margin-top: 14px;
  padding: 13px 14px 13px 39px;
  border: 1px solid rgba(70, 224, 172, 0.16);
  border-radius: 15px;
  color: #bcead9;
  background: rgba(49, 192, 142, 0.065);
  font-size: 11.5px;
  line-height: 1.55;
  font-weight: 570;
}

.notice::before {
  content: "✓";
  position: absolute;
  left: 13px;
  top: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #dffff3;
  background: rgba(64, 229, 164, 0.15);
  font-size: 11px;
  font-weight: 900;
}

.ios-warning {
  border-color: rgba(255, 204, 114, 0.18);
  color: #f2d9aa;
  background: rgba(255, 178, 64, 0.07);
}

.ios-warning::before {
  content: "!";
  color: #fff4dc;
  background: rgba(255, 194, 92, 0.17);
}

.footer {
  margin-top: 20px;
  padding: 5px 8px 0;
  color: rgba(172, 197, 215, 0.52);
  text-align: center;
  font-size: 10.5px;
  line-height: 1.5;
  font-weight: 600;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.994);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .selector {
    width: 100%;
  }

  .platform-btn {
    min-width: 0;
  }

  .store {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root {
    --radius-xl: 24px;
    --radius-lg: 21px;
  }

  .page {
    width: min(calc(100% - 20px), var(--page-width));
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .hero {
    padding: 17px;
    gap: 17px;
  }

  .brand {
    gap: 13px;
    align-items: flex-start;
  }

  .logo {
    width: 64px;
    height: 64px;
    padding: 4px;
    border-radius: 19px;
  }

  .logo .fallback {
    font-size: 22px;
  }

  .brand h1 {
    font-size: clamp(28px, 9vw, 36px);
  }

  .brand p {
    margin-top: 5px;
    font-size: 12.5px;
  }

  .version {
    margin-top: 8px;
    padding: 6px 8px;
    white-space: normal;
    font-size: 10px;
  }

  .selector {
    border-radius: 17px;
  }

  .platform-btn {
    min-height: 45px;
    padding: 0 10px;
    border-radius: 12px;
    gap: 7px;
    font-size: 12.5px;
  }

  .platform-btn svg,
  .platform-btn .apple-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .store {
    margin-top: 12px;
    gap: 12px;
  }

  .store-card {
    padding: 17px;
  }

  .platform-head {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .app-icon {
    width: 56px;
    height: 56px;
    padding: 4px;
    border-radius: 17px;
  }

  .platform-head h2 {
    font-size: 20px;
  }

  .platform-head .sub {
    margin-top: 4px;
    font-size: 12px;
  }

  .cta-row {
    margin-top: 11px;
  }

  .cta {
    width: 100%;
    min-height: 45px;
    padding: 0 13px;
    border-radius: 13px;
    font-size: 12.5px;
  }

  .badges {
    margin-top: 16px;
    gap: 6px;
  }

  .badge {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 10.2px;
  }

  .info-grid {
    margin-top: 15px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info {
    min-height: 0;
    padding: 12px 13px;
    gap: 4px;
  }

  .info b {
    font-size: 12.3px;
  }

  .info span {
    font-size: 11px;
    line-height: 1.48;
  }

  .guide-title {
    min-height: 58px;
    padding: 14px 15px;
    gap: 10px;
  }

  .guide-title h3 {
    font-size: 14px;
  }

  .guide-body {
    padding: 13px 14px 15px;
  }

  .steps {
    gap: 8px;
  }

  .step {
    padding: 10px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    border-radius: 13px;
  }

  .step .num {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .step b {
    font-size: 11.8px;
  }

  .step span,
  .notice {
    font-size: 10.6px;
  }

  .notice {
    padding: 11px 12px 11px 35px;
    border-radius: 13px;
  }

  .notice::before {
    left: 11px;
    top: 11px;
  }

  .footer {
    margin-top: 14px;
    font-size: 9.5px;
  }
}

/* ---------- Very small devices ---------- */
@media (max-width: 390px) {
  .brand {
    align-items: center;
  }

  .logo {
    width: 56px;
    height: 56px;
    border-radius: 17px;
  }

  .brand h1 {
    font-size: 27px;
  }

  .brand p {
    font-size: 11.5px;
  }

  .version {
    font-size: 9.4px;
  }

  .platform-btn {
    font-size: 11.5px;
  }

  .platform-head {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .app-icon {
    width: 50px;
    height: 50px;
  }

  .platform-head h2 {
    font-size: 18px;
  }
}

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

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hero,
  .store-card,
  .guide-card {
    background: rgba(7, 22, 37, 0.96);
  }
}
