/* ============================================================
   е-Судство — Login страница (стил)
   Усклађено са index.aspx
   ============================================================ */

:root {
    --ink: #0F1B2D;
    --ink-2: #14233a;
    --gold: #f26e3a; /*Zapravo je narandzasta*/
    --gold-soft: #f2813a; /*Zapravo je narandzasta*/
    --paper: #f5f1e8;
    --paper-dim: rgba(245, 241, 232, 0.72);
    --line: rgba(245, 241, 232, 0.18);
    --line-strong: rgba(245, 241, 232, 0.32);
    --danger: #e3635a;
    --ok: #6fbf73;
    --zlato-soft: #d8b76b;
    --zlato: #C9A24B;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* ---------- Background ---------- */
.bg-stage1 {
    display: grid;
    /*grid-template-columns: auto auto auto;*/
    grid-template-columns: auto auto;
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.85) contrast(1.02);
}
.Pozadina-levo {
    background-size: cover;
    background-position: center;
    filter: saturate(0.85) contrast(1.02);
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
}
.Pozadina-desno {
    background-size: cover;
    background-position: center;
    filter: saturate(0.85) contrast(1.02);
    -webkit-mask-image: linear-gradient(to left, black 70%, transparent 100%);
}
.bg-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.85) contrast(1.02);
}
.bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background:
    linear-gradient(115deg, rgba(8,14,26,0.92) 0%, rgba(8,14,26,0.72) 38%, rgba(8,14,26,0.40) 62%, rgba(8,14,26,0.78) 100%),
    radial-gradient(60% 80% at 80% 100%, rgba(201,162,75,0.18) 0%, rgba(201,162,75,0) 60%);
}
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Layout ---------- */
.app {
  position: relative; z-index: 3;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(20px, 4vw, 40px);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  color: var(--paper-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.crest { display: flex; align-items: center; gap: 12px; text-transform: uppercase; }
.crest .mark {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-weight: 700; font-size: 18px;
  background: rgba(15, 27, 45, 0.5);
}
.crest .who { display: flex; flex-direction: column; line-height: 1.15; }
.crest .who b { color: var(--paper); font-weight: 600; letter-spacing: 0.06em; font-size: 12px; }
.crest .who span { font-size: 11px; opacity: 0.7; letter-spacing: 0.18em; }
.topbar .meta { display: flex; gap: 18px; align-items: center; }
.topbar .meta span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/*.stage { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px) 0; }*/
.stage {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 85vh;
}

/* ---------- Card ---------- */
.card {
  width: 100%; max-width: 460px;
  background: linear-gradient(180deg, rgba(20, 35, 58, 0.78) 0%, rgba(12, 22, 38, 0.86) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.65), 0 1px 0 rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  overflow: hidden;
  position: relative;
  animation: stepIn .35s ease both;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
  opacity: 0.85;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-head { padding: 28px 28px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-head .eyebrow { font-size: 10.5px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.step-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px;
}
.step-pill .num {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}

.card-body { padding: 18px 28px 28px; }
.title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(26px, 4vw, 30px); line-height: 1.15; margin: 6px 0 6px; color: var(--paper); }
.subtitle { font-size: 14px; line-height: 1.55; color: var(--paper-dim); margin: 0 0 22px; }
.greet-name { color: var(--gold-soft); font-family: 'Playfair Display', serif; font-style: italic; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper-dim); font-weight: 600; }
.input-wrap {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 26, 0.55);
  border-radius: 8px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.input-wrap:focus-within {
  border-color: var(--zlato-soft);
  background: rgba(8, 14, 26, 0.78);
  box-shadow: 0 0 0 4px rgba(201, 162, 75, 0.10);
}
.input-wrap .icon { width: 44px; display: grid; place-items: center; color: var(--paper-dim); flex-shrink: 0; }
.input-wrap .txt {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--paper);
  font: 500 15px/1.4 'Inter', sans-serif;
  padding: 14px 14px 14px 0;
  width: 100%;
}
.input-wrap .txt::placeholder { color: rgba(245, 241, 232, 0.35); }
.toggle-pwd { background: none; border: 0; cursor: pointer; color: var(--paper-dim); padding: 0 14px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Error */
.err {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 14px;
  display: flex; align-items: center; gap: 8px;
  min-height: 18px;
}
.err.show { opacity: 1; }

/* Row */
.row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 22px; gap: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--paper-dim); cursor: pointer; user-select: none; position: relative; }
.check input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 26, 0.55);
  display: grid; place-items: center;
  transition: all .15s ease;
}
.check input:checked ~ .box,
.check input:checked + .box { background: var(--gold); border-color: var(--gold); }
.check input:checked ~ .box::after,
.check input:checked + .box::after {
  content: ""; width: 8px; height: 5px;
  border: 2px solid var(--ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.link { font-size: 13px; color: var(--zlato); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s ease; }
.link:hover { border-color: var(--gold-soft); }

/* Buttons */
.btn {
  width: 100%; border: 0; cursor: pointer;
  padding: 15px 18px; border-radius: 8px;
  font: 600 14px/1 'Inter', sans-serif;
  letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary { background: var(--gold); color: var(--ink); box-shadow: 0 12px 30px -12px rgba(201, 162, 75, 0.55); }
.btn-primary:hover { background: var(--gold-soft); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--paper-dim);
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
  text-transform: none; letter-spacing: 0.02em;
  font-size: 13px; font-weight: 500;
  margin-top: 10px;
}
.btn-ghost:hover { color: var(--paper); border-color: var(--paper-dim); }

/* Card foot */
.card-foot {
  border-top: 1px solid var(--line);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: rgba(8, 14, 26, 0.35);
  font-size: 12px; color: var(--paper-dim);
}
.card-foot a { color: var(--paper-dim); text-decoration: none; }
.card-foot a:hover { color: var(--paper); }

/* Avatar greeting */
.greet { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 4px 0 18px; text-align: center; }
.avatar-wrap { position: relative; width: 92px; height: 92px; }
.avatar-wrap::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--line-strong); opacity: 0.7;
}
.avatar-wrap::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px dashed rgba(201, 162, 75, 0.35);
  animation: rot 24s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--ink-2);
  display: grid; place-items: center;
  color: var(--paper);
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  overflow: hidden; position: relative;
}
.avatar.has-photo { background-size: cover; background-position: center; color: transparent; }
.badge-court {
  position: absolute; bottom: -2px; right: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  border: 2px solid var(--ink);
  display: grid; place-items: center; font-size: 11px;
}
.greet h2 { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 22px; line-height: 1.25; margin: 0; }
.greet .role { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-soft); margin-top: 2px; }
.greet .court { font-size: 13px; color: var(--paper-dim); margin-top: 6px; }

/* Bottom bar */
.bottombar {position:fixed; bottom:0; left:0; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: rgba(245, 241, 232, 0.55); font-size: 11.5px; letter-spacing: 0.06em; }
.bottombar .demo-hint { background: rgba(8, 14, 26, 0.65); border: 1px solid var(--line); padding: 8px 12px; border-radius: 6px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--paper-dim); }
.bottombar .demo-hint b { color: var(--gold-soft); font-weight: 600; }

/* Responsive */
@media (max-width: 640px) {
  .app { padding: 16px; }
  .topbar { font-size: 11px; }
  .topbar .meta { gap: 10px; }
  .topbar .meta .pipe { display: none; }
  .crest .who span { font-size: 10px; }
  .card { border-radius: 12px; }
  .card-head { padding: 22px 20px 6px; }
  .card-body { padding: 14px 20px 22px; }
  .card-foot { padding: 14px 20px; flex-wrap: wrap; }
  .title { font-size: 24px; }
  .bottombar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .step-pill { padding: 5px 9px; font-size: 10px; }
    .bg-stage1 {
        position: fixed;
        grid-template-columns: auto;
        inset: 0;
        z-index: 0;
        background-size: cover;
        background-position: center;
        filter: saturate(0.85) contrast(1.02);
    }
  .Pozadina-desno{display:none;}
    .Pozadina-levo {
        background-size: cover;
        background-position: center;
        filter: saturate(0.85) contrast(1.02);
    }
}
@media (max-width: 380px) { .card-head { flex-direction: column; align-items: flex-start; } }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 3px; }
.btn.is-loading { cursor: wait; }
.btn .btn-arrow { display: inline-block; }
/* Спинер унутар дугмета */
.btn .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(15, 27, 45, 0.25);  /* тамна полупровидна бордура */
    border-top-color: var(--ink);              /* једна страна тамнија — то је „репић" */
    border-radius: 50%;                        /* круг */
    animation: spin 0.7s linear infinite;      /* ротација у круг, заувек */
    display: inline-block;
    flex-shrink: 0;                            /* да се не сабије у flex дугмету */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}