/* Account entry uses the public site's paper, forest and lime palette. */
html[data-theme] #authGate {
  --auth-paper: #fbfdf8;
  --auth-ink: #16351d;
  --auth-muted: #566851;
  --auth-line: #dce6d9;
  --auth-lime: #bcf146;
  --text: var(--auth-ink);
  --text-secondary: var(--auth-muted);
  --text-muted: var(--auth-muted);
  --accent: var(--auth-ink);
  --accent-border: #8aa17e;
  --lime: var(--auth-lime);
  --surface: #fff;
  --border: var(--auth-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 20px;
  background: #edf3e8;
  color: var(--auth-ink);
  font-family: var(--sans, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
  scrollbar-color: #93a58a transparent;
  scrollbar-width: thin;
}

html[data-theme] #authGate.public-auth-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgb(15 36 19 / 55%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Keep the modal as the only scroll surface while account entry is open. */
html[data-theme]:has(#authGate.public-auth-modal:not(.hidden):not([hidden])),
html[data-theme] body:has(#authGate.public-auth-modal:not(.hidden):not([hidden])) {
  overflow: hidden;
  scrollbar-gutter: auto;
}

html[data-theme] #authGate.hidden,
html[data-theme] #authGate .hidden,
html[data-theme] #authGate [hidden] {
  display: none !important;
}

html[data-theme] #authGate,
html[data-theme] #authGate * {
  box-sizing: border-box;
}

html[data-theme] #authGate .auth-card {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin: auto 0;
  padding: 32px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  box-shadow: 0 24px 72px rgb(15 36 19 / 18%);
  text-align: left;
  overflow-wrap: anywhere;
}

html[data-theme] #authGate .auth-card > .eyebrow {
  display: none;
}

html[data-theme] #authGate .vayro-app-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 0 24px;
  border-radius: 14px;
  object-fit: contain;
  filter: none;
  box-shadow: none;
}

html[data-theme] #authGate .auth-card h1 {
  max-width: 100%;
  margin: 0 0 10px;
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}

html[data-theme] #authGate .auth-copy {
  max-width: 100%;
  margin: 0 0 24px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}

html[data-theme] #authGate .auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  text-align: left;
}

html[data-theme] #authGate .auth-form label {
  margin: 0;
  color: var(--auth-ink);
  font: 550 13px/1.4 var(--sans, sans-serif);
  letter-spacing: 0;
  text-transform: none;
}

html[data-theme] #authGate .auth-form input + label {
  margin-top: 12px;
}

html[data-theme] #authGate .auth-form input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #a8b8a0;
  border-radius: 10px;
  background: #fff !important;
  color: var(--auth-ink) !important;
  font: 400 15px/1.4 var(--sans, sans-serif);
  letter-spacing: 0;
  caret-color: var(--auth-ink);
  box-shadow: none;
  outline: none;
  color-scheme: light;
}

html[data-theme] #authGate .auth-form input::placeholder {
  color: #657363;
  opacity: 1;
}

html[data-theme] #authGate .auth-form input:focus {
  border-color: var(--auth-ink);
  outline: 2px solid var(--auth-ink);
  outline-offset: 2px;
  box-shadow: none;
}

html[data-theme] #authGate .auth-form input:disabled {
  background: #edf3e8 !important;
  color: var(--auth-muted) !important;
  cursor: not-allowed;
}

html[data-theme] #authGate .auth-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--auth-ink);
  box-shadow: inset 0 0 0 100px #fff;
  caret-color: var(--auth-ink);
}

html[data-theme] #authGate :is(button, a) {
  max-width: 100%;
  font-family: var(--sans, sans-serif);
  cursor: pointer;
}

html[data-theme] #authGate .button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
}

html[data-theme] #authGate .auth-submit {
  margin: 16px 0 0;
  border-color: var(--auth-lime);
  background: var(--auth-lime);
  color: var(--auth-ink);
  font-size: 15px;
  font-weight: 650;
}

html[data-theme] #authGate .text-button {
  min-height: 36px;
  padding: 6px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  white-space: normal;
}

html[data-theme] #authGate .auth-mode-toggle {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

html[data-theme] #authGate .auth-assistance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--auth-line);
}

html[data-theme] #authGate .auth-assistance:not(:has(> :not(.hidden):not([hidden]))) {
  display: none;
}

html[data-theme] #authGate .auth-assistance .text-button {
  color: var(--auth-muted);
  font-size: 13px;
  text-decoration: underline;
  text-align: center;
}

html[data-theme] #authGate .auth-note {
  display: block;
  margin: 16px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

html[data-theme] #authGate .auth-message {
  min-height: 0;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #efd3cc;
  border-radius: 10px;
  background: #fff1ec;
  color: #922f23;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: anywhere;
}

html[data-theme] #authGate .auth-message[data-kind='success'] {
  border-color: #cadfc1;
  background: #ecf5e6;
  color: #2c5a27;
}

html[data-theme] #authGate :is(.auth-message, .auth-note):empty {
  display: none;
}

html[data-theme] #authGate :is(.auth-download, #authRetry, #googleSignIn) {
  margin-top: 16px;
}

html[data-theme] #authGate .auth-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--auth-muted);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

html[data-theme] #authGate :is(button, a):focus-visible {
  outline: 2px solid var(--auth-ink);
  outline-offset: 3px;
}

html[data-theme] #authGate :is(button, .button):disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

html[data-theme] #authGate ::selection {
  background: var(--auth-lime);
  color: var(--auth-ink);
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme] #authGate .auth-submit:not(:disabled):hover {
    border-color: #afe335;
    background: #afe335;
  }

  html[data-theme] #authGate .button:not(.auth-submit):not(:disabled):hover {
    border-color: #a8b8a0;
    background: #edf3e8;
  }

  html[data-theme] #authGate .text-button:not(:disabled):hover {
    color: var(--auth-ink);
    text-decoration: underline;
  }

  html[data-theme] #authGate .auth-close:hover {
    border-color: var(--auth-line);
    background: #edf3e8;
    color: var(--auth-ink);
  }
}

@media (max-width: 480px) {
  html[data-theme] #authGate {
    padding: 16px;
  }

  html[data-theme] #authGate .auth-card {
    padding: 28px 24px;
    border-radius: 20px;
  }

  html[data-theme] #authGate .auth-card h1 {
    font-size: 26px;
  }

  html[data-theme] #authGate .auth-form input {
    font-size: 16px;
  }

  html[data-theme] #authGate .auth-close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 360px) {
  html[data-theme] #authGate .auth-card {
    padding: 24px 20px;
  }

  html[data-theme] #authGate .auth-card h1 {
    font-size: 25px;
  }
}

@media (forced-colors: active) {
  html[data-theme] #authGate :is(.auth-card, input, .button) {
    border-color: CanvasText;
  }
}
