@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

:root {
  --darkest-shade: #2a3417;
  --darker-shade: #3f4a22;
  --base-color: #556b2f;
  --lighter-tint: #758b4d;
  --lightest-tint: #99b27a;
  --extra-lightest-tint: #dbe4d0;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

body {
  background-image: url(../img/side.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(42, 52, 23, 0.4), rgba(85, 107, 47, 0.6));
  z-index: -1;
}

.secondContainer {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: container-appear 0.6s ease-out;
  border-top: 4px solid var(--base-color);
}

@keyframes container-appear {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.backBtn-div {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
}

.backBtn {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: var(--darkest-shade);
  font-size: 1.2em;
  font-weight: bold;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--extra-lightest-tint);
  transition: all 0.3s ease;
}

.backBtn:hover {
  color: var(--white);
  background-color: var(--base-color);
  transform: scale(1.1);
}

h2 {
  color: var(--darkest-shade);
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.2em;
  font-weight: 700;
  animation: title-appear 0.8s ease-out;
  position: relative;
  padding-bottom: 10px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--base-color);
  border-radius: 2px;
}

@keyframes title-appear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inputBox {
  position: relative;
  margin-bottom: 30px;
  animation: input-appear 0.6s ease-out backwards;
}

@keyframes input-appear {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.inputBox:nth-child(2) {
  animation-delay: 0.1s;
}

.inputBox:nth-child(3) {
  animation-delay: 0.2s;
}

.inputBox:nth-child(4) {
  animation-delay: 0.3s;
}

.inputBox input {
  width: 100%;
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--darkest-shade);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px var(--shadow);
}

.inputBox input:focus {
  border-color: var(--lighter-tint);
  box-shadow: 0 2px 8px rgba(85, 107, 47, 0.2);
}

.inputBox span {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #999;
  transition: all 0.3s ease;
  pointer-events: none;
}

.inputBox span.active,
.inputBox input:focus ~ span,
.inputBox input:valid ~ span {
  top: -10px;
  left: 10px;
  font-size: 12px;
  padding: 0 5px;
  background-color: var(--white);
  color: var(--base-color);
  font-weight: 500;
}

.inputBox i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--base-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  z-index: -1;
}

.inputBox input:focus ~ i,
.inputBox input:valid ~ i {
  transform: scaleX(1);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--darker-shade);
  transition: all 0.3s ease;
  z-index: 2;
}

.toggle-password:hover {
  color: var(--base-color);
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  animation: choice-appear 0.6s ease-out 0.3s backwards;
}

@keyframes choice-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.register {
  padding: 12px 30px;
  width: 100%;
  max-width: 200px;
  background: var(--base-color);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(85, 107, 47, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.register:hover {
  background: var(--lighter-tint);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(85, 107, 47, 0.4);
}

.register:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(85, 107, 47, 0.4);
}

.already {
  color: var(--darker-shade);
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.3s ease;
  position: relative;
}

.already::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--base-color);
  transition: width 0.3s ease;
}

.already:hover {
  color: var(--base-color);
}

.already:hover::after {
  width: 100%;
}

.forgot {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
}

.error-message {
  background: rgba(234, 56, 76, 0.1);
  color: #ea384c;
  padding: 15px;
  border-radius: 10px;
  margin-top: 20px;
  text-align: center;
  animation: message-appear 0.4s ease-out;
  border-left: 3px solid #ea384c;
  font-size: 0.9em;
}

.success-message {
  background: rgba(85, 107, 47, 0.1);
  color: var(--base-color);
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
  text-align: center;
  animation: message-appear 0.4s ease-out;
  border-left: 3px solid var(--base-color);
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.login-btn {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.continue-to-login {
  display: inline-block;
  padding: 12px 30px;
  background: var(--base-color);
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(85, 107, 47, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.continue-to-login:hover {
  background: var(--lighter-tint);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(85, 107, 47, 0.4);
}

/* File input styling */
.file-label {
  display: inline-block;
  padding: 12px 20px;
  background-color: var(--extra-lightest-tint);
  color: var(--darkest-shade);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  font-weight: 500;
  border: 1px solid var(--base-color);
  box-shadow: 0 2px 5px var(--shadow);
}

.file-label:hover {
  background-color: var(--lightest-tint);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(85, 107, 47, 0.2);
}

#file-name {
  display: block;
  margin-top: 8px;
  font-size: 0.85em;
  color: var(--darker-shade);
  text-align: center;
  word-break: break-all;
  max-width: 100%;
}

@media (max-width: 480px) {
  .secondContainer {
    padding: 30px 20px;
    max-width: 90%;
  }

  h2 {
    font-size: 1.8em;
  }

  .inputBox input,
  .inputBox span,
  .register {
    font-size: 14px;
  }

  .forgot {
    flex-direction: column;
    gap: 10px;
  }
}

/* School logo styling */
.school-logo {
  margin-top: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.8;
  animation: fade-in 1s ease-in-out 1s backwards;
}

.school-logo img {
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.school-logo p {
  font-size: 0.9em;
  color: var(--darker-shade);
  letter-spacing: 0.5px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}

/* Icons inside input fields */
.input-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--darker-shade);
  opacity: 0.5;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.3s ease;
}

.inputBox input {
  padding-left: 35px;
}

.inputBox input:focus ~ .input-icon,
.inputBox input:valid ~ .input-icon {
  color: var(--base-color);
  opacity: 0.8;
}

/* Success icon styling */
.success-icon {
  font-size: 3em;
  color: var(--base-color);
  margin-bottom: 15px;
  display: block;
}

/* Error message icon styling */
.error-message i {
  margin-right: 8px;
}

/* File input container */
.file-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Custom Modal Styles */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: scaleIn 0.3s ease-in-out;
}

.modal-header {
  background-color: #556b2f;
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-header i {
  margin-right: 10px;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
  text-align: center;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

.modal-footer {
  padding: 15px 20px;
  text-align: right;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-btn {
  background-color: #556b2f;
  color: white;
  border: none;
  padding: 8px 25px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.modal-btn:hover {
  background-color: #3f4a22;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
