.auth-overlay[hidden], .auth-overlay [hidden] {
  display: none !important;
}

.auth-overlay {
  z-index: 11000;
  -webkit-overflow-scrolling: touch;
  background: #0b141994;
  justify-content: center;
  align-items: center;
  padding: 24px;
  display: flex;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
}

.auth-modal-open {
  overflow: hidden !important;
}

.auth-dialog {
  --auth-accent: #65c7c5;
  --auth-ink: #102625;
  color: #19252d;
  box-sizing: border-box;
  text-align: left;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #e6ecec;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 30px;
  font-family: Arial, sans-serif;
  overflow-y: auto;
  box-shadow: 0 24px 80px #0003;
}

html[data-project="bitsgap"] .auth-dialog {
  --auth-accent: #3a60e7;
  --auth-ink: #fff;
  font-family: Inter, Arial, sans-serif;
}

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

.auth-top {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  display: flex;
}

.auth-brand {
  letter-spacing: -.8px;
  font-size: 25px;
  font-weight: 700;
}

.auth-top select {
  color: #263c42;
  background: #fff;
  border: 1px solid #dde5e6;
  border-radius: 7px;
  width: 115px;
  max-width: 42%;
  margin-left: auto;
  margin-right: 12px;
  padding: 7px 4px;
  font-size: 12px;
  display: block;
}

.auth-close {
  color: #56646a;
  cursor: pointer;
  background: #f1f4f5;
  border: 0;
  border-radius: 50%;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  font: 27px / 32px Arial, sans-serif;
}

.auth-badge {
  color: #276060;
  background: #eaf7f6;
  border-radius: 5px;
  margin-bottom: 12px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  display: inline-block;
}

.auth-dialog h2 {
  color: #18262c;
  overflow-wrap: break-word;
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.25;
}

.auth-intro {
  color: #6b747d;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  background: #f1f4f5;
  border-radius: 9px;
  margin-bottom: 18px;
  padding: 4px;
  display: flex;
}

.auth-tabs button {
  color: #69747c;
  cursor: pointer;
  overflow-wrap: break-word;
  background: none;
  border: 0;
  border-radius: 6px;
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  font: 600 14px / 1.35 Arial, sans-serif;
}

.auth-tabs button[aria-selected="true"] {
  color: #1b3138;
  background: #fff;
  box-shadow: 0 1px 5px #0c1e2d14;
}

.auth-notice {
  border-left: 3px solid var(--auth-accent);
  color: #425e67;
  background: #f0f8f8;
  margin: 0 0 20px;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.65;
}

.auth-field {
  margin-bottom: 17px;
}

.auth-field label {
  color: #253c44;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  display: block;
}

.auth-field-head {
  justify-content: space-between;
  align-items: flex-start;
  display: flex;
}

.auth-field-head label {
  margin-right: 8px;
}

.auth-field-head button {
  color: #458783;
  text-align: right;
  cursor: pointer;
  background: none;
  border: 0;
  max-width: 70%;
  margin-bottom: 8px;
  padding: 0;
  font: 12px / 1.5 Arial, sans-serif;
}

.auth-field input {
  color: #172a32;
  width: 100%;
  height: 48px;
  box-shadow: none;
  background: #fff;
  border: 1px solid #d5dfe2;
  border-radius: 9px;
  outline: none;
  padding: 11px 13px;
  font: 16px / 24px Arial, sans-serif;
  display: block;
}

.auth-field input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px #5ab4b01f;
}

.auth-field input[aria-invalid="true"] {
  border-color: #ba3d42;
}

.auth-field input::placeholder {
  color: #97a0a6;
}

.auth-error {
  color: #ad343b;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.auth-hint {
  color: #8b949a;
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  color: var(--auth-ink);
  background: var(--auth-accent);
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  margin-top: 6px;
  padding: 12px 16px;
  font: 600 15px / 1.4 Arial, sans-serif;
  display: block;
}

.auth-submit:hover {
  filter: brightness(.97);
}

.auth-result {
  color: #246654;
  background: #eef9f5;
  border: 1px solid #b6ded6;
  border-radius: 8px;
  margin: 16px 0 0;
  padding: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.auth-dialog button:focus, .auth-dialog select:focus {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .auth-overlay {
    padding: 12px;
  }

  .auth-dialog {
    border-radius: 19px;
    max-height: calc(100vh - 24px);
    padding: 22px;
  }

  .auth-dialog h2 {
    font-size: 25px;
  }

  .auth-top {
    margin-bottom: 16px;
  }
}
