/* CLMS Auth — full-viewport double-split layout */
:root {
  --auth-blue: #2A7BE4;
  --auth-blue-deep: #1657b0;
  --auth-navy: #0b1f3a;
  --auth-navy-mid: #123056;
  --auth-ink: #0f172a;
  --auth-muted: #64748b;
  --auth-line: #e2e8f0;
  --auth-surface: #ffffff;
  --auth-soft: #f8fafc;
  --auth-ok: #0f9f6e;
  --auth-bad: #dc2626;
  --auth-radius: 12px;
  --auth-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --auth-display: "Outfit", "Plus Jakarta Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.auth-split-body {
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background: var(--auth-surface);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* ===== Brand panel (left) ===== */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: #fff;
  background:
    linear-gradient(160deg, rgba(11, 31, 58, 0.92) 0%, rgba(18, 48, 86, 0.88) 45%, rgba(42, 123, 228, 0.82) 100%),
    radial-gradient(ellipse at 20% 20%, rgba(74, 158, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(16, 87, 176, 0.45), transparent 50%),
    linear-gradient(135deg, var(--auth-navy) 0%, var(--auth-navy-mid) 55%, var(--auth-blue-deep) 100%);
  overflow: hidden;
  isolation: isolate;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  animation: authOrb 12s ease-in-out infinite;
  z-index: 0;
}

@keyframes authOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, -18px) scale(1.08); }
}

.auth-brand-top,
.auth-brand-main,
.auth-brand-foot {
  position: relative;
  z-index: 1;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-brand-mark img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.auth-brand-mark span {
  font-family: var(--auth-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.auth-brand-main {
  max-width: 34rem;
  padding: 2rem 0;
  animation: authRise 0.7s ease both;
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand-main h1 {
  font-family: var(--auth-display);
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}

.auth-brand-main .lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 500;
  opacity: 0.95;
  margin: 0 0 1rem;
}

.auth-brand-main .company {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0 0 2rem;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  animation: authSlide 0.55s ease forwards;
}

.auth-points li:nth-child(1) { animation-delay: 0.15s; }
.auth-points li:nth-child(2) { animation-delay: 0.25s; }
.auth-points li:nth-child(3) { animation-delay: 0.35s; }
.auth-points li:nth-child(4) { animation-delay: 0.45s; }

@keyframes authSlide {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.auth-points li i {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  color: #8ef0c5;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.auth-brand-foot {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ===== Form panel (right) ===== */
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--auth-surface);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  position: relative;
  overflow-y: auto;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--auth-line), transparent);
}

.auth-panel-inner {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  animation: authRise 0.65s ease 0.08s both;
}

.auth-panel-header {
  margin-bottom: 1.75rem;
}

.auth-panel-header h2 {
  font-family: var(--auth-display);
  font-size: clamp(1.75rem, 2.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  color: var(--auth-ink);
}

.auth-panel-header p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.98rem;
}

.auth-form .form-group {
  margin-bottom: 1.15rem;
}

.auth-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--auth-ink);
  margin-bottom: 0.4rem;
}

.auth-input {
  position: relative;
}

.auth-input i.leading {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="tel"],
.auth-form input[type="password"] {
  width: 100%;
  border: 1.5px solid var(--auth-line);
  background: var(--auth-soft);
  border-radius: var(--auth-radius);
  padding: 0.85rem 2.75rem 0.85rem 2.65rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--auth-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--auth-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42, 123, 228, 0.12);
}

.auth-form input.is-invalid {
  border-color: var(--auth-bad);
}

.auth-form .password-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0.45rem;
  border-radius: 8px;
}

.auth-form .password-toggle:hover {
  color: var(--auth-blue);
  background: rgba(42, 123, 228, 0.08);
}

.invalid-feedback {
  display: block;
  margin-top: 0.4rem;
  color: var(--auth-bad);
  font-size: 0.8rem;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 1.25rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--auth-muted);
}

.auth-check input {
  accent-color: var(--auth-blue);
  width: 1rem;
  height: 1rem;
}

.auth-link {
  color: var(--auth-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  border: 0;
  border-radius: var(--auth-radius);
  padding: 0.95rem 1.25rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--auth-blue) 0%, var(--auth-blue-deep) 100%);
  box-shadow: 0 10px 24px rgba(42, 123, 228, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(42, 123, 228, 0.34);
}

.auth-submit.loading {
  opacity: 0.75;
  pointer-events: none;
}

.auth-footer {
  margin-top: 1.35rem;
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.password-strength {
  margin-top: 0.45rem;
}

.password-strength-bar {
  height: 4px;
  background: var(--auth-line);
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.25s ease, background 0.25s ease;
}

.password-strength-fill.weak { width: 33%; background: var(--auth-bad); }
.password-strength-fill.medium { width: 66%; background: #d97706; }
.password-strength-fill.strong { width: 100%; background: var(--auth-ok); }

.auth-alert-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.6rem;
  max-width: min(400px, calc(100vw - 2rem));
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  animation: authRise 0.35s ease;
}

.auth-alert.success { background: var(--auth-ok); }
.auth-alert.error { background: var(--auth-bad); }

.auth-alert button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.85;
}

/* Mobile: stacked split */
@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-brand {
    min-height: auto;
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .auth-brand-main {
    padding: 1rem 0 0.25rem;
  }

  .auth-brand-main h1 {
    font-size: 2.4rem;
  }

  .auth-points {
    display: none;
  }

  .auth-brand-foot {
    display: none;
  }

  .auth-panel {
    padding: 1.75rem 1.25rem 2.5rem;
    min-height: 60vh;
  }

  .auth-panel::before {
    display: none;
  }

  .auth-form .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .auth-brand-mark img {
    width: 46px;
    height: 46px;
  }

  .auth-panel-header h2 {
    font-size: 1.65rem;
  }
}
