
/* ========================================
   GLOBAL SETTINGS
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  margin: 0;

  /* Space for the logo above the form */
  padding: 145px 16px 30px;

  background:
    url('signinlogo.png') no-repeat center 60px,
    linear-gradient(180deg, #0037a7, #0089ff);

  background-size: 60px 68px, cover;
  background-position: center 60px, center;
  background-attachment: scroll;
}

/* ========================================
   FORM CONTAINER
   ======================================== */

#loginForm {
  width: 100%;
  max-width: 456px;
  min-width: 0;
  margin: auto;
}

.login-container {
  width: 100%;
  max-width: 456px;
  min-width: 0;
  height: auto;

  padding: 30px 20px;
  margin: 0 auto;

  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* ========================================
   PASSWORD VISIBILITY
   ======================================== */

.password-section,
#password-container {
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
}

/* ========================================
   HEADINGS
   ======================================== */

h2 {
  margin: 0 0 45px;
  font-size: 20px;
  color: #606060;
  font-weight: 100;
}

/* ========================================
   INPUTS AND FLOATING LABELS
   ======================================== */

.form-group {
  position: relative;
  width: 100%;
  min-width: 0;
  text-align: left;
  margin-bottom: 40px;
}

.form-group input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 5px 0;

  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;

  font-family: inherit;
  font-size: 16px;
  outline: none;
  color: #333;
  background: transparent;
}

.form-group input:focus {
  border-bottom: 1px solid #007BFF;
}

.form-group label {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);

  font-size: 16px;
  color: #666;
  transition: all 0.3s ease;
  pointer-events: none;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: -5px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #007BFF;
}

/* ========================================
   PASSWORD GROUP
   ======================================== */

.form-group.password-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.password-group input {
  flex: 1 1 auto;
}

/* ========================================
   BUTTONS
   ======================================== */

.buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}

.buttons button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  height: auto;
  padding: 10px;

  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease;
  touch-action: manipulation;
}

.sign-in-btn {
  background: #0033aa;
  color: #fff;
  border: none;
}

.sign-in-btn:hover {
  background: #4c8dff;
}

.register-btn {
  background: transparent;
  color: #007BFF;
  border: 2px solid #007BFF;
  padding: 10px;
}

.register-btn:hover {
  background: #007BFF;
  color: #fff;
}

/* Space between Register button and Forgot links */
#login-container .links {
  margin-top: 25px;
  display: block;
  text-align: center;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;

  width: 40px;
  height: 40px;
  flex-shrink: 0;

  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   TABLETS AND MOBILE PHONES
   ======================================== */

@media screen and (max-width: 768px) {
  body {
    align-items: center;
    padding: 125px 16px 24px;

    background-size: 60px 68px, cover;
    background-position: center 35px, center;
  }

  #loginForm,
  .login-container {
    width: 100%;
    max-width: 456px;
  }

  .login-container {
    padding: 26px 22px;
    border-radius: 10px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 30px;
  }

  .form-group {
    margin-bottom: 30px;
  }

  .form-group input {
    height: 38px;
    font-size: 16px;
    padding: 6px 0;
  }

  .form-group label {
    font-size: 15px;
  }

  .form-group input:focus + label,
  .form-group input:not(:placeholder-shown) + label {
    top: -5px;
    font-size: 13px;
  }

  .buttons {
    gap: 10px;
    margin-top: 16px;
  }

  .buttons button {
    min-height: 42px;
    padding: 10px;
    font-size: 16px;
  }
  /* Add spacing below the buttons */
.buttons + p {
  margin-top: 14px;
  margin-bottom: 0;
  text-align: center;
}
  .spinner {
    width: 36px;
    height: 36px;
    border-width: 5px;
  }
}

/* ========================================
   SMALL PHONES: 380px AND BELOW
   ======================================== */

@media screen and (max-width: 380px) {
  body {
    padding: 115px 10px 20px;
    background-position: center 25px, center;
  }

  #loginForm,
  .login-container {
    width: 100%;
    max-width: 100%;
  }

  .login-container {
    padding: 22px 16px;
    border-radius: 8px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 24px;
  }

  .form-group {
    margin-bottom: 25px;
  }

  .form-group input {
    height: 36px;
    font-size: 16px;
  }

  .form-group label {
    font-size: 14px;
  }

  .buttons {
    margin-top: 12px;
    gap: 9px;
  }

  .buttons button {
    min-height: 40px;
    padding: 9px;
    font-size: 15px;
  }

  .spinner {
    width: 32px;
    height: 32px;
    border-width: 4px;
  }
}

/* ========================================
   VERY NARROW PHONES: 320px AND BELOW
   ======================================== */

@media screen and (max-width: 320px) {
  body {
    padding-right: 8px;
    padding-left: 8px;
  }

  .login-container {
    padding: 20px 12px;
  }

  h2 {
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 22px;
  }
}

/* ========================================
   LANDSCAPE AND SHORT SCREENS
   ======================================== */

@media screen and (max-height: 500px) {
  body {
    align-items: flex-start;
    padding-top: 95px;
    padding-bottom: 20px;
  }

  h2 {
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 24px;
  }

  .login-container {
    margin-top: 0;
  }
}
