/* Sign-in by an e-mail code (features/signin.js): a card on the canvas where
   «Это Петля» stands; on a phone a sheet over the toolbar that sits on the
   keyboard. docs/features/signin.md */
.signin {
  --signin-error: #a64f46;
  --signin-soft: #4c5a50;
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 27;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 180px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(48, 61, 52, 0.16);
  color: var(--ink);
  font-family: 'Golos Text', sans-serif;
}
.signin [hidden],
.signin[hidden] {
  display: none !important;
}
/* While the card is open «Это Петля» and «Как вам Петля?» wait under it. */
.signin-open .welcome-card {
  display: none;
}
.signin-grip {
  display: none;
  width: 36px;
  height: 4px;
  margin: -8px auto 10px;
  border-radius: 9px;
  background: #d8dbd0;
}
.signin-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.signin-head h2 {
  display: block;
  flex: 1;
  margin: 0;
  font:
    700 19px/1.3 Manrope,
    sans-serif;
}
.signin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
}
.signin-icon:hover {
  background: #edf0e6;
}
.signin-back {
  margin-inline-start: -8px;
}
.signin-x {
  margin-inline-end: -8px;
}
.signin-icon svg {
  width: 20px;
  height: 20px;
}
.signin-step {
  display: grid;
  gap: 12px;
}
.signin-step p {
  margin: 0;
}
.signin-why {
  font-size: 14px;
  line-height: 1.45;
  color: var(--signin-soft);
}
.signin label {
  margin: 2px 0 -6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.signin #signinEmail {
  min-height: 46px;
  padding: 0 14px;
  border: 1.5px solid #d9dccf;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
}
.signin #signinEmail:focus {
  outline: 0;
  border-color: var(--green);
  box-shadow: 0 0 0 3px #e3ebdd;
}
.signin-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.signin-main:disabled {
  opacity: 0.45;
}
.signin-dim {
  opacity: 0.45;
}
.signin-link {
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.signin-note,
.signin-foot,
.signin-legal {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.signin-foot .signin-link {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.signin-legal {
  display: flex;
  gap: 6px;
  font-size: 12px;
}
.signin-legal a {
  color: var(--muted);
}
.signin-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
}
.signin-muted {
  color: #aab0a6;
}
.signin-error {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--signin-error);
}
.signin-sent {
  font-size: 14px;
  line-height: 1.5;
  color: var(--signin-soft);
}
.signin-sent i {
  margin-inline-end: 6px;
  vertical-align: -3px;
  color: var(--green);
}
.signin-sent i svg {
  width: 16px;
  height: 16px;
}
.signin-sent b {
  color: var(--ink);
  font-weight: 600;
  word-break: break-all;
}
/* Six cells drawn under one real input, so the keyboard offers the code from
   the letter (autocomplete="one-time-code") and a paste works. */
.signin-code {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.signin-code-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
}
.signin-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 50px;
  height: 54px;
  border: 1.5px solid #d9dccf;
  border-radius: 10px;
  background: #fff;
  font:
    600 24px 'Golos Text',
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.signin-gap {
  flex: 0 0 4px;
}
.signin-cur {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #e3ebdd;
}
.signin-bad .signin-cell {
  border-color: var(--signin-error);
  background: #fcf4f2;
  color: var(--signin-error);
}
.signin-hint,
.signin-warn {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.signin-hint {
  background: #eef3ea;
  color: var(--signin-soft);
}
.signin-hint b {
  color: var(--ink);
}
.signin-hint > b {
  font-size: 14px;
}
.signin-hint p {
  margin: 0;
}
.signin-warn {
  background: #f8efe9;
  color: #6e5149;
}
.signin-warn > b {
  font-size: 14px;
  color: var(--signin-error);
}
@media (max-width: 700px) {
  .signin {
    left: 8px;
    right: 8px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    padding: 18px 16px;
    border-radius: 18px;
    box-shadow: 0 -6px 30px rgba(48, 61, 52, 0.14);
  }
  .signin-grip {
    display: block;
  }
  /* The keyboard is open: the sheet stands right on it (--signin-lift is its height). */
  .signin-kb {
    bottom: var(--signin-lift, 0);
    padding: 14px 16px 12px;
    border-radius: 18px 18px 0 0;
  }
  .signin-kb .signin-grip {
    margin-top: -4px;
  }
  /* A small screen with the keyboard: the explaining line gives way. */
  .signin-tight .signin-why,
  .signin-tight .signin-legal {
    display: none;
  }
}
