/* Light theme with a soft gradient background and one centered card */
:root {
  --text: #1e293b;
  --muted: #64748b;
  --primary: #4338ca;
  --primary-dark: #3730a3;
  --line: #cbd5e1;
  --error: #b91c1c;
  --ok: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #e0e7ff, #fdf2f8 60%, #ecfeff);
}

.card {
  width: min(400px, 100%);
  padding: 2rem;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(30, 41, 59, 0.12);
}

.brand {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 1.7rem;
}

.subtitle {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
}

.form {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 1rem;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

/* :user-invalid only turns red after the user has typed, not on page load */
input:user-invalid {
  border-color: var(--error);
}

.password-row {
  display: flex;
  gap: 0.5rem;
}

.password-row input {
  flex: 1;
  margin-bottom: 0;
}

.toggle {
  padding: 0 0.9rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.hint {
  margin: 0.35rem 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  margin: 0;
}

.link {
  color: var(--primary);
  font-size: 0.9rem;
}

.submit {
  padding: 0.8rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.submit:hover {
  background: var(--primary-dark);
}

.message {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  color: var(--ok);
  font-size: 0.9rem;
}

.signup {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .submit {
    transition: none;
  }
}
