/* Login — Frota Analytics
   Disposition A: ~42/58 full-bleed split, vertically centered.
   Presence: organic brand atmosphere + editorial type + quiet form texture. */

html.login-page,
html.login-page body.login-body {
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

html.login-page body.login-body {
  font-family: "DM Sans", var(--font, sans-serif);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  overflow: hidden;
}

/* === BRAND PANEL === */
.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(36px, 5.5vw, 64px);
  color: #ecfdf3;
  background:
    linear-gradient(158deg, #0b2e1c 0%, #14532d 46%, #176b38 78%, #15803d 100%);
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.login-brand-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
}

.login-brand-orb--a {
  width: min(70%, 420px);
  height: min(55%, 340px);
  left: -12%;
  bottom: -8%;
  background: rgba(34, 197, 94, 0.28);
}

.login-brand-orb--b {
  width: min(55%, 320px);
  height: min(45%, 280px);
  right: -10%;
  top: -6%;
  background: rgba(6, 78, 40, 0.55);
  opacity: 0.7;
}

/* Soft route arcs — geometric, not neon grid */
.login-brand-route {
  position: absolute;
  inset: -20% -10%;
  opacity: 0.14;
  background:
    radial-gradient(ellipse 90% 70% at 15% 80%, transparent 42%, rgba(255, 255, 255, 0.35) 43%, transparent 44%),
    radial-gradient(ellipse 110% 80% at 85% 20%, transparent 48%, rgba(255, 255, 255, 0.22) 49%, transparent 50%);
}

.login-brand-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: login-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-eyebrow {
  margin: 0 0 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(220, 252, 231, 0.72);
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #dcfce7;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-mark--sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--accent-strong, #166534);
  background: var(--accent-soft, #dcfce7);
  border-color: transparent;
}

.login-brand-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.login-logo {
  margin: 0;
  font-family: Sora, "DM Sans", sans-serif;
  font-size: clamp(1.95rem, 3.1vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: #fff;
}

.login-logo span {
  font-weight: 600;
  color: #bbf7d0;
}

.login-logo--sm {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.login-logo--sm span {
  color: inherit;
}

.login-version {
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(220, 252, 231, 0.85);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-tagline {
  position: relative;
  margin: 0 0 28px;
  padding-left: 2px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(236, 253, 243, 0.9);
  max-width: 34ch;
}

.login-tagline-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65em;
  line-height: 0;
  vertical-align: -0.28em;
  margin-right: 4px;
  color: rgba(187, 247, 208, 0.55);
}

.login-points {
  list-style: none;
  margin: 0 0 32px;
  padding: 20px 0 0;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-points li {
  font-size: 0.93rem;
  line-height: 1.4;
  color: rgba(220, 252, 231, 0.9);
  padding-left: 14px;
  border-left: 2px solid rgba(134, 239, 172, 0.45);
}

.login-brand-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(187, 247, 208, 0.45);
}

/* === FORM PANEL === */
.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
  background: var(--bg-app);
  min-height: 0;
  overflow: auto;
  isolation: isolate;
}

.login-panel-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(21, 128, 61, 0.045) 0%, transparent 42%, rgba(15, 23, 42, 0.02) 100%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(21, 128, 61, 0.06), transparent 55%);
  opacity: 1;
}

.login-panel-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

.login-theme {
  position: absolute;
  top: 20px;
  right: 20px;
  width: auto;
  min-width: 40px;
  margin: 0;
  padding: 8px 10px;
  z-index: 2;
  background: var(--bg-card);
}

.login-form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: login-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-form-lead {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-strong, #166534);
}

.login-form-title {
  margin: 0 0 8px;
  font-family: Sora, "DM Sans", sans-serif;
  font-size: clamp(1.7rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text-primary);
}

.login-form-sub {
  margin: 0 0 30px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.login-field span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.login-field input:hover {
  border-color: color-mix(in srgb, var(--text-muted) 70%, var(--border));
}

.login-field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

.login-submit {
  margin-top: 10px;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #166534;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 20px rgba(22, 101, 52, 0.18);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.login-submit-icon {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.login-submit:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 12px 24px rgba(22, 101, 52, 0.22);
}

.login-submit:hover .login-submit-icon {
  transform: translateX(3px);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 4px 12px rgba(22, 101, 52, 0.16);
}

.login-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === DARK === */
:root[data-theme="dark"] .login-brand {
  background: linear-gradient(158deg, #07150e 0%, #0c1f14 42%, #123524 78%, #14532d 100%);
}

:root[data-theme="dark"] .login-brand-orb--a {
  background: rgba(34, 197, 94, 0.18);
}

:root[data-theme="dark"] .login-brand-orb--b {
  background: rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .login-logo {
  color: #f0fdf4;
}

:root[data-theme="dark"] .login-logo span {
  color: #86efac;
}

:root[data-theme="dark"] .login-eyebrow,
:root[data-theme="dark"] .login-tagline,
:root[data-theme="dark"] .login-points li {
  color: rgba(232, 239, 233, 0.84);
}

:root[data-theme="dark"] .login-mark {
  color: #bbf7d0;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .login-points {
  border-top-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .login-points li {
  border-left-color: rgba(134, 239, 172, 0.35);
}

:root[data-theme="dark"] .login-brand-meta {
  color: rgba(134, 239, 172, 0.35);
}

:root[data-theme="dark"] .login-panel-wash {
  background:
    linear-gradient(155deg, rgba(34, 197, 94, 0.05) 0%, transparent 45%, rgba(0, 0, 0, 0.15) 100%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(34, 197, 94, 0.07), transparent 55%);
}

:root[data-theme="dark"] .login-panel-wash::after {
  mix-blend-mode: soft-light;
  opacity: 0.22;
}

:root[data-theme="dark"] .login-submit {
  background: #15803d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .login-submit:hover {
  background: #16a34a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 14px 28px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .login-form-lead {
  color: var(--accent-strong);
}

:root[data-theme="dark"] .login-mark--sm {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

/* === MOBILE === */
@media (max-width: 900px) {
  html.login-page,
  html.login-page body.login-body {
    overflow: auto;
  }

  .login-shell {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: visible;
  }

  .login-brand {
    padding: 32px 24px 28px;
    align-items: flex-start;
  }

  .login-brand-inner {
    max-width: none;
  }

  .login-brand-orb--a,
  .login-brand-orb--b {
    filter: blur(36px);
    opacity: 0.4;
  }

  .login-tagline {
    margin-bottom: 0;
    font-size: 0.98rem;
  }

  .login-points,
  .login-brand-meta {
    display: none;
  }

  .login-panel {
    align-items: flex-start;
    padding: 32px 24px 48px;
    overflow: visible;
  }

  .login-theme {
    top: 16px;
    right: 16px;
  }

  .login-mobile-brand {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-brand {
    padding: 24px 20px 22px;
  }

  .login-logo {
    font-size: 1.6rem;
  }

  .login-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .login-brand-row {
    gap: 12px;
    margin-bottom: 14px;
  }

  .login-eyebrow {
    margin-bottom: 14px;
  }

  .login-panel {
    padding: 28px 20px 40px;
  }

  .login-form {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand-inner,
  .login-form {
    animation: none;
  }

  .login-field input,
  .login-submit,
  .login-submit-icon {
    transition: none;
  }

  .login-submit:hover {
    transform: none;
  }

  .login-submit:hover .login-submit-icon {
    transform: none;
  }
}
