/* login.css — pàgina d'autenticació (email + codi). */

.topbar {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg-0) 70%, transparent);
}

.auth {
  flex: 1;
  display: grid;
  /* Anclat al terç superior, no centrat verticalment. */
  place-items: start center;
  padding: var(--space-7) var(--space-3) var(--space-5);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  animation: fade-rise 280ms var(--ease) both;
}
.auth-form[hidden] { display: none; }

.auth-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-1);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  text-wrap: balance;
}

.auth-sub {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 var(--space-1);
  text-wrap: pretty;
}
.auth-sub strong {
  color: var(--text-1);
  font-weight: 500;
}

.auth-input {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  color: var(--text-1);
  font-size: 1rem;
  outline: none;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input:hover { background: var(--bg-2); }
.auth-input:focus {
  background: var(--bg-2);
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 1px;
}

.auth-input--code {
  font-family: var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 1.4rem;
  padding: 16px;
}

.auth-button {
  background: var(--text-1);
  color: var(--bg-0);
  font-weight: 500;
  font-size: 1rem;
  padding: 13px 20px;
  border-radius: var(--r-md);
  /* Respiració extra entre input i botó. */
  margin-top: var(--space-3);
  transition:
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
.auth-button:hover { background: var(--text-0); }
.auth-button:active { transform: scale(0.985); }
.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-link {
  color: var(--text-2);
  font-size: 0.85rem;
  padding: 8px;
  margin: 0 auto;
  text-align: center;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.auth-link:hover:not(:disabled) { color: var(--text-1); }
.auth-link:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error {
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  padding: 4px 2px;
}
.auth-error[hidden] { display: none; }
.auth-error--ok { color: var(--text-2); }

@media (max-width: 640px) {
  .auth { padding: var(--space-5) var(--space-2) var(--space-3); }
  .auth-title { font-size: 1.6rem; }
  .auth-input--code { font-size: 1.2rem; letter-spacing: 0.3em; }
}
