:root {
  --overlay-bg: rgba(0, 0, 0, 0);
  --drawer-w: 280px;
}

html,
body {
  margin: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.747);
  color: var(--md-sys-color-on-background);
  font-family: Roboto, Helvetica, Arial, sans-serif;
}

.background {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-blend-mode: darken, luminosity;
  background-color: rgba(0, 0, 0, 0.747);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.paywall {
  display: none;
  height: 100%;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}

.row {
  width: auto;
}

.paywall-title {
  font-size: 1.2em;
  font-weight: 500;
  margin: 0 auto;
  color: #dde3ed;
}

.paywall-description-border {
  min-width: min-content;
  max-width: 100%;
  background-color: rgba(0, 0, 0, 0.298);
  margin: 0 auto;
  border-style: solid;
  border-color: var(--md-sys-color-primary);
  border-radius: 4px;
  padding-top: 10px;
  padding-left: 4px;
  padding-right: 4px;
  padding-bottom: 10px;
}

.paywall-description {
  font-size: 1.2em;
  font-weight: 500;
  white-space: pre-line;
  max-width: 500px;
  max-height: 12em;
  margin: 0 auto;
  color: #dde3ed;
  text-align: center;
  overflow: auto;
}

.paywall-price {
  font-size: 1.2em;
  font-weight: 500;
  margin: 0 auto;
  color: #dde3ed;
}

.button {
  cursor: pointer;
  display: flex;
  margin: 0 auto;
  padding: 10px 16px;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--md-sys-color-primary);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  width: clamp(100px, 60cqi, 300px);
  min-width: fit-content;
  max-width: 100%;
  flex-shrink: 1;
  font-size: inherit;
  margin-top: 10px;
}

.text {
  margin: 0 auto;
  color: #dde3ed;
  font-size: inherit;
}

.content {
  display: none;
}

.carrot-btn {
  position: fixed;
  top: 1.5rem;
  right: 1rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.carrot-btn--hidden {
  display: none;
}
.carrot-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}
.carrot-btn span {
  display: block;
  font-size: 22px;
  color: #fff;
  transform: rotate(180deg); /* carrot pointing left */
  transition: transform 0.25s ease;
}
.drawer.open ~ .carrot-btn span {
  transform: rotate(0deg); /* point right when open */
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: var(--drawer-w);
  background: #fff;
  box-shadow: 0px 0 30px rgba(0, 0, 0, 0);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  z-index: 1002;
}
.drawer.open {
  transform: translateX(0);
}

.drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.drawer header h2 {
  margin: 0;
  font-size: 1rem;
}
.icon-btn {
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}
.icon-btn:hover {
  background: #f3f3f3;
}

.drawer nav {
  padding: 8px;
}
.drawer-title {
  color: black;
}
.menu-item {
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1rem;
}
.menu-item:hover {
  background: #f6f6f6;
}

.loader {
  display: none;
  width: 50px;
  height: 50px;
  border: 5px solid var(--md-sys-color-surface-variant);
  border-top: 5px solid var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.referral-container {
  display: none;
  align-items: center;
  flex-direction: column;
  max-width: 100%;
}

.referral-container label {
  color: var(--md-sys-color-on-surface);
}

.promotion-code-input {
  display: none;
  margin: 0 auto;
  width: clamp(140px, 60cqi, 320px);
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font-size: inherit;
  caret-color: var(--md-sys-color-primary);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.promotion-code-input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
}

.promotion-code-input:focus-visible {
  border-color: var(--md-sys-color-primary);
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}

.referral-select {
  width: auto;
  min-width: fit-content;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: inherit;
}

.referral-select:focus-visible {
  border-color: var(--md-sys-color-primary);
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}

.offline-container {
  display: none;
  height: 100%;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}

.main-loader-container {
  display: none;
  height: 100%;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}

.main-loader {
  width: 50px;
  height: 50px;
  border: 5px solid var(--md-sys-color-surface-variant);
  border-top: 5px solid var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.error-container {
  display: none;
  height: 100%;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}

/* FirebaseUI specific CSS */
.firebaseui-title,
.firebaseui-subtitle,
.firebaseui-text,
.firebaseui-error,
.firebaseui-info-bar {
  color: var(--md-sys-color-background);
}
/* FirebaseUI Terms of service and privacy policy links */
.firebaseui-link {
  color: var(--md-sys-color-primary);
}

/* FirebaseUI action buttons (Next/Cancel) */
.firebaseui-button.mdl-button--raised.mdl-button--colored {
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}
.firebaseui-button.mdl-button--raised.mdl-button--colored:hover {
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
}
/* FirebaseUI cancel button text */
.firebaseui-button.mdl-button {
  color: var(--md-sys-color-background);
}

.firebaseui-textfield.mdl-textfield .mdl-textfield__input {
  color: var(--md-sys-color-background);
}
.firebaseui-textfield.mdl-textfield .mdl-textfield__label {
  color: var(--md-sys-color-background);
}
.firebaseui-textfield.mdl-textfield .mdl-textfield__label:after,
.firebaseui-textfield.mdl-textfield .firebaseui-label::after {
  background-color: var(--md-sys-color-primary);
}

.firebaseui-textfield input:-webkit-autofill,
.firebaseui-textfield input:-webkit-autofill:hover,
.firebaseui-textfield input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px white inset;
  -webkit-text-fill-color: rgba(0, 0, 0, 0.87);
  caret-color: rgba(0, 0, 0, 0.87);
}
