:root {
  --brand-primary: #6c63ff;
  --brand-primary-rgb: 108, 99, 255;
  --brand-primary-2: #8b5cf6;
  --brand-primary-2-rgb: 139, 92, 246;
  --brand-glow: rgba(138, 99, 255, 0.3);
  --brand-glow-strong: rgba(78, 56, 194, 0.35);
  --brand-shadow: rgba(14, 18, 40, 0.28);
  --brand-shadow-strong: rgba(14, 18, 40, 0.35);
  --brand-surface: rgba(255, 255, 255, 0.03);
  --brand-border: rgba(255, 255, 255, 0.06);
  --text-bright: #ffffff;
  --text-dim: #9aa4b2;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-2));
  --brand-gradient-soft: linear-gradient(135deg, rgba(131, 108, 255, 0.2), rgba(152, 114, 255, 0.14));
  --brand-focus-outline: 0 0 0 1px var(--brand-border), 0 0 0 4px rgba(138, 99, 255, 0.25);
}

.button-primary,
.btn-primary,
.primary-button,
[data-theme-button="primary"],
button.primary,
button[data-variant="primary"] {
  background: rgba(113, 97, 255, 0.12);
  border: 1px solid rgba(113, 97, 255, 0.35);
  color: #e2e3f0;
  box-shadow: 0 16px 20px rgba(14, 18, 40, 0.45),
    0 0 20px rgba(138, 99, 255, 0.11);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

.button-primary:hover,
.btn-primary:hover,
.primary-button:hover,
[data-theme-button="primary"]:hover,
button.primary:hover,
button[data-variant="primary"]:hover {
  background: rgba(113, 97, 255, 0.2);
  border-color: rgba(113, 97, 255, 0.5);
  color: #f4f5ff;
  box-shadow: 0 16px 20px rgba(14, 18, 40, 0.45),
    0 0 20px rgba(138, 99, 255, 0.11);
  transform: translateY(-1px);
}

.button-secondary,
.btn-secondary,
.secondary-button,
button.secondary,
button[data-variant="secondary"],
.pill,
.tab,
.tab-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e3f0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

.button-secondary:hover,
.btn-secondary:hover,
.secondary-button:hover,
button.secondary:hover,
button[data-variant="secondary"]:hover,
.pill:hover,
.tab:hover,
.tab-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4f5ff;
}

.button-secondary.active,
.btn-secondary.active,
.secondary-button.active,
button.secondary[aria-pressed="true"],
.pill.active,
.tab.active,
.tab-pill.is-active {
  background: var(--brand-gradient);
  color: var(--text-bright);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 16px var(--brand-glow);
}

input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb,
input[type="range"]::-ms-thumb {
  background: var(--brand-primary);
}

input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-track,
input[type="range"]::-ms-track {
  background: linear-gradient(
    90deg,
    var(--brand-primary) var(--progress, 50%),
    rgba(255, 255, 255, 0.08) var(--progress, 50%)
  );
}

.toggle-switch.is-active,
.toggle-switch input:checked + .toggle-track,
.toggle.is-on,
.switch input:checked + .switch-track {
  background: var(--brand-gradient);
  box-shadow: inset 0 0 0 1px var(--brand-border), 0 0 12px var(--brand-glow);
}

.toggle-switch input:focus-visible + .toggle-track,
.switch input:focus-visible + .switch-track,
button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: var(--brand-focus-outline);
}

.app-banner-slot {
  margin-bottom: 24px;
}

.app-banner-slot:empty {
  margin-bottom: 0;
}

.app-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e3e3f0;
  box-shadow: 0 18px 40px rgba(5, 6, 12, 0.45);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.app-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-banner.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.app-banner__message {
  flex: 1 1 auto;
  min-width: 200px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.app-banner__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-banner__button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
}

.app-banner__button:focus-visible {
  outline: none;
  box-shadow: var(--brand-focus-outline);
}

.app-banner__button--primary {
  background: rgba(113, 97, 255, 0.18);
  border-color: rgba(113, 97, 255, 0.45);
  color: #f4f5ff;
}

.app-banner__button--primary:hover,
.app-banner__button--primary:focus-visible {
  background: rgba(113, 97, 255, 0.26);
  border-color: rgba(113, 97, 255, 0.65);
  transform: translateY(-1px);
}

.app-banner__button--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
  color: #e2e3f0;
}

.app-banner__button--ghost:hover,
.app-banner__button--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.app-banner.is-past_due {
  background: rgba(255, 193, 7, 0.12);
  border-color: #ffc107;
  color: #e3e3e8;
}

.app-banner.is-cancel {
  background: rgba(158, 158, 158, 0.1);
  border-color: #9e9e9e;
  color: #e1e1e7;
}

.app-banner.is-trial {
  background: rgba(113, 92, 255, 0.12);
  border-color: #715cff;
  color: #e1e0ff;
}

.cookie-bar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(423px, calc(100% - 32px));
  padding: 18px 20px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 30, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 12px rgba(113, 92, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 90;
}

.cookie-bar.hidden {
  display: none;
}

.cookie-bar.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.cookie-bar__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cookie-bar__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #f3f4ff;
}

.cookie-bar__message {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(207, 209, 219, 0.9);
}

.cookie-bar__link {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #715cff;
  text-decoration: none;
  width: fit-content;
}

.cookie-bar__link:hover,
.cookie-bar__link:focus-visible {
  text-decoration: underline;
  color: #9c8bff;
}

.cookie-bar__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 6px;
}

.cookie-bar__actions button {
  white-space: nowrap;
  min-height: 36px;
}

.cookie-bar__manage.ghost-action,
.cookie-bar__reject.ghost-action {
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: auto;
}

.cookie-bar__reject.ghost-action {
  border-color: rgba(255, 108, 108, 0.45);
  color: #ffb0b0;
  background: rgba(255, 108, 108, 0.08);
}

.cookie-bar__reject.ghost-action:hover,
.cookie-bar__reject.ghost-action:focus-visible {
  border-color: rgba(255, 108, 108, 0.65);
  color: #ffd2d2;
  background: rgba(255, 108, 108, 0.12);
}

.cookie-bar__accept.btn-primary {
  padding: 10px 22px;
  min-width: 112px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 95;
}

.cookie-modal.open {
  display: flex;
}

.cookie-modal.hidden {
  display: none !important;
}

.cookie-modal__card {
  background: rgba(18, 20, 31, 0.92);
  border-radius: 20px;
  padding: 28px 30px;
  width: min(360px, calc(100% - 48px));
  border: 1px solid rgba(113, 97, 255, 0.14);
  box-shadow: 0 26px 64px rgba(7, 8, 20, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f5f7ff;
}

.cookie-modal__close {
  background: rgba(113, 97, 255, 0.1);
  border: 1px solid rgba(113, 97, 255, 0.2);
  color: rgba(245, 247, 255, 0.72);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  align-self: flex-end;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cookie-modal__close:hover,
.cookie-modal__close:focus-visible {
  background: rgba(113, 97, 255, 0.22);
  border-color: rgba(113, 97, 255, 0.4);
  transform: translateY(-1px);
}

.cookie-modal__title {
  margin: 12px 0 6px;
  font-size: 20px;
}

.cookie-modal__description {
  margin: 0 0 16px;
  color: rgba(245, 247, 255, 0.64);
  font-size: 14px;
  line-height: 1.5;
}

.cookie-modal__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-toggle:last-of-type {
  border-bottom: none;
}

.cookie-toggle__copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.cookie-toggle__copy p {
  margin: 0;
  font-size: 12px;
  color: rgba(245, 247, 255, 0.6);
}

.cookie-toggle__switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
}

.cookie-toggle__switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle__track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.cookie-toggle__track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f5ff;
  top: 3px;
  left: 4px;
  transition: transform 0.2s ease;
}

.cookie-toggle__switch input:checked + .cookie-toggle__track {
  background: rgba(113, 97, 255, 0.55);
}

.cookie-toggle__switch input:checked + .cookie-toggle__track::after {
  transform: translateX(20px);
}

.cookie-toggle__switch input:disabled + .cookie-toggle__track {
  opacity: 0.45;
}

.cookie-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.cookie-modal__primary,
.cookie-modal__secondary {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.cookie-modal__primary.btn-primary {
  padding: 11px 22px;
}

.cookie-modal__secondary.ghost-action {
  padding: 10px 18px;
}

@media (max-width: 720px) {
  .app-banner {
    align-items: flex-start;
  }

  .app-banner__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .cookie-bar {
    right: 16px;
    left: 16px;
    bottom: 12px;
    width: auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cookie-bar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-bar__actions button {
    flex: 1 1 auto;
    justify-content: center;
    width: 100%;
  }
}
