/* ============================================
   VSuite One – Admin Login (Landing style)
   ============================================ */

:root {
  --login-ink: #1b292f;
  --login-ink-soft: #40555e;
  --login-muted: #60727a;
  --login-primary: #087da3;
  --login-primary-hover: #075b79;
  --login-primary-light: rgba(8, 125, 163, 0.1);
  --login-surface: #ffffff;
  --login-border: #d5e2e6;
  --login-border-focus: #087da3;
  --login-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 10px 20px -5px rgba(15, 23, 42, 0.1);
  --login-shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
  --login-radius: 12px;
  --login-radius-lg: 16px;
  --login-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --login-transition: 0.2s ease;
}

body.login {
  font-family: var(--login-font);
  background: #edf5f7;
  color: var(--login-ink);
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.login #nav-sidebar,
body.login #nav-filter,
body.login #toggle-nav-sidebar,
body.login #content-related,
body.login #recent-actions,
body.login .breadcrumbs {
  display: none !important;
}

body.login #content {
  padding: 0;
  max-width: none;
}

/* ----- Layout ----- */
.login-landing {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

/* ----- Hero (left) ----- */
.login-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  overflow: hidden;
  min-height: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #202d32 0%, #29444d 52%, #075b79 100%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  filter: blur(40px);
}

.hero-shape-1 {
  width: 400px;
  height: 400px;
  top: -120px;
  right: -120px;
}

.hero-shape-2 {
  width: 280px;
  height: 280px;
  bottom: -80px;
  left: -80px;
}

.hero-shape-3 {
  width: 180px;
  height: 180px;
  top: 50%;
  left: 20%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
}

.hero-logo {
  width: 100px;
  height: auto;
  min-height: 36px;
  margin-bottom: 10px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
}

.hero-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-tagline {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
}

.hero-features {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.hero-feature-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
}

.hero-docs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
}

.hero-doc-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-weight: 700;
}

.hero-doc-link:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.hero-doc-sep {
  color: rgba(255, 255, 255, 0.5);
}

/* ----- Form side (right) ----- */
.login-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--login-surface);
  min-height: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 16px 20px;
  border-radius: var(--login-radius);
  border: 1px solid var(--login-border);
  box-shadow: var(--login-shadow-lg);
  background: var(--login-surface);
}

.login-card-header {
  margin-bottom: 10px;
}

.login-card-title {
  margin: 0 0 2px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--login-ink);
  letter-spacing: -0.02em;
}

.login-card-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--login-muted);
}

/* ----- Form ----- */
.login-form .form-row {
  margin-bottom: 8px;
}

.login-form .form-row .errorlist {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: #b91c1c;
}

.login-form .form-row:has(.errorlist) .input-shell {
  border-color: #b91c1c;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.15);
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--login-ink);
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--login-border);
  border-radius: 10px;
  padding: 0 10px;
  background: #f8fafc;
  transition: border-color var(--login-transition), box-shadow var(--login-transition), background var(--login-transition);
}

.input-shell:focus-within {
  border-color: var(--login-border-focus);
  box-shadow: 0 0 0 3px var(--login-primary-light);
  background: var(--login-surface);
}

.input-icon {
  color: var(--login-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.input-icon-lock {
  font-size: 0.75rem;
  opacity: 0.8;
}

.input-field {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 0.85rem;
  font-family: var(--login-font);
  color: var(--login-ink);
  outline: none;
}

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

.form-helper {
  margin: -2px 0 6px;
}

.form-helper a {
  font-size: 0.875rem;
  color: var(--login-primary);
  text-decoration: none;
  font-weight: 500;
}

.form-helper a:hover {
  text-decoration: underline;
}

.submit-row {
  margin-top: 2px;
  margin-bottom: 6px;
}

.btn-primary {
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--login-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--login-font);
  cursor: pointer;
  transition: background var(--login-transition), transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-primary:hover {
  background: var(--login-primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.form-note {
  margin: 0;
  font-size: 0.68rem;
  color: var(--login-muted);
  line-height: 1.3;
}

.form-note-policies {
  margin-top: 4px;
}

.form-note-policies a {
  color: var(--login-primary);
  text-decoration: none;
  font-weight: 500;
}

.form-note-policies a:hover {
  text-decoration: underline;
}

.form-note-sep {
  margin: 0 6px;
  opacity: 0.7;
}

/* ----- Demo credentials: compacto para no requerir scroll ----- */
.demo-credentials {
  margin-top: 12px;
  padding: 0;
  border-radius: 10px;
  background: rgba(11, 58, 109, 0.14);
  border: 1px solid rgba(11, 58, 109, 0.35);
  box-shadow: 0 4px 12px rgba(11, 58, 109, 0.12);
  overflow: hidden;
}

.demo-credentials-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(11, 58, 109, 0.2);
}

.demo-credentials-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--login-primary);
  margin-bottom: 2px;
}

.demo-credentials-title {
  margin: 0 0 2px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--login-ink);
  letter-spacing: -0.02em;
}

.demo-credentials-desc {
  margin: 0;
  font-size: 0.7rem;
  color: var(--login-ink-soft);
  line-height: 1.35;
}

.demo-credentials-fields {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-cred-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-cred-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--login-ink-soft);
}

.demo-cred-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.demo-cred-value {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(11, 58, 109, 0.4);
  border-radius: 4px;
  color: #0f172a;
  word-break: break-all;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.demo-copy-btn {
  flex-shrink: 0;
  padding: 0 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #0b3a6d;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.demo-copy-btn:hover {
  background: #fff;
  color: #0a2f58;
  border-color: #fff;
}

.demo-copy-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.demo-modules {
  padding: 4px 10px 6px;
  border-top: 1px solid rgba(11, 58, 109, 0.2);
  background: rgba(11, 58, 109, 0.08);
}

.demo-modules-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--login-ink-soft);
  margin-bottom: 2px;
}

.demo-modules-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
}

.demo-modules-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
}

.login-card-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--login-border);
  text-align: center;
}

.login-meta {
  font-size: 0.68rem;
  color: var(--login-muted);
  margin-bottom: 2px;
}

.meta-item {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.meta-sep {
  margin: 0 6px;
  opacity: 0.6;
}

.meta-env.env-dev { color: #b91c1c; }
.meta-env.env-staging { color: #b45309; }
.meta-env.env-prod { color: #16a34a; }

.login-copy {
  font-size: 0.72rem;
  color: var(--login-ink-soft);
}

/* Modules pill */
.modules-pill {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: var(--login-radius);
  background: var(--login-primary-light);
  border: 1px solid var(--login-border);
  max-width: 460px;
  width: 100%;
}

.modules-pill-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--login-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.modules-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.modules-pill-item {
  font-size: 0.8rem;
  color: var(--login-ink-soft);
  font-weight: 500;
}

/* Non-field errors (e.g. invalid login) */
.login-form .errorlist.nonfield {
  list-style: none;
  padding: 8px 10px;
  margin: 0 0 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #b91c1c;
}

/* Env badge */
.env-badge {
  position: fixed;
  top: 16px;
  right: 20px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--login-shadow);
  z-index: 1000;
  font-family: var(--login-font);
}

.env-badge-dev { background: #b91c1c; }
.env-badge-staging { background: #b45309; }
.env-badge-prod { background: #16a34a; }

/* ----- Responsive: todo compacto para no scroll ----- */
@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 12px 20px 16px;
    min-height: auto;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-logo {
    width: 80px;
    margin-bottom: 8px;
  }

  .hero-title {
    font-size: 1.1rem;
  }

  .hero-tagline {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }

  .hero-features {
    margin-bottom: 8px;
  }

  .hero-features li {
    margin-bottom: 3px;
    font-size: 0.72rem;
  }

  .login-form-wrap {
    padding: 10px 14px 14px;
  }

  .login-card {
    padding: 14px 16px;
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 480px) {
  .login-hero {
    padding: 10px 14px 12px;
  }

  .hero-title {
    font-size: 1rem;
  }

  .hero-features li {
    font-size: 0.68rem;
  }

  .login-card {
    padding: 12px 14px;
    max-height: calc(100vh - 20px);
  }

  .login-card-title {
    font-size: 1rem;
  }
}

/* Match the centered admin-frontend login shell. */
body.login #container {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 15%, rgba(31, 181, 224, 0.16), transparent 30%),
    radial-gradient(circle at 88% 85%, rgba(8, 125, 163, 0.14), transparent 34%),
    linear-gradient(145deg, #f8fbfc 0%, #e7f1f4 50%, #f2f7f8 100%);
}

.login-landing {
  position: relative;
  display: grid;
  min-height: 100vh;
  height: auto;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
}

.login-landing::before {
  position: fixed;
  inset: 0;
  content: "";
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(8, 125, 163, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 125, 163, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.login-split {
  position: relative;
  width: min(976px, 100%);
  min-height: min(624px, calc(100vh - 80px));
  max-height: calc(100vh - 32px);
  grid-template-columns: minmax(0, 1.05fr) minmax(368px, 0.95fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 32px 80px rgba(25, 53, 63, 0.16), 0 4px 16px rgba(25, 53, 63, 0.08);
  animation: login-shell-enter 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-shell-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-hero {
  padding: clamp(32px, 5vw, 64px);
}

.hero-content {
  max-width: 390px;
}

.hero-logo {
  width: 112px;
  margin-bottom: 22px;
}

.hero-title {
  margin-bottom: 10px;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.1;
}

.hero-tagline {
  margin-bottom: 26px;
  font-size: 14px;
  line-height: 1.65;
}

.hero-features {
  margin-bottom: 26px;
}

.hero-features li {
  gap: 10px;
  margin-bottom: 11px;
  font-size: 12px;
}

.hero-feature-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.login-form-wrap {
  padding: 28px clamp(24px, 4vw, 48px);
  background: #ffffff;
}

.login-card {
  max-width: 390px;
  max-height: calc(100vh - 96px);
  padding: 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-card-header {
  margin-bottom: 24px;
}

.login-card-title {
  margin-bottom: 6px;
  color: #1b292f;
  font-size: 24px;
}

.login-card-subtitle {
  color: #60727a;
  font-size: 12px;
}

.login-form .form-row {
  margin-bottom: 15px;
}

.form-label {
  margin-bottom: 7px;
  color: #30434b;
  font-size: 12px;
}

.input-shell {
  min-height: 50px;
  padding: 0 14px;
  border-width: 1px;
  border-radius: 13px;
  background: #fbfcfe;
}

.input-shell:focus-within {
  box-shadow: 0 0 0 4px rgba(8, 125, 163, 0.14);
}

.input-field {
  min-height: 48px;
  padding: 0;
  font-size: 14px;
}

.btn-primary {
  min-height: 50px;
  margin-top: 8px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0b8cb7, #075b79);
  box-shadow: 0 10px 22px rgba(7, 91, 121, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0b95c4, #086584);
  box-shadow: 0 14px 26px rgba(7, 91, 121, 0.28);
  transform: translateY(-1px);
}

.demo-credentials {
  border-color: #b9dce6;
  background: #e7f7fc;
  box-shadow: none;
}

.demo-credentials-header,
.demo-modules {
  border-color: #b9dce6;
}

.demo-credentials-badge,
.demo-copy-btn,
.form-helper a,
.form-note-policies a {
  color: #075b79;
}

@media (max-width: 900px) {
  body.login {
    height: auto;
    overflow: auto;
  }

  .login-landing {
    display: block;
    padding: 14px;
  }

  .login-split {
    width: 100%;
    min-height: calc(100vh - 28px);
    max-height: none;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .login-hero {
    padding: 28px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-features {
    display: none;
  }

  .login-form-wrap {
    max-height: none;
    padding: 28px 22px;
    overflow: visible;
  }

  .login-card {
    max-height: none;
    overflow: visible;
  }
}
