.auth-calm {
  --auth-ink: var(--auth-ink-color);
  --auth-muted: var(--muted);
  --auth-green: var(--accent-dk);
  --auth-line: var(--input-line);
  --auth-paper: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: 'DM Sans', sans-serif;
}

.auth-calm__page {
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 28px max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-calm__page.auth-keyboard-open .auth-calm__title { margin-top: 16px; margin-bottom: 14px; }
.auth-calm__page.auth-keyboard-open .auth-calm__footer { padding-top: 2px; }

.auth-calm__header {
  flex: 0 0 44px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
}

.auth-calm__back,
.auth-calm__spacer {
  width: 44px;
  height: 44px;
}

.auth-calm__back {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  color: var(--auth-muted);
  text-decoration: none;
}

.auth-calm__back:hover { background: var(--back-hover); }
.auth-calm__back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-calm__brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--ink);
  font: 400 25px/1 'Lora', Georgia, serif;
  text-decoration: none;
}

.auth-calm__brand:hover { text-decoration: none; }
.auth-calm__mark { width: 30px; height: 30px; flex: 0 0 30px; }

.auth-calm__title {
  flex: 0 0 auto;
  margin: 40px 0 22px;
  color: var(--auth-ink);
  font: 400 32px/1.2 'Lora', Georgia, serif;
  letter-spacing: -.025em;
}

.auth-calm__form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.auth-calm__fields {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--mic-line) var(--clear);
  padding-bottom: 18px;
}

.auth-calm .field {
  margin: 0 0 16px;
}

.auth-calm .field label {
  display: block;
  margin: 0 0 7px;
  color: var(--auth-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.auth-calm input[type="text"],
.auth-calm input[type="email"],
.auth-calm input[type="password"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--auth-line);
  border-radius: 16px;
  outline: none;
  background: var(--paper);
  color: var(--auth-ink);
  font: 400 17px/1 'DM Sans', sans-serif;
  box-shadow: none;
  appearance: none;
  transition: border-color .16s ease;
}

.auth-calm input:focus {
  border-color: var(--auth-green);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.auth-calm input::placeholder { color: var(--auth-placeholder); opacity: 1; }

.auth-calm__reveal {
  display: block;
  min-height: 44px;
  margin: -3px 0 4px;
  padding: 0;
  border: 0;
  background: var(--clear);
  color: var(--auth-green);
  font: 500 15px/1.4 'DM Sans', sans-serif;
  text-align: left;
  cursor: pointer;
}

.auth-calm__reveal:hover,
.auth-calm__forgot a:hover,
.auth-calm__footer a:hover { text-decoration: underline; }

.auth-calm__fields #access-code-field[hidden] { display: none !important; }

.auth-calm__forgot {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -7px;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-calm__forgot a,
.auth-calm__footer a {
  color: var(--auth-green);
  text-decoration: none;
}

.auth-calm__footer {
  flex: 0 0 auto;
  padding-top: 8px;
  padding-bottom: 0;
  background: var(--auth-paper);
}

.auth-calm .alert.alert-error {
  display: none;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--clear);
  color: var(--error-copy);
  font: 400 14px/1.45 'DM Sans', sans-serif;
  overflow-wrap: anywhere;
}

.auth-calm .alert.alert-error.show { display: block; }

.auth-calm #submit-btn,
.auth-calm .btn.btn-primary {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 20px;
  background: var(--button-green);
  color: var(--on-action);
  font: 500 18px/1.2 'Lora', Georgia, serif;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .16s ease, transform .16s ease;
}

.auth-calm #submit-btn:hover { background: var(--auth-button-hover); }
.auth-calm #submit-btn:active { transform: scale(.99); }
.auth-calm #submit-btn:disabled { opacity: .58; cursor: wait; }

.auth-calm__consent {
  margin: 12px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.auth-calm__switch {
  margin: 14px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.auth-calm__language {
  margin: 7px 0 0;
  text-align: center;
}

.auth-calm__language button {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: var(--clear);
  color: var(--auth-muted);
  font: 400 12px/1.4 'DM Sans', sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

.auth-calm__back:focus-visible,
.auth-calm__brand:focus-visible,
.auth-calm__reveal:focus-visible,
.auth-calm__language button:focus-visible,
.auth-calm__footer a:focus-visible,
.auth-calm__forgot a:focus-visible,
.auth-calm #submit-btn:focus-visible {
  outline: 2px solid var(--auth-green);
  outline-offset: 3px;
}

@media (max-height: 620px) {
  .auth-calm__title { margin-top: 22px; margin-bottom: 15px; }
  .auth-calm__footer { padding-top: 2px; }
  .auth-calm__consent { margin-top: 8px; }
  .auth-calm__switch { margin-top: 8px; }
  .auth-calm__language { margin-top: 2px; }
}

@media (max-width: 360px) {
  .auth-calm__page { padding-left: 22px; padding-right: 22px; }
  .auth-calm__title { font-size: 30px; }
}
