* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  min-height: 100vh;
}

.header {
  width: 100%;
  max-width: 400px;
  text-align: left;
  margin: 10px;
}

.header p {
  color: #fff;
}

.button {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

button {
  margin: 10px;
  padding: 16px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
  border-style: none;
  background: #2990ff;
  color: #fff;
  font-weight: 600;
  transition: all 0.3s ease;
}

.button button:active {
  transform: scale(0.98);
}

.button button:hover {
  background: #007bff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 450px;
  margin: auto;
}

.field {
  position: relative;
  margin: 10px;
  width: 100%;
  max-width: 400px;
}

.field input {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 15px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.field input:focus {
  border-color: #007bff;
}

.field input:focus + label {
  color: #007bff;
}

.field input:not(:focus) + label {
  color: #999;
}

.field input:hover {
  border-color: #000000;
}

input:focus:hover {
  border-color: #007bff;
}

.field i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
}

.field i:hover {
  color: #000;
}

.field label {
  position: absolute;
  left: 12px;
  top: 20px;
  color: #999;
  font-size: 12px;
  pointer-events: none;
  transition: 0.3s ease all;
  background: #fff;
  border-radius: 5px;
  padding: 0 5px;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
}

.forgot {
  width: 100%;
  max-width: 400px;
  text-align: right;
}

.forgot a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

#signUpButton {
  background: #fff;
  color: #2990ff;
  border: 2px solid #2990ff;
}

#signUpButton:hover {
  background: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Trimex background */
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url("pics/trimex.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.right-panel {
    width: 100%;
    max-width: 470px;
    padding: 40px;
    
    /* Glass effect */
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    /* Glass border */
    border: 1px solid rgba(255, 255, 255, 0.35);

    border-radius: 20px;

    /* Depth */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25);

    color: #fff;
}

.branding h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 10px;
}

.branding span {
  color: #2990ff;
}

.branding p {
  color: #666;
}

.branding h2 {
  margin-top: 30px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.illustration img {
  width: 100%;
  max-width: 500px;
  margin: 30px 0;
}

.school-logo {
  width: min(220px, 60vw);
}

form {
  width: 100%;
  padding: 20px;
}

img {
  max-width: 100%;
  height: auto;
}

.field input.error {
  border-color: #dc3545;
  background: #fff5f5;
}

.field input.error + label {
  color: #dc3545;
}

.field input.error:focus {
  border-color: #dc3545;
}

.error-message {
  display: none;
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  padding-left: 5px;
}

.error-message.show {
  display: block;
}

.field input.error {
  border: 2px solid #dc3545;
  background-color: rgba(220, 53, 69, 0.08);
}

.field input.error + label {
  color: #dc3545;
}

.shake {
  animation: shake 0.35s ease-in-out;
}

/* ==========================
   Login Loading Animation
========================== */

.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;

  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
}

.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loader-box {
  background: #fff;
  padding: 35px 45px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #e5e5e5;
  border-top: 6px solid #2b7cff;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

.loader-box h3 {
  margin: 0;
  font-size: 22px;
  color: #222;
}

.loader-box p {
  margin-top: 8px;
  color: #666;
  font-size: 15px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .right-panel {
    flex: 1;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .header {
    margin-left: 0;
    text-align: center;
  }

  .school-logo {
    width: 180px;
  }

  .right-panel {
    overflow: hidden;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .right-panel {
    overflow: hidden;
    align-items: center;
  }

  form {
    padding: 10px;
  }

  .school-logo {
    width: 140px;
  }

  .header h2 {
    font-size: 24px;
  }

  .header p {
    font-size: 14px;
  }

  .field input {
    padding: 14px;
    font-size: 14px;
  }

  .button {
    margin-top: 20px;
  }

  button {
    max-width: 100%;
    padding: 14px;
    font-size: medium;
  }

  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 99999;
  }

  .modal-card {
    background: #fff;
    width: 400px;
    max-width: 90%;

    padding: 30px;

    border-radius: 20px;

    text-align: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

    animation: modalPop 0.3s ease;
  }

  .success-icon {
    width: 80px;
    height: 80px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #28a745;

    color: white;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 36px;
  }

  .modal-card h2 {
    margin-bottom: 10px;
    color: #333;
  }

  .modal-card p {
    color: #666;
    margin-bottom: 20px;
  }

  .modal-card button {
    width: 100%;
    padding: 12px;

    border: none;
    border-radius: 10px;

    background: #2990ff;
    color: white;

    cursor: pointer;

    font-size: 15px;
  }

  .modal-card button:hover {
    background: #007bff;
  }

  @keyframes modalPop {
    from {
      opacity: 0;
      transform: scale(0.8);
    }

    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}
