/* Transanalitika – osnovni stil
 *
 * BOJE: sve boje su definisane ovde, na jednom mestu. Trenutne vrednosti su
 * privremene; kad stignu tačne boje brenda, menjaju se samo ove promenljive.
 */
:root {
  --ta-primary: #163a5f;
  --ta-primary-dark: #0e2740;
  --ta-primary-soft: #e8eff6;
  --ta-accent: #d98a2b;
  --ta-bg: #f4f6f9;
  --ta-surface: #ffffff;
  --ta-text: #1c2733;
  --ta-text-muted: #5d6b7a;
  --ta-border: #d5dce4;
  --ta-danger: #b3261e;
  --ta-danger-soft: #fdecea;
  --ta-radius: 10px;
  --ta-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--ta-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ta-text);
  background: var(--ta-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Naziv brenda (dok ne stigne logo) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--ta-accent);
}

/* ---------- Strana za prijavu ---------- */
.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  color: #ffffff;
  background-color: var(--ta-primary-dark);
  background-image:
    linear-gradient(160deg, var(--ta-primary) 0%, var(--ta-primary-dark) 70%),
    none;
  overflow: hidden;
}

/* Diskretna mreža u pozadini, kao na milimetarskom papiru za grafikone. */
.auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to top right, rgba(0, 0, 0, 0.9), transparent 75%);
  -webkit-mask-image: linear-gradient(to top right, rgba(0, 0, 0, 0.9), transparent 75%);
  pointer-events: none;
}

.auth__brand > * {
  position: relative;
}

.auth__brand .brand {
  font-size: 1.35rem;
}

.auth__headline {
  max-width: 22ch;
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.auth__tagline {
  max-width: 38ch;
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
}

.auth__rule {
  width: 3.5rem;
  height: 3px;
  margin: 0 0 1.75rem;
  border: 0;
  background: var(--ta-accent);
}

.auth__copyright {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--ta-surface);
}

.auth__form {
  width: 100%;
  max-width: 24rem;
}

.auth__title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth__subtitle {
  margin: 0 0 2rem;
  color: var(--ta-text-muted);
}

.auth__brand-mobile {
  display: none;
  margin-bottom: 2rem;
  font-size: 1.2rem;
  color: var(--ta-primary);
}

/* ---------- Polja forme ---------- */
.field {
  margin-bottom: 1.25rem;
}

.field__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.field__control {
  position: relative;
}

.field__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ta-text);
  background: var(--ta-surface);
  border: 1px solid var(--ta-border);
  border-radius: var(--ta-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:hover {
  border-color: #b4c0cd;
}

.field__input:focus {
  outline: none;
  border-color: var(--ta-primary);
  box-shadow: 0 0 0 3px var(--ta-primary-soft);
}

.field__control--password .field__input {
  padding-right: 5.25rem;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ta-primary);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.field__toggle:hover {
  background: var(--ta-primary-soft);
}

.field__toggle:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--ta-accent);
  outline-offset: 2px;
}

/* ---------- Dugmad ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--ta-primary);
  border: 1px solid var(--ta-primary);
  border-radius: var(--ta-radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--ta-primary-dark);
}

.button--block {
  width: 100%;
  margin-top: 0.5rem;
}

.button--ghost {
  padding: 0.45rem 0.9rem;
  color: var(--ta-primary);
  background: transparent;
  border-color: var(--ta-border);
}

.button--ghost:hover {
  background: var(--ta-primary-soft);
}

/* ---------- Poruke ---------- */
.alert {
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--ta-radius);
}

.alert--error {
  color: var(--ta-danger);
  background: var(--ta-danger-soft);
  border: 1px solid #f3c6c1;
}

.auth__help {
  margin: 1.75rem 0 0;
  font-size: 0.875rem;
  color: var(--ta-text-muted);
}

/* ---------- Strana posle prijave ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  color: #ffffff;
  background: var(--ta-primary-dark);
}

.topbar .brand {
  font-size: 1.1rem;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.topbar__identity {
  text-align: right;
  line-height: 1.3;
}

.topbar__role {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.topbar .button--ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.topbar .button--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page__title {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 600;
}

.page__lead {
  margin: 0 0 2rem;
  color: var(--ta-text-muted);
}

.card {
  padding: 1.5rem;
  background: var(--ta-surface);
  border: 1px solid var(--ta-border);
  border-radius: var(--ta-radius);
}

.card__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 2rem;
  margin: 0;
}

.details dt {
  color: var(--ta-text-muted);
}

.details dd {
  margin: 0;
  font-weight: 600;
}

/* ---------- Manji ekrani ---------- */
@media (max-width: 860px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth__brand {
    display: none;
  }

  .auth__brand-mobile {
    display: inline-flex;
  }

  .auth__panel {
    align-items: flex-start;
    padding-top: 4rem;
  }

  .topbar__identity {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
