/**
 * Glassmorphism Login Form - Complete & Self-Contained
 *
 * @format
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dim: rgba(255, 255, 255, 0.8);
  --light: #fff;
  --dim-light: #f2f5f99f;
  --color-primary: #17d8b15f;
  --color-secondary: #6c757d;
  --color-success: #3dcab1;
  --color-green: #01ce87;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-info: #0dcaf0;
  --color-blue: #2895ae;
  --color-light: #f8f9fa;
  --color-dark: #212529;
  --shadow: rgba(255, 255, 255, 0);
  --shadow-box: rgba(255, 255, 255, 0.205);
}


body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-blue) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
}

.login-container {
  width: 100%;
  max-width: 420px;
  perspective: 1000px;
  background: #21252943;
  border-radius: 20px;
}

/* Form Group & Input Styles */
.form-group {
  margin-bottom: 25px;
  position: relative;
}

.input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-wrapper input {
  border-radius: 12px;
  padding: 10px;
  color: white;
  font-size: 16px;
  font-weight: 400;
  width: 100%;
  outline: none;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper input::placeholder {
  color: #f2f5f9a8;
  font-size: 16px;
}

.input-wrapper input:focus,
.input-wrapper input:valid {
  border-color: var(--color-light);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px var(--shadows);
}

/* Button Styles */
.btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-blue) 100%);
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  color: var(--dim);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  box-shadow: 0 4px 15px var(--shadow);
}

.btn:hover {
  background: var(--color-primary);
  box-shadow: 0 8px 25px var(--shadow);
  color: var(--light);
}

/* Loading State */
.btn.loading {
  pointer-events: none;
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  opacity: 0;
  animation: spin 1s linear infinite;
  transition: opacity 0.3s ease;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .btn-loader {
  opacity: 1;
}

/* Checkbox Styles */
.remember-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
  display: none;
}

.checkbox-label {
  color: var(--color-light);
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.remember-wrapper input[type="checkbox"]:checked~.checkbox-label .checkmark {
  background: var(--color-success);
  border-color: var(--color-light);
  transform: scale(1.1);
}

.remember-wrapper input[type="checkbox"]:checked~.checkbox-label .checkmark::after {
  content: "✓";
  color: white;
  font-size: 16px;
  font-weight: bold;
  animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* OTP input styling */
.otp-wrapper {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.otp-input {
  width: 35px;
  height: 35px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 17px;
  border: 1px solid var(--dim-light);
  border-radius: 8px;
  outline: none;
  transition: 0.3s;
  color: var(--dim-light);
  margin-bottom: 8px;
}

.otp-input:focus {
  border-color: var(--dim);
  box-shadow: 0 4px 10px var(--shadow-box);
}

#resendOtp {
    color: var(--dim);
    border: 1px solid var(--dim-light);
    padding: 1px 4px;
    border-radius: 6px;
    margin-left: 4px;
    transition: all 0.5s ease-in-out;
}

#resendOtp:hover {
    color: var(--color-light);
    background: var(--color-success);
}

.error-message {
  color: red;
  font-size: 14px;
  margin-bottom: 10px;
  display: block;
  text-align: center;
}

/* otp error */
#errorBox {
  margin-bottom: 10px;
}


/* Animations */
@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes successPulse {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.login-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 20px 30px;
  box-shadow: 0 8px 32px var(--shadow);
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-light), transparent);
  transition: left 0.5s ease;
}

.login-card:hover::before {
  left: 100%;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 60px;
  border-radius: 35px;
  box-shadow: 0 4px 10px var(--shadow);
  padding: 8px;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-header h2 {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 400;
}

/* Password Toggle Specific Styles */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 2px;
  top: 52%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  font-size: 22px;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 10px;
  flex-wrap: wrap;
  gap: 12px;
}

.forgot-password {
  color: #f2f5f9ef;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: end !important;
  float: right !important;
  /* right: -6rem; */
}

.forgot-password::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-light);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forgot-password:hover::after {
  width: 100%;
}

.forgot-password:hover {
  color: white;
}

/* Login Button */
.login-btn {
  width: 100%;
  margin-top: 2px;
}

/* Divider */
.divider {
  text-align: center;
  margin: 12px 0 16px 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.divider::before {
  margin-right: 16px;
}

.divider::after {
  margin-left: 16px;
}

.divider span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  white-space: nowrap;
}

/* Social Login */
.social-login {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.social-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 6px;
  color: var(--dim);
  font-size: 16px;
  font-weight: 200;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-btn:hover {
  background: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow);
}

.social-icon {
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Signup Link */
.signup-link {
  text-align: center;
}

.signup-link p {
  margin: 16px auto 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.signup-link a,
.go-back a {
  color: var(--color-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.signup-link a:hover,
.go-back a:hover {
  color: white;
}

.forgot-card form button {
  margin-top: 25px;
}

.go-back {
  text-align: center !important;
  margin: 20px auto 10px !important;
}

.go-back a {
  font-size: 16px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
}

.go-back a:hover {
  background: var(--color-primary);
}

@media (max-width: 756px) {
  body {
    min-height: 100vh;
    padding: 0;
    line-height: 2;
  }

  .login-container {
    width: 100%;
    max-width: 950px;
    perspective: 300px;
    display: flex;
    margin: 0;
    padding: 0;
  }

  .login-card {
    padding: 10px 25px !important;
    margin: 0;
    width: 100%;
  }

  .otp-input {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-bottom: 20px;
  }

  .otp-wrapper {
    gap: 6px;
  }

}

/* Mobile Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 24px;
    margin: 10px;
    border-radius: 20px;
  }

  .login-header h2 {
    font-size: 1.75rem;
  }

  .password-wrapper input {
    padding-right: 44px;
  }

  .social-login {
    flex-direction: column;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}