html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Sticky footer: fill space between header and footer so the bar stays at the viewport bottom */
body > .container {
  flex: 1 0 auto;
  width: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Navbar polish for long names/admin menus */
.nav-main-links,
.nav-account-links {
  gap: 0.25rem;
}

.nav-user-name {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1199.98px) {
  .nav-main-links,
  .nav-account-links {
    gap: 0;
  }

  .nav-account-links {
    margin-top: 0.5rem;
  }

  .nav-user-name {
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .nav-main-links .nav-link,
  .nav-account-links .nav-link,
  .nav-account-links .btn,
  .nav-main-links .dropdown-toggle {
    white-space: nowrap;
  }
}

/* Login / register / forgot-password: mobile layout (desktop unchanged at >= 768px) */
@media (max-width: 767.98px) {
  body.page-auth > .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.page-auth .nav-main-links {
    display: none !important;
  }

  body.page-auth .navbar-brand .badge {
    display: none;
  }

  body.page-auth .navbar-brand > span:first-child {
    font-size: 0.95rem;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-auth .nav-account-links {
    margin-top: 0;
  }

  .auth-page {
    max-width: 100%;
    overflow-x: hidden;
    padding-top: 0.25rem;
  }

  .auth-page .auth-heading {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  .auth-page .auth-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
  }

  .auth-page .auth-form {
    width: 100%;
    max-width: 100%;
    margin-top: 0 !important;
  }

  .auth-page .form-control {
    font-size: 16px;
    min-height: 44px;
  }

  .auth-page .auth-captcha-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .auth-page .auth-captcha-row .badge {
    align-self: flex-start;
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
    letter-spacing: 0.15em;
  }

  .auth-page .input-group {
    flex-wrap: wrap;
  }

  .auth-page .input-group > .form-control {
    flex: 1 1 100%;
    width: 100%;
    border-radius: var(--bs-border-radius) !important;
  }

  .auth-page .input-group > .btn {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.5rem;
    border-radius: var(--bs-border-radius) !important;
    min-height: 44px;
  }

  .auth-page .auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .auth-page .auth-actions > .btn-primary,
  .auth-page .auth-actions > .btn-outline-primary {
    width: 100%;
    min-height: 44px;
  }

  .auth-page .auth-actions .auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .auth-page .auth-actions .btn-link {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-page .form-text,
  .auth-page > .alert,
  .auth-page > .text-muted {
    font-size: 0.9rem;
    line-height: 1.45;
  }
}