/* Global font settings */
body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    background-color: #abc5f6;
    color: #212529;/* default text color */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center
}

/* Start hidden and slightly transparent */
.page-fade {
  opacity: 0;
  transition: opacity 0.4s ease-in; /* fade duration ~0.4s */
}

/* Class to make it visible */
.page-fade.show {
  opacity: 1;
}

/* Links */
a {
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  color: inherit;
  transition: 0.5s ease;
}
a:hover {
  color: #2d314c;
  transition: 0.5s ease;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.company-name,
.sidebar-header,
.course-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #2d314c;
  margin: 0 0 15px 0;
  text-align: left;
}

/* Paragraphs and labels */
p, label, a, span, .form-control, .alert-danger {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* Wrapper for the whole login page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80vh;
  max-width: 1000px;
  padding:0 80px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background-color: #ffffff;
}

/* Left side image */
.login-image {
  flex: 1;
  padding-left:0;
  padding-right:30px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right:1px solid #eee;
}

.login-image img {
  width: 500px;
  height: 500px;
  object-fit: cover;
}

/* Right side form */
.login-form {
  flex: 1;
  padding:0 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form h1,
.login-form h2,
.login-form h4 {
  text-align: center;
  margin-bottom: 25px;
  font-weight: 700;
  color: #2d314c;
}

/* Form inputs */
.login-form .form-control {
  width: 92%;
  margin-bottom: 20px;
}


/* Password toggle icon */
.password-input-wrapper {
  position: relative;
}

.form-control {
  padding-right: 40px; /* Make room for the eye */
}

.login-container .password-toggle {
  position: absolute;
  bottom: 12px;
  right: 10px;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
}

.register-container .password-toggle {
  position: absolute;
  bottom: 20px;
  right: 0;
  cursor: pointer;
  color: #666;
}

#confirmPasswordError {
  position: absolute; /* Takes the error out of the document flow */

  /* Anchor it just below the input field and inside the wrapper */
  top: 100%;
  left: 0;

  /* Ensure it has a consistent font size/line height */
  white-space: nowrap;
  padding-top: 5px; /* Adjust spacing below the input */
}

@media (max-width: 1024px) {
  .login-container {
    flex-direction: column;
    height: auto;
    padding: 30px 40px;
  }

  .login-image {
    padding: 0;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .login-image img {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  .login-form {
    padding: 30px 20px;
  }

  .register-container {
    flex-direction: column;
    max-width: 90%;
  }

  .register-form {
    width: 100%;
    flex-direction: column;
    padding: 40px 20px;
  }

  .form-group.form-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .form-control {
    width: 100%;
  }
}

/* Phones (≤ 600 px) */
@media (max-width: 600px) {
  body {
    padding: 0 10px;
  }

  .login-container {
    flex-direction: column;
    height: auto;
    max-width: 95%;
    padding: 15px;
  }

  .login-image {
    display: none; /* hide large image on small phones */
  }

  .login-form {
    padding: 20px 15px;
  }

  .login-form h1,
  .login-form h2,
  .login-form h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  .form-control {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px;
  }

  .forgot-password {
    font-size: 0.95rem;
  }

  .table-card.forgot-password {
    width: 90%;
    margin: 50px auto;
    padding: 20px;
  }

  .register-container {
    width: 95%;
    padding: 20px 15px;
    margin: 20px auto;
  }

  .register-form {
    padding: 20px 10px;
  }

  .register-form .form-control {
    width: 100%;
  }

  .company-name {
    font-size: 1.2rem;
    text-align: center;
    margin: 15px 0;
  }

  .flash-center {
    width: 90%;
    padding: 20px 25px;
    font-size: 0.9rem;
  }
}

/* Very small phones (≤ 400 px) */
@media (max-width: 400px) {
  .login-form h1,
  .register-form h1 {
    font-size: 1.1rem;
  }

  .form-control {
    font-size: 0.85rem;
    padding: 8px;
  }

  .extra-links p {
    font-size: 0.85rem;
  }
}

/* Forms */
.form-control {
  width: 80%;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #6c757d;
  padding: 12px;
  font-size: 16px;
  color: #495057;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}


/* Container for bottom links */
.login-form .extra-links {
  margin-top: 30px;
  text-align: center;
}

.login-form .extra-links p {
  margin-bottom: 10px;
}


/* Company branding */
.company-name {
  font-size: 24px;
  font-weight: 700;
  margin-left: 30px;
  margin-top: 10px;
}

.forgot-password {
  font-weight:600;
  font-size:16px;
  text-align:center;
}

.forgot-password h6 {
  text-align: center;
}

.forgot-password input[type='email'] {
  width:90%;
}

.forgot-password p {
  margin-top:40px;
  margin-bottom:15px;
}

.table-card.forgot-password {
  width:30%;
  margin:100px auto;
  padding-bottom:10px;
}

/*** register page ***/

.register-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin:5px auto;
  max-width: 700px;
  padding:0 5px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

.register-form {
  width:700px;
  flex: 1;
  padding:50px 30px;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.register-form .form-control {
  width: 100%;
  margin-bottom: 20px;
}

.password-toggle.register {
  bottom: 15%;
  right:0;
}

.form-group.form-flex {
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap:15px;
}

.form-group label {
  display: inline-block;
  margin-bottom: 0.8rem;
  font-weight:600;
}

.file-upload-requirements {
  margin-top:60px;
  font-size:14px;
}

.form-control-file {
  display:block;
}

.form-group .profile-image-container {
  width: 150px;
  height: 150px;
  margin: 50px auto;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ccc;
  position: relative;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.back-button {
  display:block;
  position:relative;
  left:0;
  top:0;
  margin-bottom:20px;
}


.flash-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  padding: 40px 50px;
  border-radius: 8px;
  background-color: #d4edda;
  color: #155724;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 80%;
  opacity: 1;
  transition: opacity 1s ease-out;
}

.flash-fade-out {
  opacity: 0;
}

.flash-error {
  background-color: #f8d7da;
  color: #721c24;
}

.text-danger {
  color: #a11c1c;
  margin-bottom:20px;
  font-weight:bold;
}

.text-success {
  color: #1c8f0f;
  margin-bottom:20px;
  font-weight:bold;
}

input[type='color'], input[type='date'], input[type='datetime'], input[type='datetime-local'], input[type='email'], input[type='month'], input[type='number'], input[type='password'], input[type='search'], input[type='tel'], input[type='text'], input[type='url'], input[type='week'], input:not([type]), textarea, select {
  -webkit-appearance: none;
  display:block;
  background-color: transparent;
  border: 0.1rem solid #d1d1d1;
  border-radius: .4rem;
  box-shadow: none;
  box-sizing: inherit;
  height: 2rem;
  padding: .6rem 1.0rem .7rem;
  width: 50%;
  margin-bottom:20px;
}
