/* VictiVPN / Signal desk — reversible visual layer over the deployed cabinet.
   The application bundle and all payment/subscription behavior remain intact. */

html.light {
  --color-champagne-50: 255, 255, 255 !important;
  --color-champagne-100: 251, 250, 254 !important;
  --color-champagne-200: 246, 244, 251 !important;
  --color-champagne-300: 225, 220, 237 !important;
  --color-champagne-400: 185, 176, 205 !important;
  --color-champagne-500: 141, 128, 166 !important;
  --color-champagne-600: 108, 95, 133 !important;
  --color-champagne-700: 78, 65, 106 !important;
  --color-champagne-800: 55, 42, 82 !important;
  --color-champagne-900: 39, 29, 67 !important;
  --color-champagne-950: 27, 18, 52 !important;
  --color-accent-50: 246, 241, 255 !important;
  --color-accent-100: 237, 226, 255 !important;
  --color-accent-200: 219, 199, 255 !important;
  --color-accent-300: 117, 64, 223 !important;
  --color-accent-400: 103, 49, 211 !important;
  --color-accent-500: 106, 54, 216 !important;
  --color-accent-600: 91, 42, 194 !important;
  --color-accent-700: 78, 33, 171 !important;
  --color-accent-800: 61, 25, 139 !important;
  --color-accent-900: 48, 19, 110 !important;
  --color-accent-950: 34, 12, 79 !important;
  --color-on-accent: 255, 255, 255 !important;
  --bento-radius: 14px;
  --bento-radius-lg: 18px;
  --bento-gap: 14px;
  --bento-gap-lg: 18px;
}

html.dark {
  --color-dark-950: 21, 15, 34 !important;
  --color-dark-900: 30, 22, 47 !important;
  --color-dark-850: 35, 26, 54 !important;
  --color-dark-800: 44, 33, 64 !important;
  --color-dark-700: 70, 54, 92 !important;
  --color-dark-600: 103, 87, 128 !important;
  --color-accent-400: 190, 158, 255 !important;
  --color-accent-500: 143, 91, 240 !important;
  --color-accent-600: 122, 68, 221 !important;
  --color-on-accent: 255, 255, 255 !important;
  --bento-radius: 14px;
  --bento-radius-lg: 18px;
}

html.light body {
  background: #f6f4fb !important;
  color: #271d43;
}

html.dark body {
  background: #150f22 !important;
}

body::before,
body > .pointer-events-none.fixed.inset-0 {
  display: none !important;
}

body {
  font-family: Manrope, system-ui, sans-serif !important;
}

html.light h1,
html.light h2,
html.light h3 {
  letter-spacing: -0.035em;
}

/* Flat, quiet surfaces. Card shape follows information hierarchy instead of
   repeating the original glass/bento treatment on every block. */
html.light .card,
html.light .bento-card,
html.light .glass {
  background: #fff !important;
  border: 1px solid #e5e0ef !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 18px rgba(46, 24, 88, 0.035) !important;
  backdrop-filter: none !important;
}

html.light .bento-card-hover:hover,
html.light .card-hover:hover {
  background: #fff !important;
  border-color: #bca6e8 !important;
  box-shadow: 0 8px 24px rgba(78, 33, 171, 0.09) !important;
}

html.light .bento-card-hover::after {
  display: none;
}

html.light .btn-primary,
html.light button.bg-accent-500,
html.light a.bg-accent-500 {
  background: #6a36d8 !important;
  border-color: #6a36d8 !important;
  color: #fff !important;
  box-shadow: none !important;
  border-radius: 11px !important;
}

html.light .btn-primary:hover,
html.light button.bg-accent-500:hover,
html.light a.bg-accent-500:hover {
  background: #5527b8 !important;
}

html.light .btn-secondary,
html.light .input {
  background: #fff !important;
  border: 1px solid #dcd5ea !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}

html.light .input:focus-visible,
html.light button:focus-visible,
html.light a:focus-visible {
  outline: 2px solid #6a36d8;
  outline-offset: 2px;
}

/* Desktop: an anchored navigation rail, no floating menu capsule. */
@media (min-width: 1024px) {
  #root header.hidden {
    width: 232px !important;
    height: 100dvh !important;
    border-right: 1px solid #e5e0ef !important;
    border-bottom: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  #root header.hidden > div {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    max-width: none;
    padding: 30px 16px 20px;
    gap: 30px;
  }

  #root header.hidden a[href="/"] {
    align-self: flex-start;
    margin-left: 10px;
  }

  #root header.hidden nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #root header.hidden nav a {
    min-height: 43px;
    justify-content: flex-start;
    border-radius: 9px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  #root header.hidden nav a:has(> span.absolute) {
    color: #5427b7 !important;
  }

  #root header.hidden nav a > span.absolute {
    background: #f0e9fd !important;
    border: 0 !important;
    border-radius: 9px !important;
    box-shadow: none !important;
  }

  #root header.hidden > div > div:last-child {
    margin-top: auto;
    align-self: stretch;
    justify-content: flex-start;
    padding: 14px 8px 0;
    border-top: 1px solid #ebe6f2;
  }

  #root header.hidden ~ div.hidden.h-14 {
    height: 0 !important;
  }

  #root main {
    width: min(1120px, calc(100% - 232px));
    max-width: none !important;
    margin-left: 232px !important;
    margin-right: 0 !important;
    padding: 48px clamp(28px, 4vw, 70px) 60px !important;
  }

  html.dark #root header.hidden {
    background: #20172f !important;
    border-right-color: #49375f !important;
  }

  html.dark #root header.hidden nav a:has(> span.absolute) {
    color: #f4ebff !important;
  }

  html.dark #root header.hidden nav a > span.absolute {
    background: #4d3173 !important;
  }

  html.dark #root header.hidden > div > div:last-child {
    border-top-color: #49375f;
  }
}

/* Mobile: a flush navigation shelf that gives content the entire width. */
@media (max-width: 1023px) {
  html.light #root header.glass {
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e0ef !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #root nav.fixed.z-50 {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -8px 24px rgba(42, 22, 80, 0.08) !important;
  }

  html.light #root nav.fixed.z-50 {
    background: #fff !important;
    border: 1px solid #e5e0ef !important;
    border-bottom: 0 !important;
  }

  #root nav.fixed.z-50 a {
    border-radius: 9px !important;
    padding: 9px 2px !important;
  }

  #root nav.fixed.z-50 a > div.absolute {
    top: 0;
    bottom: auto;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: #6a36d8 !important;
  }

  #root main {
    padding: 24px 16px calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* The subscription is the focal point. Activity, time and connection action
   stay in their current DOM positions so the existing flows are untouched. */
#root main > div.space-y-6 > div[data-onboarding="welcome"] {
  padding: 2px 0 6px;
}

#root main > div.space-y-6 > div[data-onboarding="welcome"] h1 {
  font-size: clamp(28px, 4vw, 40px) !important;
  font-weight: 800;
  line-height: 1.1;
}

html.light #root main > div.space-y-6 > div:has([data-onboarding="connect-devices"]) {
  background: #fff !important;
  border: 1px solid #e0d9eb !important;
  border-top: 5px solid #6a36d8 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 34px rgba(63, 31, 122, 0.075) !important;
}

html.light #root main [data-onboarding="connect-devices"] {
  background: #f2ebff !important;
  border: 1px solid #d9c7fc !important;
  box-shadow: none !important;
  animation: none !important;
}

html.light #root main [data-onboarding="connect-devices"]:hover {
  background: #e9dcff !important;
}

html.light #root main .hover-border-gradient {
  animation: none !important;
}

html.light #root main [data-onboarding="balance"] > div,
html.light #root main a[href="/referral"] > div.h-full {
  background: #fff !important;
  border: 1px solid #e5e0ef;
  border-radius: 12px !important;
}

/* Login: a bold identity panel on wide screens and a compact form on mobile. */
@media (min-width: 900px) {
  #root > div > div:has(> div.fixed.right-3) {
    display: grid !important;
    grid-template-columns: minmax(360px, 1fr) minmax(410px, 1fr);
    gap: 0;
    padding: 0 !important;
  }

  #root > div > div:has(> div.fixed.right-3)::before {
    content: "V";
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100dvh;
    background: #6a36d8;
    color: #fff;
    font-family: Outfit, Manrope, sans-serif;
    font-size: clamp(280px, 37vw, 650px);
    font-weight: 700;
    letter-spacing: -0.12em;
    line-height: 1;
    padding-right: 0.12em;
  }

  #root > div > div:has(> div.fixed.right-3) > div.relative {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    width: min(440px, calc(100% - 64px));
  }
}

#root > div > div:has(> div.fixed.right-3) > div.relative h1 {
  font-family: Outfit, Manrope, sans-serif;
  font-size: 30px !important;
  letter-spacing: -0.045em;
}

html.light #root > div > div:has(> div.fixed.right-3) .card {
  padding: 26px !important;
  box-shadow: 0 10px 35px rgba(46, 24, 88, 0.06) !important;
}

html.light #root > div > div:has(> div.fixed.right-3) .card .bg-dark-800.p-1 {
  background: #f1edfa !important;
  border-radius: 10px !important;
}

html.light #root > div > div:has(> div.fixed.right-3) .card .bg-accent-500 {
  background: #6a36d8 !important;
}

/* Legal pages remain readable before login. */
html.light #root > div > .min-h-viewport.bg-dark-950 {
  background: #f6f4fb !important;
}

html.light #root .prose-invert {
  color: #3f3457 !important;
}

html.light #root .prose-invert a {
  color: #5b2ac2 !important;
}

/* Shared surfaces used by tariff selection, payment methods, balance,
   connection steps, profile, support and the cabinet's admin pages. */
html.light #root main h1 {
  font-family: Outfit, Manrope, system-ui, sans-serif;
  font-size: clamp(28px, 3vw, 36px) !important;
  font-weight: 700;
  line-height: 1.16;
}

html.light #root main [style*="linear-gradient(145deg"] {
  background: #fff !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 18px rgba(46, 24, 88, 0.035) !important;
}

html.light #root main [class*="border-dark-700/40"][class*="bg-dark-900"],
html.light #root main [class*="border-dark-700/50"][class*="bg-dark-900"] {
  background: #fff !important;
  border-color: #e5e0ef !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 18px rgba(46, 24, 88, 0.035) !important;
}

html.light #root main [class*="bg-dark-800/70"][class*="border-dark-700"],
html.light #root main [class*="bg-dark-800/50"][class*="border-dark-700"] {
  background: #fbfaff !important;
  border-color: #e5e0ef !important;
}

html.light #root main [class*="bg-dark-800/30"][class*="rounded-xl"] {
  background: #faf8fe !important;
  border-radius: 10px !important;
}

html.light #root main :is(input, textarea, select):focus-visible {
  outline: 2px solid #6a36d8;
  outline-offset: 1px;
}

html.light #root main div:has(> input[type="number"])[class*="bg-dark-800"] {
  background: #fff !important;
  border: 1px solid #dcd5ea !important;
  border-radius: 10px !important;
}

html.light #root main table {
  border-collapse: separate;
  border-spacing: 0;
}

html.light #root main table th {
  background: #f5f1fc;
  color: #62547e;
}

html.light #root main table td {
  border-bottom-color: #ebe6f3;
}

html.light #root [class*="from-dark-950"][class*="to-dark-950"] {
  background: #f6f4fb !important;
}

/* The dark option is also VictiVPN's design, not the original navy/glass
   theme left behind by a theme switch. */
html.dark .card,
html.dark .bento-card,
html.dark .glass {
  background: #21182f !important;
  border: 1px solid #49375f !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html.dark .bento-card-hover::after {
  display: none;
}

html.dark .bento-card-hover:hover,
html.dark .card-hover:hover {
  background: #2b1f3e !important;
  border-color: #7753aa !important;
  box-shadow: none !important;
}

html.dark .btn-primary,
html.dark button.bg-accent-500,
html.dark a.bg-accent-500 {
  background: #8f5bf0 !important;
  border-color: #8f5bf0 !important;
  color: #fff !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}

html.dark .input {
  background: #2b203c !important;
  border: 1px solid #5a426e !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

html.dark .hover-border-gradient {
  animation: none !important;
}

@media (max-width: 1023px) {
  html.dark #root header.glass {
    background: #21182f !important;
    border-bottom: 1px solid #49375f !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 520px) {
  #root > div > div:has(> div.fixed.right-3) > div.relative {
    margin: 40px auto;
  }

  html.light #root > div > div:has(> div.fixed.right-3) .card {
    padding: 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.light .bento-card,
  html.dark .bento-card {
    animation: none !important;
  }
}

/* The subscription is the wallet and the connection desk in one place. */
.victi-subscription-card {
  border-radius: 22px !important;
}

html.light .victi-subscription-card {
  background: #fff !important;
  border: 1px solid #e4dbf3 !important;
  box-shadow: 0 12px 32px rgba(62, 31, 118, .07) !important;
}

html.dark .victi-subscription-card {
  background: #21182f !important;
  border: 1px solid #584076 !important;
  box-shadow: 0 12px 32px rgba(7, 3, 17, .24) !important;
}

.victi-subscription-card::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #9c6ae9;
}

.victi-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px 24px;
  border: 1px solid #dcd0f0;
  border-radius: 18px;
  background: #eee7fc;
  color: #301b55;
}

.victi-wallet--embedded {
  margin: 0 0 24px;
}

html.dark .victi-wallet {
  background: #35234e;
  border-color: #624486;
  color: #fff;
}

.victi-wallet__amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.victi-wallet__label {
  font-size: 12px;
  font-weight: 600;
  opacity: .75;
}

.victi-wallet__amount strong {
  font-family: Outfit, Manrope, system-ui, sans-serif;
  font-size: clamp(27px, 5vw, 39px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.victi-wallet__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.victi-wallet__actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.victi-wallet__primary {
  background: #6939c4;
  color: #fff;
}

.victi-wallet__primary:hover {
  background: #5429ac;
  color: #fff;
}

.victi-wallet__secondary {
  border: 1px solid #bba7e0;
  color: #39215f;
}

html.dark .victi-wallet__secondary {
  border-color: #866baa;
  color: #f5edff;
}

.victi-wallet__actions a:focus-visible {
  outline: 2px solid #a16df0;
  outline-offset: 2px;
}

@media (max-width: 680px) {
  .victi-wallet {
    display: block;
    padding: 19px;
  }

  .victi-wallet__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 17px;
    gap: 8px;
  }

  .victi-wallet__actions a {
    min-width: 0;
    padding: 9px 6px;
    font-size: 12px;
  }

  .victi-subscription-card {
    padding: 22px 19px !important;
  }
}
