/* ===== Modern Login Page Styles ===== */
/* ===== CSS Variables ===== */
:root {
  --primary-color: #8B4513;
  --primary-dark: #6B3410;
  --primary-light: #A0522D;
  --accent-color: #DAA520;
  --accent-light: #F4E4C1;
  --text-primary: #2C2C2C;
  --text-secondary: #6B6B6B;
  --text-light: #9B9B9B;
  --bg-white: #FFFFFF;
  --bg-light: #F8F6F3;
  --border-color: #E5E5E5;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(139, 69, 19, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
body.auth {
  background: linear-gradient(135deg, #FCFBF9 0%, #F1ECE5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body.auth::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(139, 69, 19, 0.02) 35px, rgba(139, 69, 19, 0.02) 70px), repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(218, 165, 32, 0.02) 35px, rgba(218, 165, 32, 0.02) 70px);
  pointer-events: none;
}

/* ===== Main Container ===== */
.modern-login-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  z-index: 1;
}

/* ===== Login Card ===== */
.login-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: cardSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

/* ===== Header Section ===== */
.login-header {
  padding: 40px 40px 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(218, 165, 32, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  position: relative;
}

.logo-wrapper {
  margin-bottom: 20px;
  animation: fadeInDown 0.6s ease-out;
}

.login-logo {
  height: 70px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: var(--transition);
}

.login-logo:hover {
  transform: scale(1.05);
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.5px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ===== Body Section ===== */
.login-body {
  padding: 28px 40px 36px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top part of form: social login, etc. */
.login-body-top {
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(139, 69, 19, 0.12);
  margin-bottom: 4px;
}

/* ===== Form Groups ===== */
.form-group-modern {
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.form-group-modern:last-of-type {
  margin-bottom: 24px;
}

.form-label-modern {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: var(--transition);
  letter-spacing: 0.2px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-color);
  transform: translateY(-50%) scale(1.1);
}

.input-wrapper:focus-within .form-label-modern {
  color: var(--primary-color);
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
  transition: var(--transition);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-control-modern {
  width: 100%;
  height: 52px;
  padding: 14px 48px 14px 48px;
  font-size: 15px;
  color: var(--text-primary);
  background: rgba(248, 246, 243, 0.6);
  border: 2px solid rgba(139, 69, 19, 0.1);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.form-control-modern.password-input {
  padding-right: 52px;
}

.form-control-modern::placeholder {
  color: var(--text-light);
}

.form-control-modern:hover {
  border-color: rgba(139, 69, 19, 0.2);
  background: rgba(248, 246, 243, 0.8);
}

.form-control-modern:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(139, 69, 19, 0.1);
  transform: translateY(-1px);
}

/* ===== Password Toggle ===== */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 10px;
  transition: var(--transition);
  outline: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.password-toggle:hover {
  color: var(--primary-color);
  background: rgba(139, 69, 19, 0.05);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* ===== Form Options ===== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 8px 0 4px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* ===== Custom Checkbox ===== */
.custom-checkbox-modern {
  display: flex;
  align-items: center;
}

.custom-checkbox-modern input[type=checkbox] {
  display: none;
}

.custom-checkbox-modern input[type=checkbox]:checked + label .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.custom-checkbox-modern input[type=checkbox]:checked + label .checkbox-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.custom-checkbox-modern label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  margin-right: 8px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-custom::after {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: white;
  font-size: 12px;
  transition: var(--transition);
}

.checkbox-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Forgot Link ===== */
.forgot-link {
  font-size: 14px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Login Button ===== */
.btn-login-modern {
  width: 100%;
  height: 54px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out 0.5s both;
  letter-spacing: 0.5px;
}

.btn-login-modern::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.6s ease;
}

.btn-login-modern::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-login-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-login-modern:hover::before {
  left: 100%;
}

.btn-login-modern:active {
  transform: translateY(-1px);
}

.btn-login-modern:active::after {
  width: 300px;
  height: 300px;
}

.btn-login-modern:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login-modern:disabled:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* ===== Footer Section ===== */
.login-footer {
  padding: 24px 40px;
  background: rgba(248, 246, 243, 0.5);
  text-align: center;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.signup-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.signup-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.signup-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Decorative Elements ===== */
.decorative-elements {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.thread-line {
  position: absolute;
  width: 2px;
  height: 200px;
  background: linear-gradient(180deg, transparent, var(--accent-color), transparent);
  opacity: 0.15;
  animation: threadFloat 8s ease-in-out infinite;
}

.thread-line.thread-1 {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.thread-line.thread-2 {
  top: 60%;
  right: 20%;
  animation-delay: 2s;
}

.thread-line.thread-3 {
  bottom: 20%;
  left: 25%;
  animation-delay: 4s;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes threadFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(5deg);
  }
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 576px) {
  .modern-login-container {
    max-width: 100%;
  }
  .login-header {
    padding: 32px 24px 24px;
  }
  .login-body {
    padding: 24px;
  }
  .login-footer {
    padding: 20px 24px;
  }
  .login-title {
    font-size: 24px;
  }
  .login-subtitle {
    font-size: 14px;
  }
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .forgot-link {
    margin-left: 28px;
  }
}

@media (max-width: 400px) {
  .login-logo {
    height: 60px;
  }
  .login-title {
    font-size: 22px;
  }
  .form-control-modern {
    height: 48px;
    font-size: 14px;
  }
  .btn-login-modern {
    height: 50px;
    font-size: 15px;
  }
}

/* ===== Alert Messages ===== */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  border: none;
  animation: fadeInUp 0.4s ease-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.alert.alert-danger {
  background: rgba(255, 238, 238, 0.9);
  color: #C33;
  border-left: 4px solid #C33;
}

.alert.alert-success {
  background: rgba(238, 255, 238, 0.9);
  color: #3C3;
  border-left: 4px solid #3C3;
}

/* ===== Social Buttons Styling ===== */
.social-login {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.social-login .btn {
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.social-login .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== Footer Section ===== */
.login-footer {
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  border-top: 1px solid rgba(139, 69, 19, 0.12);
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.signup-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.signup-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.signup-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
