/* Login Modal Styles (centralized) */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(6px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  max-width: 840px;
  width: 92%;
  position: relative;
  border-top: 6px solid #FF002B;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-areas: "main media";
  transition: grid-template-columns 320ms ease;
  gap: 24px;
  min-height: 560px;
  align-items: center;
}

.auth-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  max-width: 560px;
  width: 100%;
  justify-self: start;
  padding-right: 12px;
}

.auth-media {
  grid-area: media;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding-left: 12px;
}

.auth-illustration {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 12px;
}

.auth-main .auth-tabs {
  width: 100%;
}

.auth-main form {
  width: 100%;
  gap: 12px;
}

.auth-main form.hidden {
  display: none !important;
}

/* Swap animation: exchange form and image sides */
.auth-main,
.auth-media {
  transition: opacity 240ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.auth-content.swap {
  grid-template-columns: 0.8fr 1.2fr;
  grid-template-areas: "media main";
}

.auth-content.swap .auth-main {
  transform: translateX(12px);
}

.auth-content.swap .auth-media {
  transform: translateX(-12px);
}

.auth-content.swapping .auth-main,
.auth-content.swapping .auth-media {
  opacity: 0;
  transform: translateX(0);
}

@media (max-width: 640px) {
  .auth-content.swap {
    grid-template-columns: 1fr;
  }

  .auth-content.swap .auth-main {
    grid-column: 1;
    transform: none;
  }

  .auth-content.swap .auth-media {
    display: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .auth-main,
  .auth-media {
    transition: none;
  }
}

@media (max-width: 640px) {
  .auth-content {
    grid-template-columns: 1fr;
    max-width: 92vw;
    min-height: 460px;
  }

  .auth-media {
    display: none;
  }

  .auth-content.swap {
    grid-template-areas: "main";
  }
}

.auth-modal.open .auth-content {
  animation: modalDrop 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-modal.closing .auth-content {
  animation: modalHide 200ms ease forwards;
}

@keyframes modalDrop {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalHide {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 1px solid #e1e5e9;
  gap: 12px;
}

.auth-tab {
  flex: 1;
  padding: 16px 18px;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #333;
  font-weight: 600;
  font-size: 16px;
}

.auth-tab.active {
  color: #FF002B;
  border-bottom-color: #FF002B;
}

.hidden {
  display: none;
}

.modal-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0 12px;
  font-size: 14px;
}

.auth-modal .form-group input {
  background: #ffffff;
  color: #111827;
  border: none;
  border-bottom: 1.5px solid #FF002B;
  border-radius: 0;
  padding: 12px 4px;
  box-shadow: none;
}

.social-login {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.social-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.02s ease;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
}

.social-login-btn:hover {
  background: #f8fafc;
}

.social-login-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

/* Equalize submit buttons size inside modal */
.auth-main .btn-shorten {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  box-sizing: border-box;
}
.auth-main .btn-shorten .btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.auth-modal .form-group input:focus {
  outline: none;
  border: none;
  border-bottom: 3px solid #FF002B;
  box-shadow: none;
}

/* Override browser autofill background (Chrome/Safari) */
.auth-modal input:-webkit-autofill,
.auth-modal input:-webkit-autofill:hover,
.auth-modal input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  -webkit-text-fill-color: #111827 !important;
  caret-color: #111827;
}
