/* Reset and base font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* BODY: Full-height flex column layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh; /* mobile-safe viewport */
  background-color: #112a45;
  overflow-x: hidden;
}


/* Main layout container */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 0 20px; /* ✅ Always apply left/right space */
  min-height: 0;
}

/* Top section gradient */
.top-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 45vh;
  background: linear-gradient(135deg, #e50914, #ff3b2b, #ff9800);
  clip-path: polygon(0 0, 100% 0, 100% 40vh, 0 100%);
  z-index: -1;
}

/* Red divider */
.divider-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: rgba(229, 9, 20, 0.3);
  z-index: 0;
}

/* Login or Reset card */
.container {
  background: #f9f9f9;
  width: 100%;
  max-width: 380px;
  padding: 30px 20px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  z-index: 1;
}

/* Logo */
.logo img {
  width: 140px;
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
}

/* Titles */
h1, h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 20px;
}

/* Inputs */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: #5e3b88;
}

/* Password toggle icon */
.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 35%;
  transform: translateY(-50%);
  width: 25px;
  cursor: pointer;
}

/* Buttons */
.login-btn {
  background-color: #8e7cc3;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.login-btn:hover {
  background-color: #4e3171;
  transform: translateY(-2px);
}

/* Reset link */
.reset-text {
  margin-top: 14px;
  font-size: 14px;
  color: gray;
  text-decoration: underline;
  cursor: pointer;
}

.reset-text:hover {
  color: black;
}

/* Footer */
.footer {
  text-align: center;
  width: 100%;
  font-size: 13px;
  color: white;
  padding: 15px 0;
  margin-top: auto;
}

.footer a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  color: #ffcc00;
}

/* Back to login */
.back-link {
  display: block;
  color: #4a5df0;
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  color: #1d2de6;
  text-decoration: underline;
}

/* Tablets */
@media (max-width: 768px) {
  .container {
    padding: 25px 20px;
  }

  h1, h2 {
    font-size: 20px;
  }

  .login-btn {
    font-size: 14px;
  }

  .logo img {
    width: 130px;
  }
}

/* Phones */
@media (max-width: 480px) {
  .container {
    padding: 20px 16px;
  }

  h1, h2 {
    font-size: 18px;
  }

  .login-btn {
    font-size: 13.5px;
  }

  .logo img {
    width: 120px;
  }

  .toggle-password {
    width: 22px;
  }
}

/* Short-height desktops (Reset Password fix) */
@media (max-height: 820px) and (min-width: 769px) {
  .main-wrapper {
    justify-content: center;
    padding-top: 30px;
  }
}

