/* Dedicated login / register shell — loaded only on auth pages. */

body.auth-page {
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-soft: #ecfdf9;
  --accent-ring: rgba(13, 148, 136, 0.18);
  --auth-ink: #0b1f1c;
  --auth-muted: #5b736e;
  --auth-line: #dde8e5;
  --auth-font: "Plus Jakarta Sans", system-ui, sans-serif;
  --auth-display: Outfit, "Plus Jakarta Sans", system-ui, sans-serif;
  min-height: 100dvh;
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background: #eaf4f1;
  overflow-x: hidden;
}

.auth-shell {
  position: relative;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  isolation: isolate;
}

.auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(42rem 28rem at 50% -8%, rgba(45, 212, 191, 0.28), transparent 58%),
    radial-gradient(24rem 20rem at 8% 88%, rgba(13, 148, 136, 0.14), transparent 60%),
    radial-gradient(22rem 18rem at 92% 78%, rgba(20, 184, 166, 0.12), transparent 55%),
    linear-gradient(180deg, #f4fbf8 0%, #e8f2ef 48%, #e3eeeb 100%);
}

.auth-glow::before,
.auth-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: authFloat 9s ease-in-out infinite;
}

.auth-glow::before {
  width: 11rem;
  height: 11rem;
  top: 12%;
  left: 8%;
  background: rgba(45, 212, 191, 0.22);
}

.auth-glow::after {
  width: 14rem;
  height: 14rem;
  right: 6%;
  bottom: 10%;
  background: rgba(13, 148, 136, 0.16);
  animation-delay: -3.5s;
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.04); }
}

.auth-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 1.1rem 1rem max(1.4rem, env(safe-area-inset-bottom));
}

.auth-back {
  display: inline-flex;
  align-items: center;
  align-self: center;
  width: 100%;
  max-width: 24.5rem;
  margin-bottom: 0.85rem;
  color: var(--auth-muted);
}

.auth-back:hover { color: var(--auth-ink); }

.auth-back-ico {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 61, 58, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-back:hover .auth-back-ico {
  background: #fff;
  box-shadow: 0 8px 20px -14px rgba(15, 61, 58, 0.45);
  transform: translateX(-2px);
}

.auth-back-ico svg { width: 0.95rem; height: 0.95rem; }

.auth-card {
  width: 100%;
  max-width: 24.5rem;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 40px -24px rgba(11, 61, 56, 0.35),
    0 2px 8px rgba(11, 61, 56, 0.04);
  padding: 1.7rem 1.4rem 1.55rem;
  backdrop-filter: blur(18px) saturate(1.15);
  animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
  animation: authFade 0.6s ease 0.05s both;
}

.auth-logo .logo-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #14b8a6, #0d9488 55%, #0f766e);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(13, 148, 136, 0.8);
}

.auth-logo .logo-mark svg {
  width: 1.15rem;
  height: 1.15rem;
}

.site-logo-auth-m {
  height: 2.55rem;
  width: auto;
  max-width: 3.1rem;
  display: block;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 8px 14px rgba(13, 148, 136, 0.18));
}

.auth-logo .logo-word {
  font-family: var(--auth-display);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #6b857f;
  font-size: 1.22rem;
}

.auth-logo .logo-word span {
  background: linear-gradient(100deg, #0d9488 10%, #2dd4bf 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.auth-head {
  text-align: center;
  margin-bottom: 1.2rem;
}

.auth-card h1 {
  font-family: var(--auth-display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.15;
  color: var(--auth-ink);
}

.auth-sub {
  margin: 0.4rem 0 0;
  color: var(--auth-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.28rem;
  background: rgba(13, 148, 136, 0.07);
  border-radius: 16px;
  padding: 0.28rem;
  margin-bottom: 1.35rem;
  animation: authFade 0.55s ease 0.12s both;
}

.auth-tabs a {
  height: 2.55rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--auth-display);
  font-size: 0.88rem;
  font-weight: 650;
  color: #6b857f;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-tabs a:hover { color: var(--auth-ink); }

.auth-tabs a.on {
  background: #fff;
  color: var(--auth-ink);
  font-weight: 750;
  box-shadow:
    0 1px 2px rgba(11, 61, 56, 0.05),
    0 8px 18px -12px rgba(13, 148, 136, 0.45);
}

.auth-form {
  animation: authFade 0.55s ease 0.18s both;
}

@keyframes authFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.38rem;
}

.auth-label-row label {
  margin: 0;
  font-weight: 650;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: #3f5a54;
}

.auth-optional {
  color: var(--auth-muted);
  font-weight: 500;
  font-size: 0.75rem;
}

.auth-forgot {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-forgot:hover { color: var(--accent-deep); }

.auth-control {
  position: relative;
}

.auth-control-ico {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: #8aa39c;
  pointer-events: none;
  display: grid;
  place-items: center;
  transition: color 0.15s ease;
}

.auth-control-ico svg { width: 1.05rem; height: 1.05rem; }

.auth-control:focus-within .auth-control-ico { color: var(--accent); }

body.auth-page .input {
  height: 3.05rem;
  font-family: var(--auth-font);
  font-size: 16px;
  padding: 0 0.95rem 0 2.55rem;
  background: #f7fbfa;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  color: var(--auth-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.auth-page .has-toggle .input { padding-right: 2.9rem; }

body.auth-page .input::placeholder { color: #9bb0aa; }

body.auth-page .input:hover {
  border-color: #c9dbd6;
}

body.auth-page .input:focus {
  background: #fff;
  border-color: #2dd4bf;
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

body.auth-page .input.is-upper:not(:placeholder-shown) { text-transform: uppercase; }

body.auth-page .btn-primary {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 14px 28px -14px rgba(13, 148, 136, 0.75);
  font-family: var(--auth-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body.auth-page .btn-primary:hover {
  filter: brightness(1.03);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 18px 32px -14px rgba(13, 148, 136, 0.85);
}

body.auth-page .btn-primary:active {
  transform: translateY(1px) scale(0.985);
}

.auth-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  background: transparent;
  color: #8aa39c;
  cursor: pointer;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.auth-eye:hover { color: var(--auth-ink); background: #eef6f3; }

.auth-eye svg { width: 1.05rem; height: 1.05rem; }
.auth-eye .auth-eye-off { display: none; }
.auth-eye.is-on svg:first-child { display: none; }
.auth-eye.is-on .auth-eye-off { display: block; }

.auth-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--auth-muted);
}

.auth-meter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.auth-meter[hidden] { display: none !important; }

.auth-meter span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: #e5e7eb;
}

.auth-meter em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--auth-muted);
  min-width: 6.5rem;
  text-align: right;
}

.auth-meter.s1 span:nth-child(1) { background: #ef4444; }
.auth-meter.s1 em { color: #ef4444; }
.auth-meter.s2 span:nth-child(1),
.auth-meter.s2 span:nth-child(2) { background: #f59e0b; }
.auth-meter.s2 em { color: #d97706; }
.auth-meter.s3 span { background: #0d9488; }
.auth-meter.s3 em { color: #0f766e; }

.auth-row { display: grid; }

.auth-form .field { margin-bottom: 0.9rem; }

.auth-more {
  margin: 0.1rem 0 1rem;
  border-radius: 14px;
  background: rgba(247, 251, 250, 0.9);
  border: 1px solid var(--auth-line);
  overflow: hidden;
}

.auth-more summary {
  list-style: none;
  cursor: pointer;
  padding: 0.8rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #3f5a54;
  user-select: none;
}

.auth-more summary::-webkit-details-marker { display: none; }

.auth-more summary span {
  color: #8aa39c;
  font-weight: 500;
}

.auth-more summary::after {
  content: "+";
  float: right;
  color: #8aa39c;
  font-weight: 700;
}

.auth-more[open] summary::after { content: "–"; }

.auth-more[open] summary {
  border-bottom: 1px solid var(--auth-line);
  background: rgba(255, 255, 255, 0.55);
}

.auth-more .field {
  margin: 0.8rem 0.9rem;
}

.auth-more .field:last-child {
  margin-bottom: 0.95rem;
}

.auth-submit {
  height: 3.1rem !important;
  font-size: 0.98rem;
  margin-top: 0.2rem;
  border-radius: 14px !important;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.8rem;
  color: #8aa39c;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d5e3df, transparent);
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.auth-social-btn {
  height: 2.75rem;
  font-family: var(--auth-font);
  font-weight: 650;
  font-size: 0.84rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--auth-line);
  color: #2f4a44;
  gap: 0.45rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.auth-social-btn:hover {
  background: #fff;
  border-color: #c5d8d2;
  transform: translateY(-1px);
}

.auth-social-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.auth-switch {
  text-align: center;
  margin: 1rem 0 0;
  color: var(--auth-muted);
  font-size: 0.875rem;
}

.auth-switch a { color: var(--accent); font-weight: 700; }

.auth-legal {
  max-width: 24.5rem;
  margin: 1.05rem auto 0;
  text-align: center;
  font-size: 0.7rem;
  color: #7f9791;
  line-height: 1.55;
  animation: authFade 0.55s ease 0.25s both;
}

.auth-legal a {
  font-weight: 650;
  color: #4d6a63;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.auth-page .alert {
  margin-bottom: 0.9rem;
  border-radius: 14px;
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-glow::before,
  .auth-glow::after,
  .auth-card,
  .auth-logo,
  .auth-tabs,
  .auth-form,
  .auth-legal {
    animation: none !important;
  }
}

@media (max-width: 519px) {
  .auth-card { padding: 1.45rem 1.15rem 1.35rem; border-radius: 24px; }
  .auth-logo .logo-word { font-size: 1.18rem; }
}

@media (min-width: 520px) {
  .auth-main { padding: 2rem 1.5rem; }
  .auth-card { padding: 1.9rem 1.7rem 1.7rem; }
}
