/* Modal Connexion / Inscription — pro, sans halo focus */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

.auth-modal,
#authModal,
#authForgotModal,
#authChangePwModal {
  position: fixed;
  inset: 0;
  z-index: 1000000100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(229, 9, 20, 0.12), transparent 55%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: Outfit, "Segoe UI", sans-serif;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-modal.open,
.auth-modal:not([hidden]),
#authModal.open,
#authModal:not([hidden]),
#authForgotModal.open,
#authForgotModal:not([hidden]),
#authChangePwModal.open,
#authChangePwModal:not([hidden]) {
  display: flex;
}
.auth-modal[hidden],
#authModal[hidden],
#authForgotModal[hidden],
#authChangePwModal[hidden] {
  display: none !important;
}

.auth-dialog {
  width: min(400px, 100%);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 32px 90px rgba(0, 0, 0, 0.65);
  padding: 28px 28px 24px;
  color: #fff;
  position: relative;
  animation: authIn 0.28s ease-out;
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.auth-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 10px;
}
.auth-logo-wrap img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
}

.auth-brand {
  font-family: Outfit, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.45rem;
  margin: 0 0 4px;
  text-align: center;
  color: #fff;
}
.auth-sub {
  text-align: center;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.88rem;
  font-weight: 400;
  margin: 0 0 20px;
  line-height: 1.4;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-tab {
  border: 0;
  border-radius: 0;
  padding: 12px 8px 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.auth-tab:hover {
  color: rgba(255, 255, 255, 0.7);
}
.auth-tab.is-active {
  background: transparent;
  color: #fff;
}
.auth-tab.is-active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #e50914;
}

.auth-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-avatar-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #222;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.15s;
}
.auth-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-avatar-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.03);
}
.auth-avatar-hint {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
  position: relative;
}
.auth-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s;
}
.auth-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 0;
  background: #2a2a2a;
  color: #fff;
  padding: 22px 14px 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s;
}
.auth-input::placeholder {
  color: transparent;
}
.auth-input:hover {
  background: #323232;
}
.auth-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: #363636;
}
.auth-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.auth-field:focus-within {
  outline: none;
}
.auth-input:focus + .auth-label,
.auth-input:not(:placeholder-shown) + .auth-label {
  top: 9px;
  transform: none;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
}

.auth-error {
  color: #ff6b6b;
  font-size: 0.8rem;
  margin: 2px 0 12px;
  min-height: 0;
}
.auth-error[hidden] {
  display: none !important;
}

.auth-submit {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: #e50914;
  margin-top: 6px;
  transition: background 0.15s, transform 0.12s;
}
.auth-submit:hover {
  background: #f6121d;
}
.auth-submit:active {
  transform: scale(0.99);
}
.auth-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}
.auth-submit--secondary {
  margin-top: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
}
.auth-submit--secondary:hover {
  background: rgba(255,255,255,0.06);
}

.auth-forgot {
  display: block;
  text-align: center;
  margin: 10px 0 2px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.auth-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}
#authModal[data-mode="register"] #authLoginLinks,
#authModal[data-mode="register"] #authForgotLink,
#authModal[data-mode="register"] #authChangePwLink {
  display: none !important;
}

.auth-forgot:hover {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.auth-hint {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.72rem;
  line-height: 1.4;
}
.auth-ok {
  margin: 0 0 10px;
  color: #86efac;
  font-size: 0.82rem;
  line-height: 1.4;
}
.auth-forgot-steps {
  margin: 0 0 18px;
  padding: 0 0 0 1.1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  line-height: 1.55;
}
.auth-forgot-steps li {
  margin: 0 0 6px;
}
.auth-dialog--forgot .auth-sub {
  margin-bottom: 14px;
}
.auth-forgot-ticket {
  margin-top: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-discord {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.auth-discord:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}
.auth-discord svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

@media (max-width: 480px) {
  .auth-dialog {
    padding: 24px 18px 20px;
  }
}
