/*!
 * Sign-in / account screens.
 * Split layout: a brand panel that commits to the dark navy identity, and a
 * light form panel. Both sides are readable in either colour scheme, so this
 * file deliberately does not follow the app's light/dark switch.
 */

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background-color: var(--app-canvas, #f4f6fb);
  overflow-x: hidden;
}
@media (min-width: 992px) {
  .auth-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* ============================================================ brand panel */
.auth-brand {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  overflow: hidden;
  color: #fff;
  background: #04143d;
  isolation: isolate;
}
@media (min-width: 992px) {
  .auth-brand { display: flex; }
}

/* Slow-drifting colour field. */
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.75;
}
.auth-brand::before {
  width: 46rem;
  height: 46rem;
  top: -18rem;
  left: -14rem;
  background: radial-gradient(circle, #0057ff 0%, rgba(0, 87, 255, 0) 68%);
  animation: auth-drift-a 22s ease-in-out infinite alternate;
}
.auth-brand::after {
  width: 38rem;
  height: 38rem;
  right: -12rem;
  bottom: -14rem;
  background: radial-gradient(circle, #00a6a6 0%, rgba(0, 166, 166, 0) 70%);
  animation: auth-drift-b 26s ease-in-out infinite alternate;
}
@keyframes auth-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4rem, 5rem, 0) scale(1.12); }
}
@keyframes auth-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-5rem, -3rem, 0) scale(1); }
}

/* Fine grain so the large gradients don't band on cheap panels. */
.auth-brand-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.auth-brand-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0.75rem;
  padding: 5px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
}
.auth-brand-mark span {
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.auth-brand-body { max-width: 30rem; }
.auth-brand-body h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.auth-brand-body p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 2.25rem;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
}
.auth-features i {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.auth-features strong { display: block; font-weight: 600; }
.auth-features small {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-brand-foot {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ============================================================= form panel */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  /* grid items default to min-width:auto, which lets a wide card overflow */
  min-width: 0;
  padding: 2rem 1.25rem;
  background: var(--app-surface, #fff);
}
.auth-card {
  width: 100%;
  max-width: min(25.5rem, 100%);
  animation: auth-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.auth-card-mark {
  display: none;
  margin-bottom: 1.75rem;
}
@media (max-width: 991.98px) {
  .auth-card-mark { display: flex; align-items: center; gap: 0.625rem; }
  .auth-card-mark img { width: 40px; height: 40px; object-fit: contain; }
  .auth-card-mark span { font-weight: 650; letter-spacing: -0.01em; }
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 680;
  letter-spacing: -0.028em;
  margin-bottom: 0.375rem;
}
.auth-card .auth-sub {
  color: var(--bs-secondary-color, #71717a);
  font-size: 0.9375rem;
  margin-bottom: 1.75rem;
}

.auth-field { margin-bottom: 1.125rem; }
.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--bs-emphasis-color, #18181b);
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > i.auth-lead {
  position: absolute;
  left: 0.875rem;
  font-size: 1rem;
  color: var(--bs-secondary-color, #71717a);
  pointer-events: none;
  transition: color 0.15s ease;
}
.auth-input-wrap .form-control {
  height: 3rem;
  padding-left: 2.75rem;
  padding-right: 2.75rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
}
.auth-input-wrap .form-control:focus + i.auth-lead,
.auth-input-wrap .form-control:focus ~ i.auth-lead { color: var(--bs-primary, #0057ff); }

.auth-eye {
  position: absolute;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--bs-secondary-color, #71717a);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.auth-eye:hover { background: rgba(0, 0, 0, 0.05); color: inherit; }

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}
.auth-meta a { font-weight: 600; text-decoration: none; }
.auth-meta a:hover { text-decoration: underline; }

.auth-submit {
  width: 100%;
  height: 3rem;
  border: 0;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  color: #fff;
  background: linear-gradient(135deg, #0057ff 0%, #3d82ff 100%);
  box-shadow: 0 12px 26px -12px rgba(0, 87, 255, 0.95);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.auth-submit:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -12px rgba(0, 87, 255, 1);
}
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.75; cursor: progress; }
.auth-submit .spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}
.auth-submit.is-busy .spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-foot {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-hairline, rgba(16, 24, 40, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #71717a);
}
.auth-lang { display: inline-flex; gap: 0.25rem; }
.auth-lang a {
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.auth-lang a:hover,
.auth-lang a.active {
  background: rgba(var(--bs-primary-rgb, 0, 87, 255), 0.1);
  color: var(--bs-primary, #0057ff);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.8438rem;
  line-height: 1.45;
  border: 1px solid transparent;
}
.auth-alert i { font-size: 1rem; line-height: 1.35; }
.auth-alert-danger {
  color: #b83467;
  background: rgba(230, 65, 129, 0.09);
  border-color: rgba(230, 65, 129, 0.22);
}
.auth-alert-success {
  color: #008545;
  background: rgba(0, 166, 86, 0.09);
  border-color: rgba(0, 166, 86, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand::before,
  .auth-brand::after,
  .auth-card,
  .auth-submit .spinner { animation: none !important; }
  .auth-submit { transition: none; }
}
