/* =========================================================================
   AVARN OMC — login page (3D scene)
   ========================================================================= */
html, body.login-body { height: 100%; margin: 0; }
body.login-body {
  background: #15171a; color: var(--ink); font-family: var(--sans);
  overflow: hidden; display: block;
}

.scene { position: fixed; inset: 0; perspective: 1400px; overflow: hidden; }
.scene-bg {
  position: absolute; inset: -6%; background-size: cover; background-position: center;
  filter: saturate(1.05) brightness(.9);
  transform: translate3d(var(--bgx, 0), var(--bgy, 0), 0) scale(1.04);
  transition: transform .25s ease-out;
}
.scene-fog {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 55%, rgba(21,23,26,.55), rgba(21,23,26,.85) 70%, rgba(21,23,26,.95)),
    linear-gradient(0deg, rgba(21,23,26,.9), transparent 35%);
}

/* floating particles */
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particles i {
  position: absolute; display: block; width: 4px; height: 4px; border-radius: 50%;
  background: #4ccfd2; opacity: 0; box-shadow: 0 0 10px #4ccfd2, 0 0 22px rgba(76,207,210,.5);
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .5; }
  100% { transform: translate3d(var(--dx, 0px), -110vh, 0) scale(1.2); opacity: 0; }
}

/* 3D stage */
.stage {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease-out;
  padding: 24px;
}

/* ---- 3D logo ---- */
.logo3d {
  position: relative; width: 260px; height: 156px; transform-style: preserve-3d;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-10px) translateZ(0); } }
.logo-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.l-shadow { transform: translateZ(-40px) translateY(18px); filter: blur(14px) brightness(0); opacity: .45; }
.l-glow   { transform: translateZ(-20px); filter: blur(14px) saturate(2) brightness(1.4); opacity: .75; }
.l-base   { transform: translateZ(0);   filter: brightness(.5) saturate(.8) blur(1px); opacity: .35; }
.l-top    { transform: translateZ(34px); filter: drop-shadow(0 0 10px rgba(76,207,210,.55)) drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.logo-ring {
  position: absolute; left: 50%; top: 48%; width: 360px; height: 360px; margin: -180px 0 0 -180px;
  border-radius: 50%; border: 1px solid rgba(76,207,210,.22);
  transform: translateZ(-60px) rotateX(72deg); pointer-events: none;
  box-shadow: 0 0 40px rgba(43,179,182,.12) inset;
  animation: spin 22s linear infinite;
}
.logo-ring.r2 { width: 480px; height: 480px; margin: -240px 0 0 -240px; border-style: dashed; border-color: rgba(76,207,210,.14); animation-duration: 36s; animation-direction: reverse; }
@keyframes spin { to { transform: translateZ(-60px) rotateX(72deg) rotateZ(360deg); } }

/* ---- glass card ---- */
.card {
  position: relative; width: min(420px, 100%); transform: translateZ(50px);
  background: linear-gradient(160deg, rgba(38,43,44,.82), rgba(29,32,33,.78));
  border: 1px solid rgba(255,255,255,.10); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(43,179,182,.12), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  padding: 28px 28px 22px; overflow: hidden;
}
.card-shine {
  position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 0%), rgba(76,207,210,.16), transparent 70%);
  transition: opacity .2s;
}
.card-head .kicker { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; font-weight: 700; color: #7fe3e4; }
.card-head .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ccfd2; box-shadow: 0 0 10px #4ccfd2; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.card-head h1 { margin: 10px 0 6px; font-size: 28px; letter-spacing: -.6px; }
.card-head p { margin: 0 0 20px; color: var(--ink-soft); font-size: 13.5px; }

.field { display: block; margin-bottom: 14px; }
.field .lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .2px; }
.inp {
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: rgba(21,23,26,.7); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.inp:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,179,182,.18), 0 0 18px rgba(43,179,182,.15); background: rgba(21,23,26,.9); }
.inp svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.inp:focus-within svg { stroke: var(--accent); }
.inp input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); font: 500 15px var(--sans); padding: 13px 0; }
.inp input::placeholder { color: var(--ink-faint); }
.eye { background: transparent; border: 0; padding: 6px; cursor: pointer; border-radius: 8px; display: flex; }
.eye:hover { background: rgba(255,255,255,.06); }
.eye.on svg { stroke: var(--accent); }

.row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.chk input { accent-color: var(--brand); width: 15px; height: 15px; }

.err {
  display: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(120,40,40,.35); border: 1px solid rgba(230,120,110,.45); color: #f6c9c2;
}
.err.show { display: block; animation: shake .4s ease; }
@keyframes shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }

.btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font: 700 15px var(--sans); color: #07282a; letter-spacing: .1px;
  background: linear-gradient(135deg, #4ccfd2, #2bb3b6 55%, #1c9396);
  box-shadow: 0 10px 28px rgba(43,179,182,.35), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(43,179,182,.45), inset 0 1px 0 rgba(255,255,255,.35); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn-arrow { transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn.loading .btn-l::after { content: "…"; }

.foot { margin-top: 16px; font-size: 11.5px; color: var(--ink-faint); display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }

.login-meta { position: fixed; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 11.5px; color: var(--ink-faint); letter-spacing: .2px; pointer-events: none; }

/* unlock animation */
.scene.unlock .card { animation: cardOut .55s cubic-bezier(.5,0,.8,.4) forwards; }
.scene.unlock .logo3d { animation: logoOut .6s ease forwards; }
.scene.unlock .scene-bg { transform: scale(1.18); transition: transform .7s ease-in; filter: brightness(1.15); }
@keyframes cardOut { to { transform: translateZ(400px) translateY(-20px); opacity: 0; } }
@keyframes logoOut { to { transform: translateZ(500px) scale(1.3); opacity: 0; filter: blur(6px); } }

@media (max-width: 560px) {
  .logo3d { width: 200px; height: 120px; }
  .logo-ring, .logo-ring.r2 { display: none; }
  .card { padding: 22px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo3d, .logo-ring, .particles i, .card-head .dot { animation: none !important; }
  .stage, .scene-bg { transition: none; transform: none !important; }
}

/* =========================================================================
   Federal-agency look — navy, gold, seal, serif
   ========================================================================= */
body.login-body { background: #15171a; }
.scene-bg { filter: saturate(.8) brightness(.6); }
.scene-fog {
  background:
    radial-gradient(55% 50% at 50% 52%, rgba(21,23,26,.35), rgba(21,23,26,.88) 70%, rgba(21,23,26,.97)),
    linear-gradient(180deg, rgba(21,23,26,.85) 0%, transparent 18%, transparent 82%, rgba(21,23,26,.95) 100%);
}
.scene::before { content: none; }
.scene::after {   /* bottom gold rule */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 3;
  background: linear-gradient(90deg, transparent, #2bb3b6 30%, #7fe3e4 50%, #2bb3b6 70%, transparent);
}
.particles i { background: #7fe3e4; box-shadow: 0 0 8px #7fe3e4, 0 0 18px rgba(127,227,228,.45); }

/* seal around the logo */
.logo3d { width: 300px; height: 300px; }
.logo-layer { inset: 68px 40px; width: auto; height: auto; }
.seal { position: absolute; inset: 0; transform: translateZ(-8px); animation: sealspin 60s linear infinite; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.s-outer { fill: none; stroke: #2bb3b6; stroke-width: 2.5; filter: drop-shadow(0 0 8px rgba(43,179,182,.5)); }
.s-inner { fill: rgba(27,30,31,.55); stroke: rgba(43,179,182,.55); stroke-width: 1; stroke-dasharray: 2 4; }
.s-txt { fill: #7fe3e4; font: 700 13.5px "Georgia", "Times New Roman", serif; letter-spacing: 2.2px; }
.s-small { font-size: 11px; letter-spacing: 3px; fill: #2bb3b6; }
@keyframes sealspin { to { transform: translateZ(-8px) rotate(360deg); } }
.logo-ring { border-color: rgba(43,179,182,.25); box-shadow: 0 0 40px rgba(43,179,182,.10) inset; top: 50%; }
.logo-ring.r2 { border-color: rgba(43,179,182,.16); }
.l-glow { filter: blur(14px) saturate(1.2) brightness(1.2); opacity: .55; }
.l-top { filter: drop-shadow(0 0 8px rgba(76,207,210,.4)) drop-shadow(0 10px 18px rgba(0,0,0,.7)); }

/* card */
.card {
  width: min(400px, 100%); border-radius: 6px;
  background: linear-gradient(180deg, rgba(38,43,44,.92), rgba(29,32,33,.94));
  border: 1px solid rgba(43,179,182,.45);
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 4px rgba(21,23,26,.8), 0 0 0 5px rgba(43,179,182,.25);
  padding: 26px 30px 20px;
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #2bb3b6, #7fe3e4, #2bb3b6); }
.card-shine { background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 0%), rgba(43,179,182,.12), transparent 70%); }
.card-head { text-align: center; margin-bottom: 18px; }
.seal-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.seal-line span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(43,179,182,.6)); }
.seal-line span:last-child { background: linear-gradient(90deg, rgba(43,179,182,.6), transparent); }
.seal-line em { font: 700 10px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #2bb3b6; font-style: normal; white-space: nowrap; }
.card-head h1 { margin: 0; font: 700 34px/1.05 "Georgia", "Times New Roman", serif; letter-spacing: .06em; color: #ffffff; text-transform: uppercase; }
.card-head h1 b { color: #7fe3e4; font-weight: 700; }
.field .lbl { text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; color: #a6b1af; }
.inp { border-radius: 3px; background: rgba(21,23,26,.85); border-color: rgba(166,177,175,.3); }
.inp:focus-within { border-color: #2bb3b6; box-shadow: 0 0 0 3px rgba(43,179,182,.18); }
.inp:focus-within svg { stroke: #7fe3e4; }
.chk { color: #a6b1af; }
.chk input { accent-color: #2bb3b6; }
.btn {
  border-radius: 3px; color: #1b1e1f; text-transform: uppercase; letter-spacing: .18em; font-size: 13px;
  background: linear-gradient(180deg, #7fe3e4, #2bb3b6 60%, #1c9396);
  box-shadow: 0 10px 26px rgba(43,179,182,.28), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn:hover { box-shadow: 0 14px 32px rgba(43,179,182,.38), inset 0 1px 0 rgba(255,255,255,.45); }
.foot { justify-content: center; text-transform: uppercase; letter-spacing: .16em; font-size: 9.5px; color: #7c8886; margin-top: 14px; }
.err { border-radius: 3px; }
.login-meta { bottom: 14px; color: #7c8886; letter-spacing: .08em; font-size: 11.5px; }
.login-meta b { color: #2bb3b6; font-weight: 700; }
.scene.unlock .logo3d { animation: logoOut .6s ease forwards; }
@media (max-width: 560px) { .logo3d { width: 220px; height: 220px; } .logo-layer { inset: 50px 30px; } .s-txt { font-size: 15px; } }
.s-txt { font-size: 11.5px; letter-spacing: 1.6px; }
.s-small { font-size: 10px; letter-spacing: 2.4px; }
.s-inner { r: 112px; }
.l-shadow { transform: translateZ(-14px) translateY(12px); }
.l-glow { transform: translateZ(-8px); }
.l-top { transform: translateZ(12px); }
.seal { transform: translateZ(0); }
@keyframes sealspin { to { transform: translateZ(0) rotate(360deg); } }
.logo-ring, .logo-ring.r2 { top: 50%; }
.logo-layer { inset: auto; left: 40px; top: 68px; width: 220px; height: 164px; }
@media (max-width: 560px) { .logo-layer { left: 30px; top: 50px; width: 160px; height: 120px; } }

/* ---- mobile ---- */
@media (max-width: 560px) {
  .scene { perspective: 900px; }
  .stage { gap: 14px; padding: calc(16px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); justify-content: flex-start; overflow-y: auto; }
  .logo3d { width: 190px; height: 190px; margin-top: 6vh; }
  .logo-layer { left: 25px; top: 42px; width: 140px; height: 105px; }
  .s-txt { font-size: 13px; }
  .s-small { font-size: 11px; }
  .card { width: 100%; padding: 20px 18px 16px; transform: none; }
  .card-head h1 { font-size: 26px; }
  .inp input { font-size: 16px; padding: 14px 0; }
  .btn { min-height: 48px; }
  .eye { width: 44px; height: 44px; justify-content: center; align-items: center; }
  .login-meta { bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 10.5px; }
  body.login-body { overflow: auto; }
}
@media (max-height: 700px) and (max-width: 560px) { .logo3d { margin-top: 0; width: 150px; height: 150px; } .logo-layer { left: 20px; top: 34px; width: 110px; height: 82px; } }
