/* MFA login screen — overlay mode on blurred dashboard ghost */

.lg-app {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

/* ── Overlay mode ─────────────────────────────────────────── */
.lg-overlay {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.lg-overlay-bg {
  position: absolute;
  inset: 0;
  filter: blur(14px) saturate(1.05);
  transform: scale(1.04);
  pointer-events: none;
  z-index: 0;
  background: var(--bg);
}
.lg-overlay-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,24,31,0.45) 0%, rgba(20,24,31,0.6) 100%);
  z-index: 1;
}
.lg-overlay-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

/* ── Card ─────────────────────────────────────────────────── */
.lg-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 10px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.1);
  padding: 28px 32px;
  animation: lg-pop .25s cubic-bezier(.2,.7,.3,1);
}
@keyframes lg-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.lg-card-overlay-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.lg-card-overlay-mark {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: #f5f3ee;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.lg-overlay-card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.lg-overlay-card-sub {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ── Step content ─────────────────────────────────────────── */
.lg-step { display: flex; flex-direction: column; }
.lg-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.2;
}
.lg-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 24px;
  line-height: 1.55;
}
.lg-sub strong { color: var(--ink); font-weight: 600; }

.lg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.lg-field-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.lg-input {
  font-family: inherit;
  font-size: 14px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.lg-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(30,42,58,.14);
}

.lg-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .12s, color .12s, opacity .12s;
  text-decoration: none;
  width: 100%;
}
.lg-btn.primary {
  background: var(--navy);
  color: #f5f3ee;
  border-color: var(--navy);
}
.lg-btn.primary:hover:not(:disabled) { background: var(--navy-2); }
.lg-btn:disabled { opacity: .5; cursor: not-allowed; }
.lg-btn.loading { cursor: progress; }

.lg-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* Code inputs */
.lg-code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.lg-code-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  height: 56px;
  text-align: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
  min-width: 0;
  padding: 0;
}
.lg-code-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(30,42,58,.14);
  background: #fafaf6;
}
.lg-code-row.error .lg-code-input {
  border-color: var(--st-rejected);
  background: var(--st-rejected-bg);
  animation: lg-shake .4s ease-out;
}
@keyframes lg-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.lg-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--st-rejected);
  margin-bottom: 14px;
}

.lg-back {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}
.lg-back:hover { color: var(--ink); }

.lg-resend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.lg-linkbtn {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: none;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(30,42,58,.3);
  text-underline-offset: 2px;
}
.lg-linkbtn:hover { text-decoration-color: var(--navy); }

/* Success */
.lg-success { align-items: center; text-align: center; padding: 12px 0 4px; }
.lg-check-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--st-signed-bg);
  color: var(--st-signed);
  display: grid; place-items: center;
  margin-bottom: 20px;
  animation: lg-success-pop .35s cubic-bezier(.2,.7,.3,1);
}
.lg-check { animation: lg-check-draw .5s ease-out .1s both; }
@keyframes lg-success-pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes lg-check-draw {
  from { stroke-dasharray: 80; stroke-dashoffset: 80; }
  to   { stroke-dasharray: 80; stroke-dashoffset: 0; }
}

/* Spinner */
.lg-spin { animation: lg-spin 1s linear infinite; transform-origin: center; }
@keyframes lg-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ── Dashboard ghost (blurred backdrop) ──────────────────── */
.lg-ghost {
  width: 100%;
  height: 100%;
  padding: 16px 28px;
  background: var(--bg);
  color: var(--ink);
}
.lg-ghost-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  padding: 14px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.lg-ghost-brand { display: flex; align-items: center; gap: 12px; }
.lg-ghost-mark {
  width: 34px; height: 34px;
  background: var(--navy);
  color: #f5f3ee;
  border-radius: var(--r-md);
  display: grid; place-items: center;
}
.lg-ghost-name { font-family: var(--font-serif); font-size: 16px; font-weight: 500; }
.lg-ghost-sub { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.lg-ghost-btn {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
}

.lg-ghost-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.lg-ghost-metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.lg-ghost-metric-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.lg-ghost-metric-v {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 4px;
}
.lg-ghost-metric.tone-pending .lg-ghost-metric-v { color: var(--st-pending); }
.lg-ghost-metric.tone-signed .lg-ghost-metric-v { color: var(--st-signed); }
.lg-ghost-metric.tone-rejected .lg-ghost-metric-v { color: var(--st-rejected); }
.lg-ghost-metric.tone-expired .lg-ghost-metric-v { color: var(--st-expired); }

.lg-ghost-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.lg-ghost-search, .lg-ghost-select {
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--ink-3);
}

.lg-ghost-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.lg-ghost-thead, .lg-ghost-row {
  display: grid;
  grid-template-columns: 80px 1fr 110px 180px 110px 80px;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
}
.lg-ghost-thead {
  background: var(--surface-2);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.lg-ghost-row {
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.lg-ghost-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.lg-ghost-name-t { font-weight: 500; }
.lg-ghost-name-s { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.lg-ghost-pill {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.lg-ghost-pill.pendiente { color: var(--st-pending); background: var(--st-pending-bg); }
.lg-ghost-pill.firmado  { color: var(--st-signed); background: var(--st-signed-bg); }
.lg-ghost-pill.rechazado { color: var(--st-rejected); background: var(--st-rejected-bg); }
.lg-ghost-pill.expirado { color: var(--st-expired); background: var(--st-expired-bg); }
.lg-ghost-signer { color: var(--ink-2); }
.lg-ghost-date { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lg-ghost-actions { display: flex; gap: 4px; justify-content: flex-end; }
.lg-ghost-iconbtn {
  width: 26px; height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  display: inline-block;
}
.lg-ghost-iconbtn.primary { background: var(--navy); border-color: var(--navy); }

/* Responsive */
@media (max-width: 560px) {
  .lg-card { padding: 24px 20px; max-width: 100%; }
  .lg-title { font-size: 20px; }
  .lg-code-input { height: 48px; font-size: 18px; }
}
