/* auth_shared.css — the login-card chrome shared by every accounts page
   (login, register, forgot/reset password). Used to be byte-duplicated
   across login.css and register.css and had already started drifting;
   consolidated here so there's one definition. login.css/register.css now
   hold only what's genuinely different about each page. */

main{ flex:1; min-height:100vh; display:flex; flex-direction:column; }

/* Centered layout -- the default for every auth page except register,
   whose taller form needs to start from the top instead (see register.css,
   which overrides just this rule since it loads after this file). */
.login-page-wrap {
  flex:1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 140px;
  background: var(--panel);
}

.login-card {
  background: var(--paper);
  width: 100%;
  max-width: 420px;
  border-radius:var(--radius-lg);
  padding: 48px 44px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-card h2 {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
}

.login-card h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
}

.login-divider {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 28px 0 24px;
}

/* ===== Flash-message toasts ===== */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius:var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  animation: toastSlideIn 0.25s ease;
}

.toast-hide {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  padding: 4px;
}
.toast-close:hover { opacity: 1; }

.toast-success { background: rgba(var(--success-rgb), 0.12); color: var(--success); }
.toast-info    { background: rgba(var(--blue-rgb), 0.12); color: var(--blue-deep); }
.toast-warning { background: var(--warning-bg); color: var(--warning); }
.toast-error   { background: rgba(var(--danger-rgb), 0.15); color: var(--danger); }
.toast-debug   { background: var(--panel); color: var(--ink-soft); }

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

/* ===== Error popup ===== */
.alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: alertFadeIn 0.2s ease;
}

.alert-modal {
  background: var(--paper);
  width: 100%;
  max-width: 380px;
  border-radius:var(--radius-lg);
  padding: 28px 26px 24px;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: alertPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alert-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--danger-rgb), 0.15);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.alert-modal-icon svg { width: 20px; height: 20px; }

.alert-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px;
}

.alert-modal-list {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.6;
}

.alert-modal-list li { margin-bottom: 4px; }
.alert-modal-list li:last-child { margin-bottom: 0; }

.alert-modal-btn {
  width: 100%;
  border: none;
  border-radius:var(--radius-pill);
  background: var(--blue);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.alert-modal-btn:hover { background: var(--blue-deep); }

@keyframes alertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes alertPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Form (Django form.as_p-style output) ===== */
.login-form {
  text-align: left;
}

.login-form p {
  margin: 0 0 18px;
}

.login-form p.has-error input {
  border-color: #dc2626;
}

.login-form label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius:var(--radius);
  font-size: 14.5px;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.25);
}

.login-submit-btn {
  width: 100%;
  border: none;
  border-radius:var(--radius-pill);
  background: var(--blue);
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 700;
  padding: 14px 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-submit-btn:hover {
  background: var(--blue-deep);
}

/* This class is also reused on a plain <a> for single-CTA dead-end screens
   (e.g. "Link expired" / "Password reset" success) instead of a <button>;
   it needs block display for width:100% to take effect, and to drop the
   default link underline/color. */
a.login-submit-btn {
  display: block;
  text-align: center;
  text-decoration: none;
}

.login-submit-btn:disabled,
.login-submit-btn:disabled:hover {
  background: var(--blue);
  opacity: 0.65;
  cursor: not-allowed;
}

.login-footer-links {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.login-register-row {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.login-register-row a {
  color: var(--blue);
  font-weight: 600;
}

/* The "‹ Back to Log in" link on the forgot/reset-password screens --
   inline SVG chevron instead of the old "&lsaquo;" text glyph, matching
   the SVG-icon convention used everywhere else in the app. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.back-link svg { width: 14px; height: 14px; }

/* ===== Sending overlay (forgot password: shown while the reset email is sent) ===== */
.sending-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100; /* above the error popup (1000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: alertFadeIn 0.2s ease;
}

.sending-overlay[hidden] { display: none; }

.sending-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 340px;
  padding: 32px 30px;
  border-radius:var(--radius-lg);
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.sending-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3.5px solid var(--line);
  border-top-color: var(--blue);
  animation: sendingSpin 0.8s linear infinite;
}

@keyframes sendingSpin { to { transform: rotate(360deg); } }

.sending-overlay-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.sending-overlay-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .sending-spinner { animation-duration: 2.4s; }
}

/* ===== Password show/hide toggle ===== */
.password-input-wrap {
  position: relative;
  display: block;
}
.password-input-wrap input[type="password"],
.password-input-wrap input[type="text"] {
  padding-right: 46px; /* room for the toggle button so text never runs under it */
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
}
.password-toggle-btn:hover,
.password-toggle-btn:focus-visible { color: var(--blue); }
.pwd-eye-icon { display: flex; }
.pwd-eye-icon svg { width: 19px; height: 19px; }
