/* Accesso e registrazione: a sinistra il gemello che prende forma, a destra una domanda alla volta. */

.auth-body {
  background: var(--paper);
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100svh;
}

.auth__twin {
  position: sticky;
  top: 0;
  height: 100svh;
  background: var(--ink);
  overflow: hidden;
}

.auth__twin canvas {
  position: absolute;
  inset: 8% 0 0;
  width: 100%;
  height: 92%;
}

.auth__speech {
  position: absolute;
  z-index: 2;
  left: clamp(24px, 4vw, 56px);
  top: clamp(28px, 6vh, 64px);
  right: clamp(24px, 4vw, 56px);
  color: #fff;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  min-height: 2.3em;
}

.auth__speech span {
  display: inline-block;
  animation: word-in 0.6s var(--ease-out) backwards;
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
}

.auth__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px clamp(24px, 6vw, 96px) 48px;
}

.auth__logo {
  position: absolute;
  top: 26px;
  left: clamp(24px, 6vw, 96px);
}

.asks {
  width: 100%;
  max-width: 560px;
}

.asks__rail {
  display: flex;
  gap: 6px;
  margin-bottom: clamp(32px, 7vh, 64px);
}

.asks__rail i {
  width: 34px;
  height: 4px;
  border-radius: 4px;
  background: var(--paper-3);
  transition: background 0.5s;
}

.asks__rail i.is-on {
  background: var(--violet);
}

.ask {
  display: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ask.is-active {
  display: block;
  animation: ask-in 0.8s var(--ease-out);
}

.ask.is-back {
  animation-name: ask-back;
}

@keyframes ask-in {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}

@keyframes ask-back {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
}

.ask__q {
  display: block;
  font-size: clamp(2.5rem, 4.8vw, 4.3rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.ask__q em {
  font-size: 1.07em;
}

.ask__input {
  width: 100%;
  margin-top: 26px;
  padding: 12px 0;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: none;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  letter-spacing: -0.015em;
  outline: none;
  transition: border-color 0.3s;
}

.ask__input::placeholder {
  color: #bdbdc4;
}

.ask__input:focus {
  border-bottom-color: var(--violet);
}

.ask__hint {
  margin-top: 12px;
  color: var(--muted);
}

.ask__password {
  position: relative;
}

.ask__password .ask__input {
  padding-right: 88px;
}

.ask__show {
  position: absolute;
  right: 0;
  bottom: 18px;
  font-size: 15px;
  color: var(--muted);
}

.ask__show:hover {
  color: var(--ink);
}

.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 12px;
}

.meter i {
  height: 4px;
  border-radius: 4px;
  background: var(--paper-3);
  transition: background 0.35s;
}

.meter[data-level="1"] i:nth-child(-n + 1) {
  background: var(--danger);
}

.meter[data-level="2"] i:nth-child(-n + 2) {
  background: #e8a31a;
}

.meter[data-level="3"] i:nth-child(-n + 3),
.meter[data-level="4"] i {
  background: var(--violet);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 2px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.check input:checked {
  border-color: var(--violet);
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5l3.4 3.4L15 7'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.check a {
  color: var(--ink);
  text-decoration: underline;
}

.asks__error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 16px;
}

.asks__error a {
  text-decoration: underline;
}

.asks__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(24px, 5vh, 40px);
}

.asks__back {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 20px;
  transition: box-shadow 0.2s;
}

.asks__back:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.asks__alt {
  margin-top: 26px;
  color: var(--muted);
}

.asks__alt a {
  color: var(--ink);
  text-decoration: underline;
}

.form {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 440px;
}

.form__title {
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin-bottom: 8px;
}

.form__title em {
  font-size: 1.07em;
}

.form__lead {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 15px;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--violet);
}

@media (max-width: 860px) {
  .auth {
    display: flex;
    flex-direction: column;
    height: 100svh;
    min-height: 0;
  }

  .auth__twin {
    position: relative;
    flex: none;
    height: 25svh;
    min-height: 150px;
  }

  .auth__twin canvas {
    inset: 0;
    height: 100%;
  }

  .auth__speech {
    top: auto;
    bottom: 18px;
    left: 20px;
    right: 42%;
    min-height: 0;
    font-size: 1.45rem;
  }

  .auth__panel {
    flex: 1;
    justify-content: flex-start;
    padding: 66px 20px 24px;
    overflow-y: auto;
  }

  .auth__logo {
    top: 18px;
    left: 20px;
  }

  .asks__rail {
    margin-bottom: 22px;
  }
}
