/* Legal Bovur — login (tinta · piedra · bronce) */

.gate-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: #f5f2eb;
  background: #1e2a36;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    url("/assets/logo-pjud.png") center 42% / min(320px, 42vw) no-repeat,
    linear-gradient(145deg, #1e2a36 0%, #243140 48%, #2a3848 100%);
  opacity: 0.85;
}

.gate-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, rgba(30, 42, 54, 0.35) 0%, transparent 70%),
    linear-gradient(180deg, rgba(30, 42, 54, 0.55) 0%, rgba(30, 42, 54, 0.2) 42%, rgba(30, 42, 54, 0.65) 100%);
}

.gate-lights {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.gate-light {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(196, 168, 120, 0.55);
  box-shadow:
    0 0 4px 1px rgba(107, 90, 62, 0.35),
    0 0 10px 3px rgba(107, 90, 62, 0.18);
  animation: gate-flicker var(--dur, 2.8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.55;
}

.gate-light--a { left: 18%; top: 22%; --dur: 2.1s; --delay: 0s; width: 4px; height: 4px; }
.gate-light--b { left: 32%; top: 38%; --dur: 2.8s; --delay: 0.4s; }
.gate-light--c { left: 48%; top: 28%; --dur: 1.9s; --delay: 0.9s; }
.gate-light--d { left: 61%; top: 44%; --dur: 3.1s; --delay: 0.2s; }
.gate-light--e { left: 72%; top: 31%; --dur: 2.3s; --delay: 1.1s; width: 4px; height: 4px; }
.gate-light--f { left: 27%; top: 58%; --dur: 2.6s; --delay: 0.7s; }
.gate-light--g { left: 55%; top: 62%; --dur: 2.2s; --delay: 1.4s; }
.gate-light--h { left: 78%; top: 52%; --dur: 2.9s; --delay: 0.5s; width: 4px; height: 4px; }

@keyframes gate-flicker {
  0%, 100% { opacity: 0.4; transform: scale(0.92); }
  8% { opacity: 0.85; transform: scale(1.05); }
  12% { opacity: 0.3; transform: scale(0.9); }
  40% { opacity: 0.55; transform: scale(1); }
  55% { opacity: 0.8; transform: scale(1.06); }
  78% { opacity: 0.5; transform: scale(1); }
}

@keyframes gate-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gate-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 12px 20px 0;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  animation: gate-enter 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.gate-top-logo {
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.gate-main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 14px 48px;
  box-sizing: border-box;
}

.gate-card {
  width: min(280px, 100%);
  padding: 28px 20px 22px;
  border-radius: 4px;
  background: rgba(250, 249, 246, 0.94);
  border: 1px solid rgba(224, 219, 210, 0.55);
  box-shadow: 0 8px 24px rgba(30, 42, 54, 0.28);
  color: #2a3038;
  animation: gate-enter 280ms cubic-bezier(0.4, 0, 0.2, 1) 60ms both;
}

.gate-card h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #2a3038;
}

.gate-brand {
  margin: 8px 0 18px;
}

.gate-brand-line {
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 8px;
  background: #6b5a3e;
  border-radius: 1px;
}

.gate-brand-text {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #7a828c;
}

.gate-form {
  display: grid;
  gap: 12px;
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gate-field > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a616a;
}

.gate-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e0dbd2;
  border-radius: 3px;
  background: #faf9f6;
  color: #2a3038;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gate-field input:focus {
  outline: none;
  border-color: rgba(107, 90, 62, 0.55);
  box-shadow: 0 0 0 3px rgba(107, 90, 62, 0.12);
}

.gate-field.is-invalid input {
  box-shadow: 0 0 0 2px rgba(166, 61, 61, 0.35);
}

.gate-pass {
  position: relative;
  display: flex;
}

.gate-pass input {
  padding-right: 58px;
}

.gate-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #7a828c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.12s ease;
}

.gate-eye:hover {
  color: #6b5a3e;
}

.gate-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  margin-top: 1px;
}

.gate-remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5a616a;
  cursor: pointer;
  user-select: none;
}

.gate-remember input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.gate-check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #cdc6ba;
  background: #faf9f6;
  box-sizing: border-box;
  position: relative;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.gate-check::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4px;
  height: 8px;
  border: solid #faf9f6;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.gate-remember:hover .gate-check {
  border-color: #6b5a3e;
}

.gate-remember input:focus-visible + .gate-check {
  box-shadow: 0 0 0 2px rgba(107, 90, 62, 0.25);
}

.gate-remember input:checked + .gate-check {
  background: #6b5a3e;
  border-color: #6b5a3e;
}

.gate-remember input:checked + .gate-check::after {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}

.gate-recover {
  color: #7a828c;
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
  transition: color 0.12s ease;
}

.gate-recover:hover {
  color: #6b5a3e;
  text-decoration: underline;
}

.gate-btn {
  width: 100%;
  height: 36px;
  margin-top: 6px;
  border: 0;
  border-radius: 3px;
  background: #6b5a3e;
  color: #faf9f6;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s ease, opacity 0.15s ease;
}

.gate-btn:hover:not(:disabled) {
  background: #56482f;
}

.gate-btn:active:not(:disabled) {
  background: #4a3e28;
}

.gate-btn:focus-visible {
  outline: 2px solid #6b5a3e;
  outline-offset: 2px;
}

.gate-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.gate-alert {
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 11px;
  margin-bottom: 10px;
}

.gate-alert-error {
  background: #f7ecec;
  border: 1px solid #e8c8c8;
  color: #a63d3d;
}

.gate-alert-info {
  background: #efece6;
  border: 1px solid #e0dbd2;
  color: #5a616a;
}

.gate-foot {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(245, 242, 235, 0.45);
  pointer-events: none;
  animation: gate-enter 300ms cubic-bezier(0.4, 0, 0.2, 1) 120ms both;
}

.gate-foot-sep {
  opacity: 0.5;
}

@media (max-width: 640px) {
  .gate-top { padding: 10px 12px 0; }
  .gate-top-logo { height: 44px; }
  .gate-main { padding: 48px 12px 44px; }
  .gate-card { width: min(100%, 280px); padding: 24px 16px 20px; }
  .gate-card h1 { font-size: 18px; }
  .gate-foot { flex-direction: column; gap: 2px; }
  .gate-foot-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-top, .gate-card, .gate-foot { animation: none; }
  .gate-field input, .gate-btn, .gate-check, .gate-check::after, .gate-eye, .gate-recover { transition: none; }
  .gate-light { animation: none; opacity: 0.55; }
}
