/* PartSource — auth SPA styles (leptos, mounted at /app/auth/*).
   Same slate/green tokens as the backend's main.css. */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --dark: #0f172a;
  --text: #0f172a;
  --muted: #64748b;
  --light: #f1f5f9;
  --border: #e2e8f0;
  --green: #22c55e;
  --green-soft: #dcfce7;
  --green-dark: #15803d;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 30px rgb(15 23 42 / 0.08);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(80% 60% at 85% -10%, rgb(34 197 94 / 0.09) 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
p {
  margin: 0;
}

/* ----- layout ----- */

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.auth__card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.auth__logo {
  margin-bottom: 0.25rem;
}

.auth__logo a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.auth__logo a::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2322C55E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3'/%3E%3C/svg%3E");
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
}

.auth__title {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth__subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ----- form ----- */

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

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

.auth__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.auth__input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth__input:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(34 197 94 / 0.18);
}

.auth__btn {
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.auth__btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.auth__btn__green {
  background: var(--green);
  color: #052e16;
}

.auth__btn__green:hover:not(:disabled) {
  background: #16a34a;
}

.auth__btn__blue {
  background: #2563eb;
  color: #fff;
}

.auth__btn__blue:hover:not(:disabled) {
  background: #1d4ed8;
}

/* ----- role toggle ----- */

.auth__roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.auth__role {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth__role:hover {
  border-color: var(--muted);
}

.auth__role--active {
  border-color: var(--green);
  background: var(--green-soft);
}

.auth__role-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.auth__role-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ----- status / links ----- */

.auth__status {
  font-size: 0.86rem;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.auth__status__success {
  background: var(--green-soft);
  color: var(--green-dark);
}

.auth__status__error {
  background: var(--danger-soft);
  color: #b91c1c;
}

.auth__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.auth__link {
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 500;
}

.auth__link:hover {
  text-decoration: underline;
}

.auth__link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-dark);
  cursor: pointer;
}

.auth__link-btn:hover {
  text-decoration: underline;
}

.auth__link-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.auth__alt {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.auth__resend-note {
  font-size: 0.82rem;
  color: var(--green-dark);
}

@media (max-width: 480px) {
  .auth__card {
    padding: 1.4rem;
  }
}
