/* Auth pages — login / register (light + dark) */
.auth-page {
  --auth-bg: #f3f6fa;
  --auth-card: #ffffff;
  --auth-input: #f8fafc;
  --auth-border: #e2e8f0;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-label: #64748b;
  --auth-accent: #33b5e5;
  --auth-accent-2: #1a9fd0;
  --auth-ring: rgba(51, 181, 229, 0.12);
  --auth-logo-bg: #ffffff;
  --auth-circle: rgba(51, 181, 229, 0.12);
  --auth-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.dark .auth-page,
html.dark .auth-page {
  --auth-bg: #0a1118;
  --auth-card: #161e27;
  --auth-input: #0f1720;
  --auth-border: #2a3542;
  --auth-text: #ffffff;
  --auth-muted: #94a3b8;
  --auth-label: #8b9aab;
  --auth-accent: #33b5e5;
  --auth-accent-2: #1a9fd0;
  --auth-ring: rgba(51, 181, 229, 0.35);
  --auth-logo-bg: #ffffff;
  --auth-circle: rgba(51, 181, 229, 0.08);
  --auth-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

body.dark #wrapper.login,
body.dark .login,
html.dark #wrapper.login,
html.dark .login {
  background: #0a1118 !important;
}

#wrapper.login:has(.auth-page),
.login:has(.auth-page) {
  background: #f3f6fa;
}

/* No accent line down the left edge (it looked like a leftover). */
.auth-page::before {
  content: none;
}

.auth-page::after,
.auth-page .auth-deco {
  pointer-events: none;
}

.auth-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-deco span {
  position: absolute;
  border: 1px solid var(--auth-circle);
  border-radius: 50%;
}

.auth-deco span:nth-child(1) {
  width: 520px;
  height: 520px;
  top: -180px;
  right: -120px;
}

.auth-deco span:nth-child(2) {
  width: 420px;
  height: 420px;
  top: -130px;
  right: -70px;
}

.auth-deco span:nth-child(3) {
  width: 560px;
  height: 560px;
  bottom: -260px;
  left: -200px;
}

.auth-deco span:nth-child(4) {
  width: 440px;
  height: 440px;
  bottom: -200px;
  left: -140px;
}

.auth-theme {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
}

/* The switch says what it does: "Light mode" / "Dark mode". */
.auth-theme {
  gap: 8px;
}

.auth-theme .mode-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-muted);
  white-space: nowrap;
}

.auth-theme .toggle-switch {
  margin: 0 !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  background: transparent !important;
}

.auth-theme .toggle-switch .switch {
  position: relative !important;
  height: 22px !important;
  width: 44px !important;
  border-radius: 25px !important;
  background-color: #cbd5e1 !important;
  box-shadow: none !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: background-color 0.2s ease;
}

.auth-theme .toggle-switch .switch::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  background-color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}

body.dark .auth-theme .toggle-switch .switch,
html.dark .auth-theme .toggle-switch .switch {
  background-color: var(--auth-accent) !important;
  transform: none !important;
}

body.dark .auth-theme .toggle-switch .switch::before,
html.dark .auth-theme .toggle-switch .switch::before {
  left: 25px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px;
  gap: 40px;
}

.auth-brand {
  flex: 1 1 48%;
  max-width: 480px;
  padding: 20px 24px;
}

.auth-logo-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-logo-bg);
  border-radius: 14px;
  padding: 14px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 28px;
}

.auth-logo-card img {
  display: block;
  max-width: 220px;
  height: auto;
}

.auth-quote {
  margin: 0;
  font-size: 22px;
  line-height: 1.45;
  font-style: italic;
  font-weight: 400;
  color: var(--auth-text);
}

.auth-quote-author {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-accent);
  font-weight: 700;
  font-size: 15px;
  font-style: normal;
}

.auth-quote-author::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--auth-accent);
  display: inline-block;
}

.auth-panel {
  flex: 1 1 52%;
  display: flex;
  justify-content: center;
}

.auth-page .auth-card,
.login .auth-card.form,
.signup .auth-card.form {
  width: 100%;
  max-width: 460px;
  background: var(--auth-card) !important;
  border-radius: 16px !important;
  padding: 36px 34px 28px !important;
  box-shadow: var(--auth-shadow);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  color: var(--auth-text);
}

.auth-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--auth-accent), var(--auth-accent-2));
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.4;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  margin: 0 0 8px !important;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-label);
  font-weight: 600;
  position: static !important;
  top: auto !important;
  left: auto !important;
}

.auth-field .form-control,
.auth-card .form-control {
  height: 48px !important;
  border-radius: 10px !important;
  border: 1px solid var(--auth-border) !important;
  background: var(--auth-input) !important;
  color: var(--auth-text) !important;
  padding: 10px 14px !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
}

.auth-field .form-control:focus,
.auth-card .form-control:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-ring);
  outline: none;
}

.auth-field .form-control::placeholder {
  color: var(--auth-muted) !important;
  opacity: 1 !important;
}

.auth-field .form-control::-webkit-input-placeholder {
  color: var(--auth-muted) !important;
  opacity: 1 !important;
}

.auth-field .form-control::-moz-placeholder {
  color: var(--auth-muted) !important;
  opacity: 1 !important;
}

.auth-field .form-control:-ms-input-placeholder {
  color: var(--auth-muted) !important;
  opacity: 1 !important;
}

.auth-pass {
  position: relative;
}

.auth-pass .form-control {
  padding-right: 44px !important;
}

.auth-pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.auth-page .auth-pass-toggle:hover,
.auth-page .auth-pass-toggle:focus,
.auth-page .auth-pass-toggle:focus-within,
.auth-page .auth-pass-toggle:active {
  background: transparent !important;
  color: var(--auth-accent) !important;
  box-shadow: none;
  outline: none;
}

.auth-row {
  display: flex;
  gap: 14px;
}

.auth-row > .auth-field {
  flex: 1;
  min-width: 0;
}

.auth-forgot {
  display: block;
  width: -moz-fit-content;
  width: fit-content;
  text-align: right;
  margin: -6px 0 18px auto;
  color: var(--auth-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot:hover {
  color: var(--auth-accent-2);
  text-decoration: none;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 28px !important;
  color: var(--auth-text);
  font-size: 13px;
  line-height: 1.4;
}

.auth-check input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--auth-accent);
  flex: 0 0 auto;
}

.auth-check a {
  color: var(--auth-accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-btn {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(90deg, var(--auth-accent), var(--auth-accent-2));
  box-shadow: 0 10px 28px var(--auth-ring);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.auth-page .auth-btn:hover,
.auth-page .auth-btn:focus,
.auth-page .auth-btn:focus-within,
.auth-page .auth-btn:active {
  background: linear-gradient(90deg, var(--auth-accent), var(--auth-accent-2));
  filter: brightness(1.05);
  color: #fff !important;
  text-decoration: none;
}

.auth-footer {
  margin: 18px 0 0;
  text-align: center;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-footer a {
  color: var(--auth-accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--auth-accent-2);
}

.auth-footer--tight {
  margin-top: 8px;
}

.auth-shell--single {
  justify-content: center;
}

.auth-page .auth-card--wide {
  max-width: 820px;
}

.auth-terms h2 {
  margin: 22px 0 6px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-terms p:not(.auth-sub):not(.auth-footer) {
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-terms .auth-footer {
  margin-top: 26px;
}

.auth-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 13px;
  line-height: 1.45;
}

body.dark .auth-status,
html.dark .auth-status {
  color: #34d399;
}

.auth-card .input-error,
.auth-card .invalid-feedback {
  display: block;
  margin-top: 6px;
  color: #ef4444;
  font-size: 12px;
}

@media (max-width: 991px) {
  .auth-shell {
    flex-direction: column;
    justify-content: center;
    padding: 70px 18px 30px;
    gap: 24px;
  }

  .auth-brand {
    max-width: 100%;
    text-align: center;
    padding: 0;
  }

  .auth-quote-author {
    justify-content: center;
  }

  .auth-panel {
    width: 100%;
  }

  .auth-card {
    max-width: 520px;
    padding: 28px 20px 22px;
  }

  .auth-quote {
    font-size: 18px;
  }
}

@media (max-width: 575px) {
  .auth-row {
    flex-direction: column;
    gap: 0;
  }

  .auth-page::before {
    width: 2px;
  }
}
