.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: #f3f7f8;
}

.auth-card {
  position: relative;
  width: min(100%, 410px);
  padding: clamp(1.6rem, 5vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(203, 218, 227, 0.9);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(18, 45, 65, 0.15), 0 3px 12px rgba(18, 45, 65, 0.05);
  backdrop-filter: blur(18px);
  animation: auth-card-enter 850ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 240ms ease, transform 240ms ease, filter 240ms ease;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.auth-logo-wrap {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 5px;
  place-items: center;
  background: linear-gradient(145deg, #e6f5f2, #f3faf9);
  border: 1px solid #d5ebe7;
  border-radius: 24px;
  box-shadow: 0 9px 22px rgba(15, 118, 110, 0.1);
  animation: auth-logo-arrive 900ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both, auth-logo-float 3.2s 1.1s ease-in-out infinite;
}

.auth-logo {
  display: block;
  width: 51px;
  height: 51px;
}
.auth-brand-name {
  color: #17314a;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}
.auth-brand-caption {
  color: #718394;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}
.auth-heading {
  margin: 0.4rem 0 0.1rem;
  text-align: center;
}
.auth-heading .eyebrow {
  color: var(--accent);
}
.auth-heading h1 {
  margin: 0.25rem 0 0.2rem;
  color: #17283b;
  font-size: clamp(1.45rem, 5vw, 1.7rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}
.auth-heading > p:last-child {
  margin: 0;
  color: #65778a;
  font-size: 0.9rem;
}

.auth-card h1 {
  line-height: 1.2;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-card input {
  width: 100%;
  min-height: 50px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.7rem 0.85rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-card input:focus {
  border-color: var(--accent-strong);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-card button {
  min-height: 48px;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 650;
  margin-top: 0.25rem;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(8, 127, 112, 0.18);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.auth-card button:hover:not(:disabled) {
  background: var(--accent-strong);
  box-shadow: 0 9px 20px rgba(8, 127, 112, 0.23);
  transform: translateY(-1px);
}
.auth-card button:disabled { cursor: wait; opacity: 0.78; }

.auth-error {
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 1.1em;
  text-align: center;
}
.auth-error:empty { min-height: 0.2rem; }

.auth-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}
.auth-download {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding-top: 0.8rem;
  border-top: 1px solid #e8eef2;
  color: #748596;
  font-size: 0.86rem;
}
.auth-download a {
  color: var(--accent-strong);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
}
.auth-download a:hover { text-decoration: underline; }

.login-splash {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  padding: 1.5rem;
  place-items: center;
  background:
    radial-gradient(740px circle at 50% 35%, rgba(33, 166, 150, 0.2), transparent 60%),
    linear-gradient(145deg, #10293d, #173b50 58%, #0e574f);
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}
.login-splash[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.login-splash-card {
  width: min(100%, 390px);
  display: grid;
  justify-items: center;
  text-align: center;
  color: #fff;
  animation: splash-card-enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.splash-logo-wrap {
  position: relative;
  display: grid;
  width: 102px;
  height: 102px;
  margin-bottom: 1.25rem;
  place-items: center;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(210, 249, 239, 0.24);
  border-radius: 30px;
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.18), 0 0 0 12px rgba(111, 220, 196, 0.045);
  animation: splash-logo-pulse 1.8s ease-in-out infinite;
}
.splash-logo-wrap img { width: 68px; height: 68px; }
.login-splash .eyebrow {
  color: #9de0d1;
  letter-spacing: 0.17em;
}
.login-splash h2 {
  margin: 0.55rem 0 0.25rem;
  color: #fff;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}
.login-splash-card > p:not(.eyebrow) {
  margin: 0;
  color: #d3e2e8;
  font-size: 0.95rem;
}
.splash-progress {
  width: 132px;
  height: 3px;
  margin-top: 1.7rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}
.splash-progress span {
  display: block;
  width: 45%;
  height: 100%;
  background: #8ee0c9;
  border-radius: inherit;
  animation: splash-progress 900ms ease-in-out infinite;
}
.login-transitioning .auth-card {
  opacity: 0;
  filter: blur(3px);
  transform: translateY(-10px) scale(0.985);
}

@keyframes auth-card-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-logo-arrive {
  from { opacity: 0; transform: translateY(8px) scale(0.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px) scale(1.02); }
}
@keyframes splash-card-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes splash-logo-pulse {
  50% { box-shadow: 0 18px 62px rgba(0, 0, 0, 0.22), 0 0 0 20px rgba(111, 220, 196, 0.025); }
}
@keyframes splash-progress {
  from { transform: translateX(-120%); }
  to { transform: translateX(250%); }
}

@media (max-width: 420px) {
  .auth-page { padding: 1rem; }
  .auth-card { border-radius: 18px; }
  .auth-logo-wrap { width: 68px; height: 68px; border-radius: 21px; }
  .auth-logo { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-logo-wrap,
  .login-splash-card,
  .splash-logo-wrap,
  .splash-progress span {
    animation: none !important;
  }
  .auth-card,
  .login-splash {
    transition-duration: 0.01ms;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 33, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.modal-overlay.hidden { display: none; }
.modal-overlay .auth-card { box-shadow: var(--shadow-lg); }

/* Shared Yes/No confirmation modal (server/public/js/confirmModal.js) -
   used for logout and other actions across every page instead of the
   browser's native confirm() dialog, so they look and behave the same. */
.confirm-modal-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 1.15rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.confirm-modal-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.confirm-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
