/* ===== Login page ===== */

.login-body {
  margin-top: 90px  ;
  padding: 56px 0 90px;
}

/* ---------- Shell: split panel ---------- */
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

/* ---------- Brand / chart panel ---------- */
.login-brand {
  position: relative;
  background: var(--bg-card-high);
  border-right: 1px solid var(--border);
  padding: 44px 40px;
  display: flex;
  align-items: center;
}
.login-brand__inner { width: 100%; }

.login-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 16px;
}
.login-heading {
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.login-subhead {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 30ch;
}

.login-chart {
  margin: 0 -6px 28px;
}
.login-chart svg { width: 100%; height: auto; display: block; }

.login-chart__line {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: login-draw-line 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
.login-chart__area {
  opacity: 0;
  animation: login-fade-in 1s ease-out 1.1s forwards;
}
.login-chart__dot {
  opacity: 0;
  transform-origin: 400px 18px;
  animation: login-pop-in 0.5s ease-out 1.7s forwards, login-pulse 2.2s ease-in-out 2.3s infinite;
}
@keyframes login-draw-line { to { stroke-dashoffset: 0; } }
@keyframes login-fade-in { to { opacity: 1; } }
@keyframes login-pop-in { to { opacity: 1; transform: scale(1); } }
@keyframes login-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 6px var(--emerald)); }
}
@media (prefers-reduced-motion: reduce) {
  .login-chart__line, .login-chart__area, .login-chart__dot {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
}
.login-badge .material-symbols-outlined {
  font-size: 16px;
  color: var(--emerald);
}

/* ---------- Form panel ---------- */
.login-panel {
  padding: 44px 40px;
}

/* Desk / role tabs */
.login-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-card-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
  margin-bottom: 26px;
}
.login-tab {
  flex: 1 1 30%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 9px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.login-tab:hover { color: var(--text-primary); }
.login-tab.active {
  background: var(--emerald);
  color: var(--btn-text);
  font-weight: 700;
}

/* ---------- Interactive input fields (floating label + glow) ---------- */
.login-panel .field-group,
.login-modal-content .field-group {
  margin-bottom: 28px;
}
.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: var(--radius-sm);
}

/* Soft blurred glow that sweeps behind the field on focus */
.login-input-wrap::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-sm) + 3px);
  background: linear-gradient(120deg, transparent 15%, var(--emerald) 50%, transparent 85%);
  background-size: 260% 100%;
  background-position: 200% 0;
  opacity: 0;
  filter: blur(7px);
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.login-input-wrap:focus-within::before {
  opacity: 0.6;
  animation: login-shimmer 1.6s ease-in-out infinite;
}
@keyframes login-shimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -60% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .login-input-wrap:focus-within::before { animation: none; opacity: 0.35; }
}

.login-float-input {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 20px 16px 6px 42px;
  font-size: 15px;
  background: var(--bg-card-high);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease, background 0.25s ease;
  caret-color: var(--emerald);
}
.login-input-wrap:hover .login-float-input { border-color: var(--border-hover); }
.login-input-wrap--password .login-float-input { padding-right: 46px; }

.login-input-wrap:focus-within .login-float-input {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-glow2);
  transform: translateY(-1px);
  background: var(--bg-card);
}

.login-input-icon {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.login-input-wrap:focus-within .login-input-icon {
  color: var(--emerald);
  transform: scale(1.12);
}

/* Floating label: rests inside the field until focused or filled, then
   lifts above the border — reacts continuously as you type, not just
   on/off at focus. */
.login-float-label {
  position: absolute;
  left: 42px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14.5px;
  color: var(--text-muted);
  pointer-events: none;
  transition: top 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.2s ease,
              font-size 0.2s ease;
  transform-origin: left center;
  z-index: 2;
  background: transparent;
  padding: 0 4px;
  white-space: nowrap;
}
.login-float-input:focus ~ .login-float-label,
.login-float-input:not(:placeholder-shown) ~ .login-float-label {
  top: 0;
  transform: translateY(-50%) scale(0.82);
  background: var(--bg-card);
}
.login-float-input:focus ~ .login-float-label {
  color: var(--emerald);
}
.login-required {
  color: var(--danger);
  margin-left: 2px;
}

/* Thin animated line under the field, echoing the brand panel's chart line */
.login-input-underline {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--emerald);
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.login-input-wrap:focus-within .login-input-underline { width: calc(100% - 6px); }

/* Empty-submit shake feedback */
.login-input-wrap.is-invalid .login-float-input {
  border-color: var(--danger);
}
.login-input-wrap.login-shake {
  animation: login-shake 0.4s ease;
}
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-input-wrap.login-shake { animation: none; }
}

/* Password visibility toggle */
.login-pass-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  z-index: 2;
  transition: color 0.2s ease;
}
.login-pass-toggle:hover { color: var(--emerald); }


.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.login-remember input { accent-color: var(--emerald); }

.login-link {
  background: none;
  border: none;
  color: var(--emerald);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.login-link:hover { text-decoration: underline; }

.login-alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.login-alert--error {
  background: light-dark(rgba(177,5,5,0.06), rgba(248,113,113,0.08));
  border-color: light-dark(rgba(177,5,5,0.3), rgba(248,113,113,0.3));
  color: var(--danger);
}
.login-alert--success {
  background: var(--emerald-glow2);
  border-color: var(--border-hover);
  color: var(--emerald);
}

.login-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: var(--btn-text);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
#loginSubmit:disabled,
#forgotSendBtn:disabled,
#forgotVerifyBtn:disabled { opacity: 0.65; cursor: not-allowed; }

/* ---------- Modal ---------- */
.login-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
}
.login-modal-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 4px;
}
.login-modal-dot {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: var(--transition);
}
.login-modal-dot.active { background: var(--emerald); }
.login-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.login-modal-step { display: none; }
.login-modal-step.active { display: block; }
.login-success-icon {
  font-size: 46px;
  color: var(--emerald);
}
.btn-close { filter: light-dark(none, invert(1)); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .login-brand {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 32px 28px 28px;
  }
  .login-heading { font-size: 1.5rem; }
  .login-subhead { max-width: none; margin-bottom: 22px; }
  .login-chart { margin-bottom: 20px; }
  .login-panel { padding: 32px 28px; }
}

@media (max-width: 420px) {
  .login-body { padding: 36px 0 60px; }
  .login-brand, .login-panel { padding-left: 20px; padding-right: 20px; }
}