/**
 * Toket lite chrome — header, drawer, lang/theme, buttons, shared shell.
 * Used by index, pricing, terms, privacy, refund.
 */

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

html {
  scroll-behavior: smooth;
}

html.site-unified-chrome body,
body.legal-doc,
body.pricing-doc,
body.seo-lite-doc {
  background: var(--site-page-bg, var(--bg, var(--dt-page-bg)));
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-base, 16px);
  line-height: 1.65;
  color: var(--text-main);
  background: var(--site-page-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

/* Buttons */
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--site-btn-h, 44px);
  min-height: var(--site-btn-h, 44px);
  padding: 0 18px;
  border-radius: var(--site-btn-radius, 12px);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-btn--primary {
  color: #fff;
  background: var(--site-cta-gradient);
  border: none;
  box-shadow: none;
}

.home-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--site-cta-shadow);
  text-decoration: none;
}

.home-btn--outline {
  color: var(--text-main);
  background: transparent;
  border-color: var(--line);
}

.home-btn--outline:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  text-decoration: none;
}

.home-btn--ghost {
  color: var(--text-main);
  background: transparent;
  border: 1px solid var(--line);
  height: var(--site-btn-sm-h, 36px);
  min-height: var(--site-btn-sm-h, 36px);
  padding: 0 14px;
  border-radius: var(--site-btn-sm-radius, 10px);
  font-size: 13px;
}

.home-btn--ghost:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  text-decoration: none;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
}

@media (max-width: 960px) {
  .home-header-actions {
    min-width: max-content;
  }
}

.home-header-actions > .home-lang-switch,
.home-header-actions > .home-theme-switch {
  flex: 0 0 auto;
}

.home-header-actions > .home-account,
.home-header-actions > .bar-user {
  flex: 0 1 auto;
  min-width: 0;
}

.home-header-actions > .home-header-cta,
.home-header-actions > #siteHeaderRechargeCta,
.home-header-actions > .home-open-workspace {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 136px;
}

.home-header-cta,
.home-open-workspace,
#siteHeaderRechargeCta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--site-btn-h, 44px);
  min-height: var(--site-btn-h, 44px);
  min-width: 136px;
  padding: 0 16px;
  border-radius: var(--site-btn-radius, 12px);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: #fff !important;
  background: var(--site-cta-gradient);
  border: none;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--site-cta-shadow);
}

.home-account,
.home-account-slot {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 220px;
}

.home-account__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-bg) 88%, transparent);
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.home-account {
  position: relative;
}

.home-account-menu .site-um-who-block {
  pointer-events: none;
  padding: 4px 4px 8px;
  margin: -2px -2px 4px;
}

.home-account-menu .site-um-divider {
  margin: 4px 0 6px;
}

.home-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  z-index: 1001;
}

.home-account-menu[hidden] {
  display: none !important;
}

.home-account-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.home-account-menu__item:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  text-decoration: none;
}

.home-account-menu__item--danger {
  color: #f87171;
}

.home-account-menu__item--danger:hover {
  background: color-mix(in srgb, #f87171 10%, transparent);
}

.home-account__trigger:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  text-decoration: none;
}

.home-account__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(99, 102, 241, 0.25));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.home-account__email,
#homeAccountEmail,
#v2BarUserEmail {
  display: block;
  font-size: 13px;
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 960px) {
  .home-account__trigger {
    max-width: 120px;
    padding-right: 8px;
  }

  .home-account__email {
    display: none;
  }
}

.home-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-bg) 85%, transparent);
}

.home-lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-sub);
}

.home-lang-switch a.is-active {
  color: var(--text-main);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.home-theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-bg) 85%, transparent);
}

.home-theme-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-sub);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.home-theme-switch__btn.is-active {
  color: var(--text-main);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.home-theme-switch__btn:hover:not(.is-active) {
  color: var(--text-main);
}

.home-mobile-menu {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 960px) {
  html.site-unified-chrome .nav-wrap {
    gap: 8px 10px;
    padding-left: 16px;
    padding-right: 16px;
  }

  html.site-unified-chrome .logo {
    font-size: 15px;
    letter-spacing: -0.01em;
    flex-shrink: 0;
  }

  html.site-unified-chrome .nav-end {
    display: flex;
    align-items: center;
    gap: 6px 8px;
    flex-shrink: 1;
    min-width: 0;
    margin-left: auto;
  }

  html.site-unified-chrome .nav-links {
    display: none;
  }

  /* Toket Site Header mobile: logo + menu only; lang/theme/auth/CTA live in drawer */
  html.site-unified-chrome .nav-wrap .home-header-actions,
  html.site-unified-chrome .nav-end .home-header-actions {
    display: none !important;
  }

  html.site-unified-chrome .nav-end > #homeThemeSwitch.home-theme-switch--desktop,
  html.site-unified-chrome .home-header-actions #homeThemeSwitch.home-theme-switch--desktop {
    display: none !important;
  }

  html.site-unified-chrome .home-mobile-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  html.site-unified-chrome body.home-mobile-open .nav-wrap .home-header-actions,
  html.site-unified-chrome body.home-mobile-open .nav-end .home-header-actions,
  html.site-unified-chrome body.home-mobile-open .nav-end > #homeThemeSwitch.home-theme-switch--desktop {
    display: none !important;
  }
}

/* Mobile menu panel */
.home-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 997;
  background: color-mix(in srgb, var(--bg, var(--card-bg)) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.home-mobile-open .home-mobile-backdrop {
  display: block;
}

html.site-unified-chrome body > header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

html.site-unified-chrome .home-mobile-drawer {
  display: none;
}

@media (max-width: 960px) {
  html.site-unified-chrome body.home-mobile-open .home-mobile-drawer {
    display: block;
    position: fixed;
    top: calc(var(--site-header-h, 64px) + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    z-index: 999;
    max-height: calc(100vh - var(--site-header-h, 64px) - 24px);
    pointer-events: auto;
  }

  .home-mobile-drawer__brand {
    display: flex;
    align-items: center;
    padding: 4px 0 12px;
    margin-bottom: 4px;
  }

  .home-mobile-drawer__panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border, var(--line));
    background: color-mix(in srgb, var(--surface, var(--card-bg)) 92%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    max-height: inherit;
    overflow-y: auto;
  }

  .home-mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .home-mobile-drawer__link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 4px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
  }

  .home-mobile-drawer__link:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    text-decoration: none;
  }

  .home-mobile-drawer__divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 16px 0;
  }

  .home-mobile-drawer__bottom {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .home-mobile-drawer__section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 8px;
  }

  .home-mobile-drawer__account-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .home-mobile-drawer__account {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 6%, var(--card-bg));
    border: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
  }

  .home-mobile-drawer__account-av {
    display: none;
  }

  .home-mobile-drawer__account-email {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    width: 100%;
  }

  .home-mobile-drawer__lang {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .home-lang-switch--drawer {
    align-self: flex-start;
  }

  .home-mobile-drawer__theme {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .home-theme-switch--drawer {
    align-self: flex-start;
  }

  .home-mobile-drawer__actions {
    display: none;
  }

  .home-mobile-drawer__lang-label {
    display: none;
  }

  .home-mobile-drawer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--site-btn-h, 44px);
    min-height: var(--site-btn-h, 44px);
    padding: 0 16px;
    border-radius: var(--site-btn-radius, 12px);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    color: #fff;
    background: var(--site-cta-gradient);
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .home-mobile-drawer__cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--site-cta-shadow);
    text-decoration: none;
  }

  .home-mobile-drawer__secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--site-btn-sm-h, 36px);
    min-height: var(--site-btn-sm-h, 36px);
    padding: 0 16px;
    border-radius: var(--site-btn-sm-radius, 10px);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--line);
    cursor: pointer;
    font-family: inherit;
  }

  .home-mobile-drawer__menu-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
  }

  .home-mobile-drawer__menu-actions .home-mobile-drawer__link {
    font-size: 14px;
    font-weight: 500;
    min-height: 40px;
  }
}

@media (max-width: 960px) {
  .home-theme-switch--desktop {
    display: none !important;
  }

  .home-mobile-drawer__theme {
    display: flex;
  }
}

@media (min-width: 961px) {
  .home-mobile-drawer__theme {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .home-header-actions #homeThemeSwitch.home-theme-switch--desktop {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .home-header-actions #homeThemeSwitch.home-theme-switch--desktop {
    display: none !important;
  }
}

/* Back to top */
.home-back-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.home-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Mobile drawer Get Access — override legal-doc / page link styles */
.home-mobile-drawer a[href="/pricing/"],
.home-mobile-drawer a[href^="/pricing/"],
.home-mobile-drawer .home-mobile-drawer__cta {
  opacity: 1 !important;
  pointer-events: auto !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 600;
  background: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 100%) !important;
  border: none !important;
}

.home-mobile-drawer a[href="/pricing/"]:hover,
.home-mobile-drawer a[href^="/pricing/"]:hover,
.home-mobile-drawer .home-mobile-drawer__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.24);
}

html[data-theme="dark"] .home-mobile-drawer .home-mobile-drawer__cta,
html[data-theme="dark"] .home-mobile-drawer a[href="/pricing/"],
html[data-theme="dark"] .home-mobile-drawer a[href^="/pricing/"],
.dark .home-mobile-drawer .home-mobile-drawer__cta,
.dark .home-mobile-drawer a[href="/pricing/"],
.dark .home-mobile-drawer a[href^="/pricing/"] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.home-hero .home-btn--primary,
.home-hero a[href="/pricing/"] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 100%) !important;
}
