/* The form is about 420px wide (main less its side padding), centred, with room above it: a quiet,
   confident page, anchored to the top so the card never shifts between the sign-in, forgot and reset
   panels. */
main {
  max-width: 460px;
  margin: 0 auto;
  /* The top padding clears the fixed .site-nav. */
  padding: clamp(5.5rem, 14vh, 9rem) 1.25rem 3rem;
}

/* A short gold rule above the title: a small JWC identity detail. */
h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 7vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

h1::before {
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0 auto 1.1rem;
  background: var(--accent);
  border-radius: 2px;
  content: "";
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.75rem 1.75rem;
}

.panel h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.panel p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

/* 16px minimum: smaller input text makes iOS zoom the page on focus. */
input {
  width: 100%;
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
}

input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.button {
  display: block;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* While busy, the button stays easy to read: the words say what is happening. */
.button.busy:disabled {
  opacity: 0.9;
}

/* A small spinner before the words while a request runs. */
.button.busy::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.6em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Reduced motion: no spinning; the busy words still say what is happening. */
@media (prefers-reduced-motion: reduce) {
  .button.busy::before {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}

@media (hover: hover) {
  .button:not(:disabled):hover {
    background: rgba(216, 179, 106, 0.12);
  }
}

.text-link {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.0625rem;
  text-decoration: underline;
  cursor: pointer;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
}

.message {
  min-height: 1.5rem;
  margin: 0 0 1rem;
  color: var(--muted);
}

.message.error {
  color: var(--error);
}

.hint {
  margin: -0.85rem 0 1.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}
