/* Inter — self-hosted (latin, woff2) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-v20-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-v20-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-v20-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-v20-latin-700.woff2") format("woff2");
}

:root {
  --background: #f4f5f2;
  --surface: #ffffff;
  --surface-subtle: #f7f8f6;
  --text: #181b19;
  --muted: #646a66;
  --line: #dfe3df;
  --line-strong: #c9cfca;
  --brand: #005032;
  --brand-hover: #003f28;
  --focus: rgba(0, 80, 50, 0.16);
  --success-bg: #edf8f1;
  --success-text: #17653b;
  --error-bg: #fff1f0;
  --error-text: #a63830;
  --shadow: 0 20px 55px rgba(22, 31, 26, 0.08),
    0 2px 8px rgba(22, 31, 26, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(0, 80, 50, 0.09), transparent 38rem),
    var(--background);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.auth-shell {
  width: min(100%, 31rem);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vh, 3.5rem) 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-shell--narrow {
  width: min(100%, 28.5rem);
  padding: clamp(1.75rem, 6vh, 4rem) 1.25rem 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.35rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

.brand:focus-visible,
.legal a:focus-visible,
.text-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.brand img {
  display: block;
  width: 8.5rem;
  height: auto;
}

.auth-card {
  width: 100%;
  padding: clamp(1.35rem, 4vw, 1.75rem);
  background: var(--surface);
  border: 1px solid rgba(201, 207, 202, 0.75);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.auth-header {
  margin-bottom: 1.15rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.intro {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.intro strong {
  color: var(--text);
  font-weight: 600;
}

.partner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.15rem;
  padding: 0.7rem;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.partner-mark {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  background: var(--brand);
  border-radius: 0.625rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.partner-mark--logo {
  background: #ffffff;
  border: 1px solid var(--line);
}

.partner-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.partner-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.partner-copy strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-label {
  color: var(--muted);
  font-size: 0.65rem;
}

.auth-form,
.field {
  display: flex;
  flex-direction: column;
}

.auth-form {
  gap: 0.95rem;
}

.field {
  gap: 0.4rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.62rem 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0.625rem;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder {
  color: #919793;
}

input:hover {
  border-color: #aeb6b0;
}

input:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.45;
}

button {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.62rem 0.875rem;
  color: #ffffff;
  background: var(--brand);
  border: 0;
  border-radius: 0.625rem;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

button:hover {
  background: var(--brand-hover);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.actions button {
  flex: 1 1 8.75rem;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  background: #eef0ed;
}

.federated-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-federated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.62rem 0.875rem;
  font-size: 0.88rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0.625rem;
  transition: background 150ms ease, border-color 150ms ease;
}

.btn-federated:hover {
  background: var(--surface-subtle);
  border-color: #aeb6b0;
}

.btn-federated:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn-federated__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.btn-federated--ms {
  color: #ffffff;
  background: #2f2f2f;
  border-color: #2f2f2f;
}

.btn-federated--ms:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.notice {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.76rem;
  line-height: 1.5;
}

.notice strong {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 650;
}

.notice--success {
  color: var(--success-text);
  background: var(--success-bg);
}

.notice--error {
  color: var(--error-text);
  background: var(--error-bg);
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.account {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 150ms ease, background 150ms ease;
}

.account:hover {
  border-color: var(--brand);
  background: var(--success-bg);
}

.account strong {
  display: block;
  font-weight: 650;
}

.account span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.text-link {
  color: var(--text);
  font-size: 0.86rem;
  text-underline-offset: 0.18em;
}

.auth-footer-link {
  margin-top: 0.75rem;
  text-align: center;
}

.legal {
  margin: 1rem 0 0;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
}

.legal a {
  color: var(--text);
  text-underline-offset: 0.18em;
}

.form-note {
  margin: -0.15rem 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 36rem) {
  .auth-shell {
    justify-content: flex-start;
    padding: 1.6rem 0.875rem 1.25rem;
  }

  .brand {
    margin-bottom: 1.2rem;
  }

  .auth-card {
    border-radius: 0.875rem;
    box-shadow: 0 12px 36px rgba(22, 31, 26, 0.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
