/* Shared layout for the global pages (login, signup). One card width and one
   field width, so the forms line up on both pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.auth-card {
  box-sizing: border-box;
  width: min(400px, calc(100% - 32px));
  margin: 2rem auto;
  padding: 1.4rem 1.6rem;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.auth-card h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Without this, the hidden attribute loses to the rule above (same specificity,
   this one declared later), so a hidden .auth-field would still render as flex. */
.auth-field[hidden] {
  display: none;
}

.auth-field label {
  font-weight: 600;
}

/* style.css only styles input[type=text] (and number/select), so the email and
   password fields need the same look set here explicitly. */
.auth-field input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 0.6rem;
  font-size: 1rem;
  color: #000000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.auth-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 1rem;
  font-family: inherit;
  color: #000000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}

.auth-field .hint {
  font-size: 0.85rem;
  min-height: 1.1em;
}

.auth-form button {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  font-size: 1rem;
}

.auth-form .msg,
.auth-card .footnote {
  margin: 0;
  font-size: 0.9rem;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
/* Without this, the hidden attribute loses to the display:flex rule above (same
   specificity, this one declared later) - see the identical fix on .auth-field. */
.spinner-overlay[hidden] {
  display: none;
}
.spinner-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  color: #000000;
  font-size: 1.15rem;
  font-weight: 600;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.spinner-lg {
  width: 64px;
  height: 64px;
  border-width: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
