:root {
  --font-main: 'Manrope', 'Montserrat', sans-serif;
  --ink-900: #f5f5f4;
  --ink-700: #d0d0cc;
  --ink-600: #a3a39d;
  --accent: #f5f5f4;
  --accent-2: #ebebe8;
  --accent-soft: rgba(255, 255, 255, 0.14);
  --surface: rgba(12, 12, 12, 0.9);
  --border: rgba(255, 255, 255, 0.14);
  --control-bg: #f5f5f4;
  --control-bg-hover: #ffffff;
  --control-border: rgba(0, 0, 0, 0.16);
  --control-ink: #0a0a0a;
  --shadow-lg: 0 24px 54px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-main);
  color: var(--ink-900);
  background: linear-gradient(165deg, #040404 0%, #090909 52%, #101010 100%);
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 28rem;
  height: 28rem;
  top: -9rem;
  right: -10rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}

body::after {
  width: 23rem;
  height: 23rem;
  bottom: -7rem;
  left: -7rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

body.no-bg-bubbles::before,
body.no-bg-bubbles::after {
  content: none;
  display: none;
}

a {
  color: inherit;
}

.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.78rem clamp(1rem, 3vw, 3.5rem);
  background: rgba(8, 8, 8, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

.site-navbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.72rem;
  height: 1.45rem;
  background: rgba(5, 5, 5, 0.92);
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
}

.brand-logo {
  width: clamp(1.85rem, 3vw, 2.25rem);
  height: clamp(1.85rem, 3vw, 2.25rem);
  object-fit: contain;
  order: -1;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.26rem;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 12, 12, 0.94);
  cursor: pointer;
}

.navbar-toggle-line {
  width: 1.15rem;
  height: 2px;
  border-radius: 999px;
  background: var(--ink-900);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.navbar-mobile-panel {
  display: contents;
}

.navbar-links,
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.navbar-links {
  justify-self: center;
  justify-content: center;
}

.navbar-actions {
  justify-self: end;
  justify-content: flex-end;
  margin-right: 1.1rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.52rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink-900);
  font-weight: 650;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.navbar-links .nav-link {
  padding: 0.08rem 0.12rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(245, 245, 244, 0.94);
  font-size: 1.06rem;
  font-weight: 700;
}

.navbar-links .nav-link::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.42rem;
  font-size: 0.95em;
  line-height: 1;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-style: normal;
}

.navbar-links .nav-link[href*='/training']::before {
  content: '\f1c0';
}

.navbar-links .nav-link[href*='/overview']::before {
  content: '\f02d';
}

.navbar-links .nav-link[href*='/online_training_ml']::before {
  content: '\f5dc';
}

.navbar-links .nav-link:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.26rem;
}

.nav-link-soft {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(245, 245, 244, 0.84);
}

.nav-link-soft:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

.nav-link-accent {
  color: var(--control-ink);
  border-color: rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav-link-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  background: linear-gradient(135deg, #ffffff, #f0f0ee);
}

.navbar-actions > a[href="/login"] {
  order: 1;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(245, 245, 244, 0.84);
}

.navbar-actions > a[href="/login"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

.navbar-actions > a[href="/register"] {
  order: 2;
  color: var(--control-ink);
  border-color: rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.navbar-actions > a[href="/register"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  background: linear-gradient(135deg, #ffffff, #f0f0ee);
}

.nav-link.is-active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.auth-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 7rem 1rem 2rem;
}

.auth-card {
  width: min(460px, 100%);
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1.35rem;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2rem);
}

.auth-subtitle {
  margin: 0.45rem 0 1rem;
  color: var(--ink-700);
}

.auth-message {
  margin: 0 0 0.85rem;
  min-height: 1.2rem;
  font-size: 0.92rem;
}

.auth-message.error {
  color: #ff9ca5;
}

.auth-message.success {
  color: #9fe2b3;
}

.auth-message-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}

.auth-message-row .auth-message {
  margin: 0;
}

.resend-inline-form {
  margin: 0;
}

.resend-inline-btn {
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(12, 12, 12, 0.9);
  color: var(--ink-900);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: none;
}

.resend-inline-btn:hover {
  background: rgba(20, 20, 20, 0.95);
}

.register-type-wrap {
  margin-bottom: 0.15rem;
}

.register-type-title {
  margin: 0 0 0.46rem;
  font-size: 0.85rem;
  color: var(--ink-600);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.register-type-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 8, 8, 0.88);
  padding: 0.2rem;
  overflow: hidden;
}

.register-type-toggle::before {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.2rem);
  height: calc(100% - 0.4rem);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.register-type-toggle.is-user::before {
  transform: translateX(calc(100% + 0.04rem));
}

.register-type-btn {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.58rem 0.72rem;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  background: transparent;
  color: var(--ink-700);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.005em;
  transition: color 0.2s ease;
}

.register-type-btn:hover {
  background: transparent;
  box-shadow: none;
}

.register-type-toggle.is-team .register-type-btn[data-account-switch='team'],
.register-type-toggle.is-user .register-type-btn[data-account-switch='user'] {
  color: #101010;
}

.register-type-toggle.is-team .register-type-btn[data-account-switch='user'],
.register-type-toggle.is-user .register-type-btn[data-account-switch='team'] {
  color: rgba(245, 245, 244, 0.82);
}

.register-field-group {
  display: grid;
  gap: 0.56rem;
  max-height: 220px;
  opacity: 1;
  transform: translateX(0);
  overflow: hidden;
  transition: max-height 0.26s ease, opacity 0.2s ease, transform 0.2s ease;
}

.register-field-group.is-hidden {
  max-height: 0;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
}

form {
  display: grid;
  gap: 0.56rem;
}

label {
  font-size: 0.91rem;
  color: var(--ink-700);
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.84rem;
  padding: 0.78rem 0.9rem;
  font: inherit;
  color: var(--ink-900);
  background: rgba(8, 8, 8, 0.94);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

button {
  margin-top: 0.35rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0.9rem;
  color: var(--control-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

button:hover {
  background: linear-gradient(135deg, #ffffff, #f0f0ee);
}

/* Keep mobile menu toggle styling consistent with home navbar buttons. */
.navbar-toggle,
.navbar-toggle:hover,
.navbar-toggle:focus-visible {
  margin-top: 0;
  padding: 0;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 12, 12, 0.94);
  box-shadow: none;
}

.navbar-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}

.auth-links {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--ink-700);
}

.auth-links a {
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.forgot-password-inline-wrap {
  margin-top: -0.08rem;
  margin-bottom: 0.18rem;
}

.forgot-password-inline {
  color: var(--ink-700);
  font-size: 0.88rem;
  text-decoration: none;
}

.forgot-password-inline:hover,
.forgot-password-inline:focus-visible {
  text-decoration: underline;
}

@media (max-width: 780px) {
  .site-navbar {
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .brand-link {
    justify-self: start;
    justify-content: flex-start;
  }

  .navbar-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .navbar-mobile-panel {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0.45rem;
    gap: 0.55rem;
    flex-direction: column;
    align-items: stretch;
    width: min(72vw, 24rem);
    max-width: calc(100vw - 0.9rem);
    margin: 0;
    padding: 0.22rem;
    border: 0;
    border-radius: 1rem;
    overflow: visible;
    background: rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
  }

  .site-navbar.is-open .navbar-mobile-panel {
    display: flex;
  }

  .navbar-links,
  .navbar-actions {
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    flex-direction: column;
    margin-right: 0;
  }

  .navbar-links .nav-link,
  .navbar-actions .nav-link {
    width: 100%;
  }

  .site-navbar.is-open .navbar-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-navbar.is-open .navbar-toggle-line:nth-child(2) {
    opacity: 0;
  }

  .site-navbar.is-open .navbar-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 1.05rem;
  }

  .auth-links {
    justify-content: center;
  }
}
