/* AITC 2026 — PWA shell: splash, tab bar, install coach, standalone chrome */

:root {
  --aitc-navy: #021636;
  --aitc-navy-mid: #00215b;
  --aitc-gold: #c5a052;
  --aitc-gold-bright: #e8cc84;
  --aitc-canvas: #f8f9fa;
  --aitc-safe-top: env(safe-area-inset-top, 0px);
  --aitc-safe-bottom: env(safe-area-inset-bottom, 0px);
  --aitc-safe-left: env(safe-area-inset-left, 0px);
  --aitc-safe-right: env(safe-area-inset-right, 0px);
  --aitc-tab-h: 4.35rem;
}

/* ── Splash ── */
.aitc-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aitc-navy);
  color: #fff;
  padding: var(--aitc-safe-top) 1.5rem var(--aitc-safe-bottom);
  transition: opacity 0.45s ease;
}
.aitc-splash[hidden] {
  display: none !important;
}
.aitc-splash.is-done {
  opacity: 0;
  pointer-events: none;
}
.aitc-splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: aitc-splash-in 0.7s ease both;
}
.aitc-splash__logo {
  width: min(62vw, 280px);
  height: auto;
  margin-bottom: 0.85rem;
  mix-blend-mode: screen;
}
.aitc-splash__year {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--aitc-gold-bright);
}
.aitc-splash__tag {
  margin: 0.55rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(248, 236, 210, 0.88);
}
.aitc-splash__credit {
  margin: 1.65rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.38);
}
.aitc-splash__load {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.35rem;
  height: 0.55rem;
}
.aitc-splash__load span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--aitc-gold-bright);
  animation: aitc-splash-dot 1s ease-in-out infinite;
}
.aitc-splash__load span:nth-child(2) { animation-delay: 0.15s; }
.aitc-splash__load span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aitc-splash-dot {
  0%, 80%, 100% { opacity: 0.28; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
html.aitc-splashing #aitc-splash[hidden] {
  display: flex !important;
}
@keyframes aitc-splash-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aitc-splash__inner { animation: none; }
  .aitc-splash__load span { animation: none; opacity: 0.7; }
}

/* ── Super-app chrome (Livin / BCA pattern) ── */
@media (display-mode: standalone) {
  .site-app-header {
    display: none !important;
  }
  /* Login already insets header/hero; extra body padding double-shifts the sheet. */
  body:not(.login-portal) {
    padding-top: var(--aitc-safe-top);
  }
}
body.aitc-standalone:not(.login-portal) {
  padding-top: var(--aitc-safe-top);
}
body.aitc-standalone.login-portal {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}
@media (max-width: 1023px) {
  body.aitc-has-tabbar .site-app-header {
    display: none !important;
  }
  body.aitc-has-tabbar .dash-shell {
    min-height: 100dvh;
  }
  body.aitc-has-tabbar.dash-home .dash-main {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
  }
  body.aitc-has-tabbar.theme-dash-light {
    background: #f4f6f8 !important;
  }
}

.aitc-appbar {
  display: none;
}
@media (max-width: 1023px) {
  body.aitc-has-tabbar .aitc-appbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: calc(3.15rem + var(--aitc-safe-top));
    padding: var(--aitc-safe-top) 0.35rem 0;
    background: #fff;
    color: var(--aitc-navy);
    border-bottom: 1px solid #e8edf3;
  }
  body.aitc-has-tabbar:not(.theme-dash-light):not(.theme-home-light) .aitc-appbar {
    background: var(--aitc-navy);
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
}
.aitc-appbar__back,
.aitc-appbar__gap {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  color: inherit;
  flex-shrink: 0;
}
.aitc-appbar__back svg {
  width: 1.35rem;
  height: 1.35rem;
}
.aitc-appbar h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.aitc-more__user {
  text-align: left;
  padding: 0.25rem 0.15rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.55rem;
}
.aitc-more__user strong {
  display: block;
  font-size: 1.05rem;
  color: var(--aitc-navy);
}
.aitc-more__user span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* ── Tab bar (phone / tablet portrait) ── */
.aitc-tabbar {
  display: none;
}
@media (max-width: 1023px) {
  body.aitc-has-tabbar .aitc-tabbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    min-height: calc(var(--aitc-tab-h) + var(--aitc-safe-bottom));
    padding: 0.35rem 0.35rem calc(0.4rem + var(--aitc-safe-bottom));
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 28px rgba(2, 22, 54, 0.08);
  }
  body.aitc-has-tabbar {
    padding-bottom: calc(var(--aitc-tab-h) + var(--aitc-safe-bottom));
  }
  body.aitc-has-tabbar .dash-main > .no-scrollbar {
    display: none;
  }
  body.aitc-has-tabbar #chatbot-container {
    display: none !important;
  }
  body.aitc-has-tabbar #verified-toast {
    bottom: calc(5.5rem + var(--aitc-safe-bottom));
  }
  body.login-portal.aitc-has-tabbar .login-foot {
    display: none;
  }
}

.aitc-tab {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  min-height: 3.1rem;
  padding: 0.2rem 0.15rem 0.15rem;
  color: #94a3b8;
  text-decoration: none;
  font: 600 0.62rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
}
.aitc-tab > svg {
  width: 1.4rem;
  height: 1.4rem;
  transition: transform 0.16s ease;
}
.aitc-tab span {
  position: relative;
  white-space: nowrap;
}
.aitc-tab.is-on {
  color: var(--aitc-navy);
}
.aitc-tab.is-on span::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 0.22rem auto 0;
  border-radius: 50%;
  background: var(--aitc-gold-bright);
  box-shadow: 0 0 0 2px rgba(232, 204, 132, 0.35);
  animation: aitc-tab-dot 0.38s ease;
}
.aitc-tab.is-on > svg {
  animation: aitc-tab-pop 0.42s ease;
}
.aitc-tab:active > svg {
  transform: scale(0.92);
}
.aitc-tab--badge {
  position: relative;
  justify-content: flex-end;
}
.aitc-tab-badge {
  display: grid;
  place-items: center;
  width: 3.15rem;
  height: 3.15rem;
  margin-top: -1.35rem;
  border-radius: 50%;
  background: var(--aitc-navy);
  color: var(--aitc-gold-bright);
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(2, 22, 54, 0.28);
  transition: transform 0.16s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.aitc-tab--badge.is-on .aitc-tab-badge {
  background: var(--aitc-navy-mid);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--aitc-gold-bright),
    0 8px 20px rgba(2, 22, 54, 0.28);
  animation: aitc-tab-pop 0.42s ease;
}
.aitc-tab--badge:active .aitc-tab-badge {
  transform: scale(0.92);
}
.aitc-tab-badge svg {
  width: 1.35rem;
  height: 1.35rem;
}
@keyframes aitc-tab-pop {
  0% { transform: scale(0.88); }
  55% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes aitc-tab-dot {
  0% { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── More sheet ── */
.aitc-more {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.aitc-more__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 22, 54, 0.45);
}
.aitc-more__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 1.15rem calc(1.15rem + var(--aitc-safe-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
  color: #0a1628;
  box-shadow: 0 -16px 40px rgba(2, 22, 54, 0.18);
}
.aitc-more__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 0 auto 0.85rem;
}
.aitc-more__kicker {
  margin: 0 0 0.55rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--aitc-navy-mid);
}
.aitc-more__sheet > a,
.aitc-more__sheet > button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.15rem;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  color: #0a1628;
  font: 600 0.92rem/1.3 Inter, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.aitc-more__sheet > a:last-of-type,
.aitc-more__logout {
  color: #b91c1c;
}
.aitc-more__close {
  margin-top: 0.65rem;
  border-bottom: 0 !important;
  text-align: center !important;
  color: #64748b !important;
  font-size: 0.82rem !important;
}

.aitc-other__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 0.35rem;
  padding: 0.2rem 0 0.35rem;
}
.aitc-other__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.15rem;
  border: 0;
  background: none;
  color: #334155;
  font: 600 0.68rem/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.aitc-other__tile[hidden] {
  display: none !important;
}
.aitc-other__ico {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef3f8;
  color: #021636;
  box-shadow: 0 6px 16px rgba(2, 22, 54, 0.07);
}
.aitc-other__ico svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ── Install banner (KM / FinOS pattern) ── */
.aitc-install {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--aitc-safe-bottom));
  z-index: 2147483000;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(2, 22, 54, 0.18);
  border: 1px solid #e8edf3;
  padding: 14px 14px 12px;
  animation: aitc-install-up 0.35s ease;
}
.aitc-install[hidden] {
  display: none !important;
}
@keyframes aitc-install-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.aitc-install__inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.aitc-install__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--aitc-navy);
  padding: 4px;
  flex-shrink: 0;
}
.aitc-install__copy {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}
.aitc-install__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0a1628;
  line-height: 1.25;
}
.aitc-install__text {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.aitc-install__close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.aitc-install__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.aitc-install__later,
.aitc-install__cta {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
  font: 600 13px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.aitc-install__later {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0a1628;
}
.aitc-install__cta {
  border: 0;
  background: var(--aitc-navy);
  color: #fff;
}
.aitc-install__cta[hidden] {
  display: none !important;
}
.aitc-install__cta:active,
.aitc-install__later:active {
  transform: scale(0.99);
}
.aitc-install.is-ios .aitc-install__cta,
html.aitc-ios .aitc-install__cta,
body.aitc-ios .aitc-install__cta {
  display: none;
}
.aitc-install--login .aitc-install__later {
  display: none !important;
}
.aitc-install--login .aitc-install__close {
  display: block;
  width: 2rem;
  height: 2rem;
  font-size: 24px;
}
.aitc-install--login .aitc-install__cta,
.aitc-install--login .aitc-install__open-browser,
.aitc-install--login .aitc-install__reload {
  flex: 1 1 100%;
}
.aitc-install__reload {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0a1628;
  min-height: 42px;
  border-radius: 12px;
  font: 600 13px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.aitc-install__reload[hidden] {
  display: none !important;
}
.aitc-install__cta.is-waiting,
.aitc-install__cta:disabled {
  opacity: 0.72;
  cursor: wait;
}
.aitc-install.is-ready .aitc-install__cta.is-waiting,
.aitc-install.is-ready .aitc-install__cta:disabled {
  opacity: 1;
  cursor: pointer;
}
.aitc-install.is-ready .aitc-install__cta:not(:disabled) {
  animation: aitc-install-pulse 1.4s ease-in-out 2;
}
@keyframes aitc-install-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(2, 22, 54, 0); }
  50% { box-shadow: 0 0 0 6px rgba(2, 22, 54, 0.12); }
}
.aitc-install__open-browser {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0a1628;
  min-height: 42px;
  border-radius: 12px;
  font: 600 13px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.aitc-install__open-browser[hidden] {
  display: none !important;
}
.aitc-install.is-ios-safari .aitc-install__cta,
.aitc-install.is-ios .aitc-install__cta {
  display: none !important;
}
.aitc-install.is-iab .aitc-install__cta {
  display: none !important;
}
.aitc-install.is-iab .aitc-install__open-browser {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.aitc-install.is-iab .aitc-install__open-browser[hidden] {
  display: none !important;
}

/* ── Update now ── */
.aitc-update {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + var(--aitc-safe-bottom));
}
.aitc-update[hidden] {
  display: none !important;
}
.aitc-update__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 22, 54, 0.45);
}
.aitc-update__card {
  position: relative;
  width: min(100%, 22rem);
  background: #fff;
  border-radius: 22px;
  border: 1px solid #e8edf3;
  padding: 1.25rem 1.15rem 1.1rem;
}
.aitc-update__kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aitc-gold);
}
.aitc-update__title {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0a1628;
  line-height: 1.25;
}
.aitc-update__text {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
}
.aitc-update__cta {
  display: block;
  width: 100%;
  margin-top: 1rem;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--aitc-navy);
  color: #fff;
  font: 700 0.9rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.aitc-update__cta:disabled {
  opacity: 0.72;
  cursor: wait;
}
@media (min-width: 640px) {
  .aitc-update {
    align-items: center;
  }
}
body.aitc-has-tabbar .aitc-install {
  bottom: calc(var(--aitc-tab-h) + var(--aitc-safe-bottom) + 12px);
}

@media (max-width: 639px) and (max-height: 720px) {
  body.login-portal .login-stats { display: none; }
}

@media (min-width: 768px) {
  .aitc-install {
    left: 50%;
    right: auto;
    width: min(440px, calc(100% - 48px));
    transform: translateX(-50%);
  }
  @keyframes aitc-install-up {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .aitc-install { animation: none; }
  .aitc-tab > svg,
  .aitc-tab-badge {
    transition: none;
  }
  .aitc-tab.is-on > svg,
  .aitc-tab.is-on span::after,
  .aitc-tab--badge.is-on .aitc-tab-badge {
    animation: none;
  }
  .aitc-tab:active > svg,
  .aitc-tab--badge:active .aitc-tab-badge {
    transform: none;
  }
}

/* ── Get App landing ── */
.get-app-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem calc(8rem + var(--aitc-safe-bottom));
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232, 204, 132, 0.14), transparent 58%),
    linear-gradient(165deg, #0a2348 0%, #071a38 48%, #021636 100%);
  color: #fff;
  text-align: center;
}
.get-app-page__logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  padding: 10px;
  border-radius: 18px;
  background: #021636;
  margin-bottom: 1rem;
}
.get-app-page__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.get-app-page__lead {
  margin: 0.5rem 0 0;
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}
.get-app-page__login {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 12px;
  background: #c5a052;
  color: #021636;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

/* ── Badge / QRIS screen ── */
.app-badge-page {
  background: #021636 !important;
  color: #fff;
  min-height: 100dvh;
}
.app-badge {
  min-height: 100dvh;
  padding: 1.25rem 1.15rem calc(1.5rem + var(--aitc-safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.app-badge__kicker {
  margin: 0.35rem 0 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e8cc84;
}
.app-badge__card {
  width: min(100%, 22rem);
  padding: 1.35rem 1.2rem 1.25rem;
  border-radius: 24px;
  background: #fff;
  color: #0a1628;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.app-badge__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #021636;
}
.app-badge__code {
  margin: 0.2rem 0 0;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: #64748b;
}
.app-badge__pill {
  display: inline-flex;
  margin-top: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}
.app-badge__pill.is-wait {
  background: #fffbeb;
  color: #b45309;
}
.app-badge__qr {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 1.1rem auto 0.65rem;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
}
.app-badge__qr img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}
.app-badge__qr #qr-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.app-badge__note {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}
.app-badge__id {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 22rem);
  min-height: 48px;
  margin-top: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 204, 132, 0.45);
  color: #e8cc84;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}
@media (max-width: 1023px) {
  body.aitc-has-tabbar .app-badge-back { display: none; }
  body.aitc-has-tabbar .aitc-site-footer { display: none !important; }
  body.aitc-has-tabbar .app-dup-title { display: none !important; }
  body.aitc-has-tabbar .sch-page .sch-hero,
  .sch-page .sch-hero h1,
  .sch-hero__title {
    display: none !important;
  }
  body.aitc-has-tabbar .travel-page .section-eyebrow,
  body.aitc-has-tabbar .travel-page .section-title { display: none; }
  body.aitc-has-tabbar .travel-page #travel-guide { padding-top: 1.1rem; }
}
