/* stylelint-disable selector-id-pattern, no-descending-specificity, declaration-block-single-line-max-declarations */

/* Loader logowania */
#loginLoader {
  display: none;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #177bfe;
  text-align: center;
}


/* Ogólna warstwa modala */
#loginModal {
  position: fixed;
  inset: 0;
  background: transparent; /* overlay jest w .login-modal-overlay */
  z-index: 9996;
  display: flex;
  align-items: flex-start; /* align content from the top */
  justify-content: center;
  padding: 5.5rem 0.5rem 0.5rem; /* 3rem top padding to offset under top bar */
  margin: 0;        /* usuwa przypadkowe centrowanie margin:auto */
  width: auto;
  height: auto;
  max-width: 95%;
  max-height: 95%;
  box-sizing: border-box;
}

#loginModal .modal-content {
  background-color: rgb(255 255 255 / 95%);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgb(0 0 0 / 25%);
  width: auto;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#loginModal.hidden {
  display: none !important;
}



/* Logo */
#loginModal .modal-content img {
  height: 1rem;
  width: auto;
  margin-bottom: 1rem;
}

/* Nagłówki */
#loginModal h3,
#loginModal h4 {
  color: #333;
  text-shadow: 0 1px 1px rgb(0 0 0 / 5%);
  text-align: center;
}

#loginModal h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

#loginModal h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Formularze */
#loginModal form {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Pola input */
#loginModal input[type="text"],
#loginModal input[type="password"] {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem;
  margin: 0 0 1rem;
  border: 1px solid #ccc;
  border-radius: 0.2rem;
  font-size: 1rem;
  color: #333;
  background: #fafafa;
  transition: border 0.3s ease;
  align-items: center;
}

#loginModal input:focus {
  border-color: #177bfe;
  outline: none;
  box-shadow: 0 0 0 3px rgb(23 123 254 / 15%);
}

/* Przycisk zamknięcia */
.modal-close-x {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
}

/* Link resetu hasła */
#forgotPasswordLink {
  color: #177bfe;
  text-decoration: underline;
  font-size: 0.9rem;
  cursor: pointer;
}

#forgotPasswordLink:hover {
  color: #125cc0;
}

/* Przycisk powrotu */
#backToLogin {
  align-self: flex-start;
  color: #177bfe;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  background: none;
  border: none;
  cursor: pointer;
}

#backToLogin:hover {
  text-decoration: underline;
}

/* Komunikaty błędów i sukcesów */
#loginError,
#resetError,
#resetSuccess {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}

#loginError,
#resetError {
  color: #e53935;
}

#resetSuccess {
  color: #2e7d32;
}

#resetLoader {
  font-size: 0.85rem;
  color: #177bfe;
}

/* Sekcje formularzy */
#loginSection,
#resetSection {
  width: 100%;
  max-width: 400px;
}

/* Przycisk standardowy (odziedziczony styl szkoly-button) */
.szkoly-button {
  width: 100%;
  max-width: 100px;
  padding: 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0.35rem;
}

/* Mniejsze przyciski wewnątrz modala */
#loginModal .szkoly-button {
  width: 100%;
  max-width: 100%;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.35rem;
  line-height: 1.1;
  box-sizing: border-box;
}

#loginModal form button,
#loginModal .register-button {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}

/* Ensure both login and register buttons are full width and block elements */
#loginModal .szkoly-button,
#openRegister .szkoly-button{
  width: 100%;
  display: block;
}

/* Sekcja linków na dole */
.form-footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

.login-modal-logo {
  height: 7.3rem;
  width: auto;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: drop-shadow(1px 1px 1px rgb(255 255 255 / 40%)) 
          drop-shadow(-1px -1px 1px rgb(0 0 0 / 30%));
}



.login-modal-overlay.visible {
  display: block;
}

.session-expiry-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgb(255 255 255 / 85%);
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 1.5rem 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgb(0 0 0 / 25%);
  z-index: 10000;
  max-width: 90%;
  width: 400px;
  text-align: center;
  font-size: 1rem;
  color: #333;
}

.session-expiry-banner img {
  max-height: 50px;
  margin-bottom: 0.75rem;
}

.session-expiry-banner p {
  margin-bottom: 1rem;
}

.session-expiry-banner .szkoly-button {
  margin-top: 0.5rem;
  font-size: 0.5rem;
  padding: 0.75rem 1.25rem;
}

/* Glassy white modal with blue sheen and shadow */
.login-modal-content
{
  background: linear-gradient(135deg, rgb(255 255 255 / 190%), rgb(255 255 255 / 73.1%));
  border-radius: 0.6rem;
  padding: 1.9em;
  box-shadow: 0 4px 20px rgb(0 0 0 / 25%);
  width: 100%;
  max-width: 420px;
  min-width: 320px;
  min-height: 200px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(4px);
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(4px);
}

/* Dodaj margines dolny pod etykietą "Zapamiętaj mnie" */
.login-remember-label {
  margin-bottom: 0.5rem;
}

/* Fallbacks when backdrop-filter is not supported */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .session-expiry-banner {
    background: rgb(255 255 255 / 95%);
  }

  .login-modal-content {
    background: rgb(255 255 255 / 95%);
  }
}