:root {
  --bg: #10161d;
  --card: #171f28;
  --border: #263241;
  --text: #e7ecf1;
  --muted: #8b98a6;
  --accent: #4fd1c5;
  --accent-hover: #3fc0b4;
  --danger: #e2725b;
  --success: #6fbf8b;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
}

.sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 24px;
}

.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 4px 0 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 14px;
}

label:first-of-type {
  margin-top: 0;
}

input {
  background: #0d1319;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14.5px;
  padding: 10px 12px;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.18);
}

button[type="submit"], #logout {
  margin-top: 22px;
  background: var(--accent);
  color: #06231f;
  border: none;
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button[type="submit"]:hover, #logout:hover {
  background: var(--accent-hover);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.switch {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 14px 0 0;
}

.success {
  color: var(--success);
  font-size: 13px;
  margin: 14px 0 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sso-link {
  display: block;
  text-align: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  text-decoration: none;
}

.sso-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.view[hidden] {
  display: none;
}

#session-uid {
  color: var(--text);
}

/* Visible keyboard focus for buttons/links, respecting the app's own styling above */
button:focus-visible, .link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}