:root {
  --teal: #407C87;
  --teal-accent: #A5DBDD;
  --bg-gray: #EEF1F6;
  --border: #D3E1E2;
  --muted: #9ea3ab;
  --dark: #2c2f3a;
  --white: #ffffff;
}
body {
  font-family: 'Nunito', sans-serif;
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f8fb 0%, #e8f0f4 50%, #eef1f6 100%);
  position: relative;
  overflow-x: hidden;
  padding: 20px;
}
body::before,
body::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* the right floating blob */
body::before {
  top: -10%;
  right: 5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(165, 219, 221, 0.4), transparent);
  border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
  animation: blobMotion1 8s ease-in-out infinite;
}

/* the left floating blob */
body::after {
  bottom: -15%;
  left: 0%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(64, 124, 135, 0.25), transparent);
  border-radius: 40% 60% 50% 50% / 50% 50% 40% 60%;
  animation: blobMotion2 10s ease-in-out infinite;
}

/* movement for the first blob */
@keyframes blobMotion1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
}

/* movement for the second blob */
@keyframes blobMotion2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(0.98); }
}

/* the main container card with a glass blur effect and shadow */
.card {
  position: relative;
  width: 100%;
  max-width: 860px;
  height: 620px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.12), 0 0 0 1px rgba(64, 124, 135, 0.1);
  overflow: hidden;
  z-index: 10;
  animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-link {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #9fe1e2 0%, #407c87 100%);
  color: #0f3f47;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  z-index: 4;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(64, 124, 135, 0.3);
  isolation: isolate;
}

.back-link span {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f8feff;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(64, 124, 135, 0.2);
  transition: transform 0.25s ease;
}

.back-link::before,
.back-link::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  background: radial-gradient(circle at 30% 30%, rgba(165, 219, 221, 0.7), transparent 60%);
  opacity: 0.65;
  z-index: -1;
  filter: blur(2px);
}

.back-link::after {
  inset: -18px;
  opacity: 0.35;
  filter: blur(8px);
}

.back-link:hover {
  transform: translateY(-4px) rotate(-2deg);
  box-shadow: 0 16px 34px rgba(64, 124, 135, 0.3);
  filter: saturate(1.1);
}

.back-link:hover span {
  transform: translateX(-2px);
}

.back-link:active {
  transform: translateY(-1px) rotate(0deg) scale(0.98);
}

/* entry animation  */
@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(60px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

/* the panel  */
.teal-panel {
  position: absolute;
  inset: 0;
  background: var(--teal);
  z-index: 1;
  clip-path: polygon(55% 0%, 100% 0%, 100% 100%, 100% 100%);
}

/* the sweep animation to the left*/
.teal-panel.to-signin { animation: sweepLeft 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
/* the sweep animation to the right*/
.teal-panel.to-signup { animation: sweepRight 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards; }

/* to move the banner shape to the left */
@keyframes sweepLeft {
  0%   { clip-path: polygon(55% 0%, 100% 0%, 100% 100%, 100% 100%); }
  45%  { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
  100% { clip-path: polygon(0% 0%, 45% 0%, 0% 100%, 0% 100%); }
}

/* to move the banner shape to the right */
@keyframes sweepRight {
  0%   { clip-path: polygon(0% 0%, 45% 0%, 0% 100%, 0% 100%); }
  45%  { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
  100% { clip-path: polygon(55% 0%, 100% 0%, 100% 100%, 100% 100%); }
}

.brand {
  position: absolute;
  top: 20%;
  right: 36px;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 42px;
  font-weight: 900;
  color: var(--white);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  letter-spacing: -1px;
}
.form {
  position: absolute;
  top: 0; bottom: 0;
  width: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* to put the signup form on the left */
.signup-form { left: 0; }
/* to put the signin form on the right */
.signin-form { right: 0; }

.form-inner {
  width: 280px;
  display: grid;
  gap: 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.3s;
  pointer-events: none;
}

/* makes the form visible and clickable when the 'active' class is added */
.form.active .form-inner {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* styling  titles inside the forms */
.form-inner h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  margin-top: 0;
  line-height: 1.2;
  color: var(--white);
  text-shadow: 0 2px 8px rgba(64, 124, 135, 0.4);
  position: relative;
  z-index: 5;
}

/* for input style */
.form-inner input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: rgba(238, 241, 246, 0.6);
  outline: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

/* changes border color and background when the user clicks an input */
.form-inner input:focus {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(64, 124, 135, 0.15);
  transform: translateY(-2px);
}

.form-inner input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.form-inner button {
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--teal) 0%, #2f5f67 100%);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(64, 124, 135, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.form-inner button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.form-inner button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(64, 124, 135, 0.35);
}

.form-inner button:hover::before {
  left: 100%;
}

.form-inner button + button {
  margin-top: 10px;
}

.form-inner button:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(64, 124, 135, 0.2);
}

#testHomeBtn {
  background: linear-gradient(135deg, var(--teal-accent), var(--border));
  font-size: 12px;
  padding: 10px 16px;
  letter-spacing: 0.3px;
}

#testHomeBtn:hover {
  box-shadow: 0 8px 20px rgba(165, 219, 221, 0.3);
}

/* Message box styling */
#signinMsgBox, #signupMsgBox {
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  text-align: center;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* small text hints and 'forgot password' */
.hint, .forgot {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  transition: color 0.3s;
}

.hint:hover {
  color: var(--teal);
}

.forgot {
  margin-top: -8px;
  cursor: pointer;
}

.forgot:hover {
  color: var(--teal);
  text-decoration: underline;
}

/*switch between login and signup */
.toggle-link {
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s;
  border-bottom: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-link:hover {
  color: #2f5f67;
  border-bottom-color: var(--teal);
}

/* responsive style for small screens */
@media (max-width: 768px) {
  /* change background blobs for small screens */
  body::before, body::after { width: 250px; height: 250px; }

  .card {
    height: auto;
    min-height: 550px;
    padding-bottom: 30px;
  }

  /* turns off the panel animation  */
  .teal-panel {
    clip-path: none !important;
    height: 100px;
    animation: none !important;
  }

  /* centers the brand logo  */
  .brand {
    top: 30px;
    right: auto;
    align-items: center;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
  }

  /* make the form vertically  */
  .form {
    width: 100%;
    position: relative;
    padding-top: 120px;
    display: none;
  }

  /* shows only the active form on mobile */
  .form.active { display: flex; }
}