@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Allow scrolling on pages with long forms (register) — add class to body/html */
html.scrollable-page,
body.scrollable-page {
  overflow-y: auto;
  overflow-x: hidden;
}

section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

section .bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Fix background for scrollable pages */
section.scrollable .bg,
section.scrollable .trees {
  position: fixed;
}

section .trees {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 100;
  pointer-events: none;
}

section .girl {
  position: absolute;
  scale: 0.65;
  pointer-events: none;
  animation: animateGirl 10s linear infinite;
}

@keyframes animateGirl {
  0% {
    transform: translateX(calc(100% + 100vw));
  }
  50% {
    transform: translateX(calc(-100% - 100vw));
  }
  50.01% {
    transform: translateX(calc(-100% - 100vw)) rotateY(180deg);
  }
  100% {
    transform: translateX(calc(100% + 100vw)) rotateY(180deg);
  }
}

.login {
  position: relative;
  padding: 50px 45px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  width: 460px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.login h2 {
  position: relative;
  width: 100%;
  text-align: center;
  font-size: 2.2em;
  font-weight: 600;
  color: #8f2c24;
  margin-bottom: 10px;
}

.login .field {
  position: relative;
  margin-bottom: 4px;
}

.login .label {
  display: block;
  font-size: 0.9em;
  font-weight: 500;
  color: #8f2c24;
  margin-bottom: 6px;
}

.login .inputBox {
  position: relative;
}

.login .inputBox input {
  position: relative;
  width: 100%;
  padding: 14px 18px;
  padding-right: 48px;
  outline: none;
  font-size: 1.1em;
  color: #8f2c24;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.login .inputBox input:focus {
  border-color: #8f2c24;
  box-shadow: 0 0 0 2px rgba(143, 44, 36, 0.15);
}

.login .inputBox ::placeholder {
  color: #b06a64;
}

/* Eye toggle button for password */
.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #8f2c24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 150ms ease;
}

.eye-btn:hover {
  background: rgba(143, 44, 36, 0.1);
}

/* Submit button */
.login .inputBox input[type="submit"],
.btn-primary {
  position: relative;
  width: 100%;
  border: none;
  outline: none;
  background: #8f2c24;
  color: #fff;
  cursor: pointer;
  font-size: 1.15em;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 8px;
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 24px rgba(143, 44, 36, 0.3);
  margin-top: 8px;
}

.login .inputBox input[type="submit"]:hover,
.btn-primary:hover:not(:disabled) {
  background: #d64c42;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(214, 76, 66, 0.4);
}

.btn-primary:disabled {
  background: #b06a64;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Row with remember me + forgot password */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  margin: 4px 0;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #8f2c24;
  font-weight: 500;
}

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #8f2c24;
  cursor: pointer;
}

/* Footer & links */
.login .group {
  display: flex;
  justify-content: space-between;
}

.login .group a,
.link {
  font-size: 1em;
  color: #8f2c24;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login .group a:hover,
.link:hover {
  color: #d64c42;
  text-decoration: underline;
}

.footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9em;
  color: #8f2c24;
}

.footer a {
  color: #8f2c24;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
  color: #d64c42;
}

/* Falling leaves animation */
.leaves {
  position: absolute;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: none;
}

.leaves .set {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.leaves .set div {
  position: absolute;
  display: block;
}

.leaves .set div:nth-child(1) {
  left: 20%;
  animation: animate 20s linear infinite;
}

.leaves .set div:nth-child(2) {
  left: 50%;
  animation: animate 14s linear infinite;
}

.leaves .set div:nth-child(3) {
  left: 70%;
  animation: animate 12s linear infinite;
}

.leaves .set div:nth-child(4) {
  left: 5%;
  animation: animate 15s linear infinite;
}

.leaves .set div:nth-child(5) {
  left: 85%;
  animation: animate 18s linear infinite;
}

.leaves .set div:nth-child(6) {
  left: 90%;
  animation: animate 12s linear infinite;
}

.leaves .set div:nth-child(7) {
  left: 15%;
  animation: animate 14s linear infinite;
}

.leaves .set div:nth-child(8) {
  left: 60%;
  animation: animate 15s linear infinite;
}

@keyframes animate {
  0% {
    opacity: 0;
    top: -10%;
    transform: translateX(20px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  20% {
    transform: translateX(-20px) rotate(45deg);
  }
  40% {
    transform: translateX(-20px) rotate(90deg);
  }
  60% {
    transform: translateX(20px) rotate(180deg);
  }
  80% {
    transform: translateX(-20px) rotate(45deg);
  }
  100% {
    top: 110%;
    transform: translateX(20px) rotate(225deg);
  }
}

/* ====== Register page extras ====== */

/* Allow scrolling for longer forms (register) */
section.scrollable {
  height: auto;
  min-height: 100vh;
  padding: 2rem 0;
  overflow: visible;
}

section.scrollable .leaves {
  position: fixed;
}

/* Password strength bar */
.strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 280ms ease, background 280ms ease;
}

.strength-fill.weak {
  width: 33%;
  background: #ef4444;
}

.strength-fill.medium {
  width: 66%;
  background: #f59e0b;
}

.strength-fill.strong {
  width: 100%;
  background: #10b981;
}

.strength-text {
  font-size: 0.78em;
  margin-top: 5px;
  color: #8f2c24;
  font-weight: 500;
}

/* Terms & conditions checkbox */
.terms-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 0.82em;
  color: #8f2c24;
}

.terms-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #8f2c24;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.terms-wrap a {
  color: #8f2c24;
  font-weight: 600;
  text-decoration: underline;
}

.terms-wrap a:hover {
  color: #d64c42;
}

/* ====== Forgot password success state ====== */
.success-box {
  display: none;
  text-align: center;
  padding: 1rem 0;
}

.success-box .icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.success-box h2 {
  font-size: 1.3em;
  font-weight: 600;
  color: #8f2c24;
  margin-bottom: 0.5rem;
}

.success-box p {
  font-size: 0.9em;
  color: #6b4a47;
  line-height: 1.6;
}

.success-box .email-highlight {
  color: #8f2c24;
  font-weight: 600;
}

/* Heading styles inside login card */
.login .heading {
  margin-bottom: 8px;
}

.login .heading h1 {
  font-size: 1.3em;
  font-weight: 600;
  color: #8f2c24;
  margin-bottom: 4px;
}

.login .heading p {
  font-size: 0.88em;
  color: #6b4a47;
  line-height: 1.5;
}

/* ====== Mobile responsive ====== */
@media (max-width: 640px) {
  .login {
    padding: 35px 25px;
    width: 92vw;
    gap: 6px;
  }

  .login h2 {
    font-size: 1.8em;
  }

  .login .inputBox input {
    font-size: 1em;
    padding: 12px 14px;
    padding-right: 44px;
  }

  .login .inputBox input[type="submit"],
  .btn-primary {
    font-size: 1em;
    padding: 12px 14px;
  }

  .row {
    font-size: 0.8em;
  }

  .login .group a,
  .link {
    font-size: 0.9em;
  }
}
