/* Stranice prijave, 2FA, odjave i spajanja Claudea. Nadograđuje dashboard/dashboard.css
   (boje, fontovi, gumbi, polja). Lijevo je Medikor plava ploča sa znakom iz logotipa,
   desno obrazac. Animacije su kratke i isključuju se uz „smanji pokrete” u sustavu. */

.auth-body { background: var(--page); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; }

/* Plava ploča s logotipom */
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, #0a44b8 0%, var(--blue) 45%, #00246b 100%);
}
.auth-brand-logo { position: relative; z-index: 1; display: block; width: 168px; height: auto; filter: brightness(0) invert(1); }
.auth-tagline { position: relative; z-index: 1; margin: 0; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-tagline strong { font: 400 46px/1 var(--serif); letter-spacing: .05em; text-transform: uppercase; }
.auth-tagline span { color: rgb(255 255 255 / .78); font-size: 15px; line-height: 1.55; }
.auth-mark { position: absolute; right: -14%; bottom: -10%; width: 92%; max-width: 640px; opacity: .14; animation: auth-float 9s ease-in-out 1.6s infinite alternate; }
.auth-mark .stroke { fill: none; stroke: #fff; stroke-width: 172; stroke-linecap: round; stroke-dasharray: 445; stroke-dashoffset: 445; animation: auth-draw 1.1s cubic-bezier(.6, 0, .2, 1) .15s forwards; }
.auth-mark .stroke + .stroke { animation-delay: .4s; }
.auth-mark circle { fill: #fff; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: auth-pop .7s cubic-bezier(.3, 1.5, .5, 1) .95s forwards; }

/* Obrazac */
.auth-main { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 32px; min-width: 0; }
.auth-mobile-logo { display: none; }
.auth-card { width: 100%; max-width: 420px; margin: auto 0; display: flex; flex-direction: column; gap: 20px; }
.auth-card-wide { max-width: 560px; }
.auth-step { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.auth-title { margin: 0; font: 400 42px/1.02 var(--serif); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); overflow-wrap: anywhere; }
.auth-text { margin: 0; color: #404041; line-height: 1.6; }
.auth-card h2 { margin: 0; font: 400 24px/1.1 var(--serif); letter-spacing: .04em; text-transform: uppercase; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .field input[type="text"], .auth-form .field input[type="email"], .auth-form .field input[type="password"],
.auth-form .field textarea { max-width: none; min-height: 48px; }
.auth-form .field textarea { padding: 12px; border: 1px solid #b8b8b8; font: 15px/1.6 ui-monospace, "SFMono-Regular", Menlo, monospace; resize: none; }
.auth-form .field .help a, .auth-inline-link { font-size: 13px; }
.auth-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 4px; }
.auth-actions .btn { width: 100%; min-height: 50px; }
.auth-actions .link-button, .auth-actions > a:not(.btn) { align-self: center; }
.auth-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.auth-hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.auth-note { margin: 0; padding: 14px 16px; border-left: 3px solid var(--blue); background: var(--panel); color: #404041; font-size: 14px; line-height: 1.55; }
.auth-note-warn { border-left-color: var(--bad); background: var(--bad-bg); color: var(--ink); }
.auth-target { margin: 0; padding: 14px 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.auth-target code { font: 600 16px/1.3 ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }
.auth-meta { margin: 0; font-size: 12px; color: var(--muted); }
.auth-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-two .btn { width: 100%; min-height: 50px; }

/* Kod iz aplikacije: veliko, razmaknuto, samo brojke */
.auth-code input::placeholder { color: transparent; }
.auth-code input { font: 600 30px/1 ui-monospace, "SFMono-Regular", Menlo, monospace !important; letter-spacing: .45em; text-align: center; padding-left: .45em !important; min-height: 64px !important; }

/* Napredak kroz pozivnicu: lozinka, 2FA, Claude */
.auth-progress { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth-progress li { position: relative; padding-top: 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.auth-progress li::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--line); }
.auth-progress li[aria-current="step"] { color: var(--ink); }
.auth-progress li.is-done::before { background: var(--blue); }
.auth-progress li[aria-current="step"]::before { background: var(--blue); transform-origin: left; animation: auth-fill .7s cubic-bezier(.6, 0, .2, 1) .35s both; }

/* Koraci postavljanja 2FA */
.auth-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.auth-steps > li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; color: #404041; line-height: 1.55; }
.auth-steps > li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--ink); font-weight: 700; color: var(--ink); font-size: 13px; }
.auth-qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px solid var(--line); }
.auth-qr img { width: 168px; height: 168px; image-rendering: pixelated; background: #fff; }
.auth-secret { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.auth-secret code { font: 600 14px/1.5 ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; letter-spacing: .06em; }

/* Rezervni kodovi */
.auth-codes { margin: 0; padding: 16px; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; border: 1px solid var(--line); background: var(--panel); }
.auth-codes li { font: 600 16px/1.4 ui-monospace, Menlo, monospace; color: var(--ink); letter-spacing: .08em; }

/* Ploče na stranici 2FA */
.auth-panel { border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.auth-panel h2 { font: 400 22px/1.1 var(--serif); }
.auth-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.auth-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.auth-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.auth-status-off::before { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }

/* Navigacija za prijavljene i podnožje */
.auth-nav { width: 100%; max-width: 420px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.auth-card-wide + .auth-nav { max-width: 560px; }
.auth-nav form { display: inline; }
.auth-foot { margin-top: 24px; font-size: 12px; color: var(--muted); text-align: center; }

/* Gumbi: strelica, pritisak, čekanje */
.btn, .btn-outline, .field input, .field select, .field textarea, .nav a, .periods a { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-arrow::after { content: "→"; margin-left: 10px; transition: transform .2s ease; }
.btn-arrow:hover::after { transform: translateX(4px); }
.btn.is-busy { pointer-events: none; color: transparent; position: relative; }
.btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.btn-outline.is-busy::after { border-color: rgb(0 0 0 / .2); border-top-color: var(--ink); }
.auth-form .field input:focus, .auth-form .field textarea:focus { box-shadow: 0 0 0 3px rgb(0 51 153 / .14); }

/* Ulazak sadržaja */
.auth-card > *, .auth-nav { animation: auth-rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card > :nth-child(2) { animation-delay: .05s; }
.auth-card > :nth-child(3) { animation-delay: .1s; }
.auth-card > :nth-child(4) { animation-delay: .15s; }
.auth-card > :nth-child(5) { animation-delay: .2s; }
.auth-card > :nth-child(n+6) { animation-delay: .25s; }
.auth-nav { animation-delay: .3s; }
.auth-tagline { animation: auth-rise .7s cubic-bezier(.2, .7, .2, 1) .5s both; }
.auth-brand-logo { animation: auth-fade .6s ease .1s both; }
.errorlist { animation: auth-shake .4s ease both; }
.message { animation: auth-rise .4s ease both; }

@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-draw { to { stroke-dashoffset: 0; } }
@keyframes auth-pop { to { transform: scale(1); } }
@keyframes auth-float { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes auth-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { min-height: 132px; padding: 24px 20px; justify-content: center; }
  .auth-brand-logo { width: 148px; }
  .auth-tagline { display: none; }
  .auth-mark { width: 300px; right: -40px; bottom: -70px; }
  .auth-main { padding: 32px 16px 24px; }
  .auth-card { margin: 0; }
  .auth-title { font-size: 34px; }
  .auth-codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .auth-mark .stroke { stroke-dashoffset: 0; }
  .auth-mark circle { transform: none; }
}
