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

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #faf9f6;
  color: #111827;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../public/img/login-bg.jpg') no-repeat center center;
  background-size: cover;
  filter: blur(10px) brightness(0.85); /* Blurred and slightly darkened to not stand out */
  z-index: -1;
  transform: scale(1.1); /* Prevents white edges from blurring */
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
}

.login-container {
  width: min(100%, 520px);
  display: flex;
  justify-content: center;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  width: 100%;
}

.login-card-inner {
  padding: 42px;
}

@media (max-width: 576px) {
  .login-card-inner {
    padding: 28px 20px;
  }
}

.login-header {
  margin-bottom: 30px;
}

.login-title {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 1rem;
  color: #4b5563;
  line-height: 1.75;
}

label {
  display: block;
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 12px;
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #111827;
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14);
}

.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 45px !important;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  z-index: 10;
  margin-top: -9px; /* Adjust for margin-bottom of input */
}

.toggle-password:hover {
  color: #d4af37;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #4b5563;
}

.checkbox-inline input {
  width: 16px;
  height: 16px;
}

.forgot-link {
  color: #111827;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-submit {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.2);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.3);
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.action-row {
  margin-top: 24px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #111827;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #cbd5e1;
}

.error-box,
.success-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  display: none;
}

.error-box.show,
.success-box.show {
  display: block;
}

.error-box {
  background: #fff1f0;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.success-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.register-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid #e5e7eb;
}

.register-title {
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.register-btn {
  display: inline-flex;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  color: #111827;
  text-decoration: none;
  margin-bottom: 12px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.register-btn:hover {
  transform: translateY(-1px);
}

.register-btn-buyer {
  background: #f8fafc;
  border-color: #dbeafe;
}

.register-btn-buyer:hover {
  background: #eef2ff;
}

.register-btn-seller {
  background: #f3d27d;
  border-color: #d4af37;
}

.register-btn-seller:hover {
  background: #e8c363;
}

@media (max-width: 900px) {
  .login-container {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .login-title {
    font-size: 1.75rem;
  }
  
  .login-subtitle {
    font-size: 0.9rem;
  }

  .login-card {
    border-radius: 20px;
  }
}
