/* Auth — split: brend-panel lijevo (kao Menda back office), forma desno */

#auth-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  overflow-y: auto;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
#auth-root.open { display: block; }

.auth-split { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .auth-split { grid-template-columns: 1.05fr minmax(430px, 0.95fr); }
}

/* ---------------- brend-panel ---------------- */
.auth-panel {
  display: none;
  position: relative;
  overflow: hidden;
  background: #0a0f08;
  padding: 40px 48px;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 960px) { .auth-panel { display: flex; } }

.auth-panel .orb1, .auth-panel .orb2 {
  position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none;
}
.auth-panel .orb1 { width: 28rem; height: 28rem; left: -6rem; top: 22%; background: rgba(201, 247, 92, 0.22); }
.auth-panel .orb2 { width: 22rem; height: 22rem; right: -4rem; bottom: -2rem; background: rgba(111, 227, 161, 0.12); }
.auth-panel .grid-overlay {
  position: absolute; inset: 0; opacity: 0.06; pointer-events: none;
  background-image: linear-gradient(to right, #fff 1px, transparent 1px),
                    linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-size: 56px 56px;
}
.auth-panel .p-brand { position: relative; display: flex; align-items: center; gap: 10px; }
.auth-panel .p-brand .mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
}
.auth-panel .p-brand .mark svg { width: 21px; height: 21px; stroke-width: 2.2; }
.auth-panel .p-brand .n { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; color: var(--fg); }

.auth-panel .p-mid { position: relative; max-width: 26rem; }
.auth-panel .eyebrow { font-size: 11px; font-weight: 750; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.auth-panel h2 {
  margin: 12px 0 0; font-size: 30px; line-height: 1.15; font-weight: 760;
  letter-spacing: -0.035em; color: var(--fg);
}
.auth-panel .feats { display: flex; flex-direction: column; gap: 20px; margin-top: 30px; }
.auth-panel .feats li { display: flex; gap: 14px; }
.auth-panel .feats .ico {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05); color: var(--accent);
}
.auth-panel .feats .ico svg { width: 19px; height: 19px; stroke-width: 1.6; }
.auth-panel .feats .t { display: block; font-size: 13.5px; font-weight: 650; color: var(--fg); }
.auth-panel .feats .d { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: rgba(242, 245, 241, 0.55); }
.auth-panel .p-foot { position: relative; font-size: 11px; color: rgba(242, 245, 241, 0.35); }

/* ---------------- forma ---------------- */
.auth-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: 26px 18px calc(26px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 960px) { .auth-form-side { padding: 40px; } }
.auth-shell { width: 100%; max-width: 396px; }

.auth-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
@media (min-width: 960px) { .auth-topbar { display: none; } }
.auth-topbar .mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
}
.auth-topbar .mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.auth-topbar .n { font-size: 15px; font-weight: 750; letter-spacing: -0.02em; }
.auth-topbar .badge {
  margin-left: auto; height: 22px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: 100px; border: 1px solid var(--line-2);
  font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

.auth-card {
  background: linear-gradient(168deg, rgba(23, 27, 24, 0.92), rgba(14, 17, 15, 0.97));
  border: 1px solid var(--line-2);
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: authIn 0.45s var(--spring) both;
}
@keyframes authIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }

.auth-card h1 { font-size: 20px; font-weight: 760; letter-spacing: -0.03em; }
.auth-card .lead { margin-top: 4px; font-size: 13px; color: var(--muted); }

.auth-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  margin: 16px 0 18px;
}
.auth-tabs .pill {
  position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px); border-radius: 9px;
  background: var(--card-3); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.32s var(--spring);
}
.auth-tabs[data-tab="register"] .pill { transform: translateX(100%); }
.auth-tabs button {
  position: relative; z-index: 1; height: 34px; font-size: 13px; font-weight: 650;
  color: var(--muted); transition: color 0.24s var(--ease);
}
.auth-tabs button.active { color: var(--fg); }

.auth-step { display: flex; flex-direction: column; gap: 14px; }
.auth-step[hidden] { display: none; }

.auth-field label { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.auth-field label .req { color: var(--accent); margin-left: 2px; }
.auth-field .wrap { position: relative; }
.auth-field input {
  width: 100%; height: 46px; padding: 0 42px 0 13px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
  color: var(--fg); font-size: 15px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.auth-field input::placeholder { color: var(--dim); }
.auth-field input:focus {
  outline: none; border-color: rgba(201, 247, 92, 0.5);
  background: rgba(201, 247, 92, 0.05); box-shadow: 0 0 0 3px rgba(201, 247, 92, 0.09);
}
.auth-field.invalid input { border-color: rgba(255, 115, 115, 0.6); }
.auth-field .eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  color: var(--dim); transition: color 0.18s;
}
.auth-field .eye:hover { color: var(--fg); }
.auth-field .eye svg { width: 17px; height: 17px; stroke-width: 1.9; }

.auth-hint { font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.auth-caps { font-size: 11.5px; font-weight: 600; color: var(--warn); }
.auth-submit { margin-top: 2px; }
.auth-submit .spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(11, 16, 5, 0.35); border-top-color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.turnstile-slot {
  min-height: 96px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  margin: 2px 0 8px;
}
.turnstile-slot iframe { max-width: 100%; }
.turnstile-slot .cap { font-size: 10.5px; color: var(--dim); }

.otp-head { text-align: center; margin: 2px 0 10px; }
.otp-head .t { font-size: 17px; font-weight: 730; letter-spacing: -0.02em; }
.otp-head .s { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.otp-head .s b { color: var(--fg); font-weight: 650; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.otp-boxes input {
  width: 100%; height: 52px; text-align: center; font-size: 21px; font-weight: 730;
  font-variant-numeric: tabular-nums; border-radius: 12px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); color: var(--fg);
  transition: border-color 0.16s, background 0.16s, transform 0.16s var(--spring);
}
.otp-boxes input:focus {
  outline: none; border-color: rgba(201, 247, 92, 0.55);
  background: rgba(201, 247, 92, 0.07); transform: translateY(-1px);
}
.otp-boxes input.filled { border-color: rgba(201, 247, 92, 0.32); }

.auth-links {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px; font-size: 12.5px; color: var(--muted);
}
.auth-links button { color: var(--accent); font-weight: 640; }
.auth-links button:disabled { color: var(--dim); font-weight: 500; }

.auth-msg { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: 11px; display: none; }
.auth-msg.show { display: block; animation: msgIn 0.26s var(--spring) both; }
.auth-msg.err { background: rgba(255, 115, 115, 0.1); border: 1px solid rgba(255, 115, 115, 0.3); color: #ffd9d9; }
.auth-msg.ok { background: rgba(201, 247, 92, 0.1); border: 1px solid rgba(201, 247, 92, 0.28); color: #e8ffb8; }
@keyframes msgIn { from { opacity: 0; transform: translateY(-4px); } }

.auth-forgot { text-align: center; margin-top: 2px; }
.auth-forgot button { font-size: 12.5px; font-weight: 640; color: var(--accent); }
.auth-forgot button:hover { text-decoration: underline; }

.auth-note { margin-top: 14px; text-align: center; font-size: 11px; line-height: 1.6; color: var(--dim); }
.auth-foot { margin-top: 20px; text-align: center; font-size: 11px; color: var(--dim); }

body.authed-off .tabbar,
body.authed-off .sidenav { display: none !important; }
body.authed-off #view { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
