/* =========================================================================
   auth-light.css — PBI 9654: stranice prije prijave (/login, /registration, /forgotpassword)
   Linkovan u Pages/_HostAuth.cshtml (lagani host) I u Pages/_Host.cshtml (auth stranica se može
   renderovati i u punom hostu, npr. RedirectToLogin unutar postojećeg circuit-a).

   1) LAYOUT — kopija pravila iz site.css / site_V1.css koja važe na auth stranicama u _Host-u.
      Svaki selektor počinje sa :where(body.auth-host): nula specifičnosti → ista kaskada kao u
      _Host-u (redesign-login.css i dalje pobjeđuje kao do sada), a u _Host-u (body bez klase) se
      ne primjenjuju. Kad se nešto mijenja u site.css za login, uskladiti i ovdje.
   2) .auth-spinner — zamjena za SfSpinner (e-spin-overlay) na Registration/ForgotPassword.
   3) .auth-msg — zamjena za SfToast poruku („Pošalji ponovo" na ForgotPassword).
   ========================================================================= */

/* ── 1. Layout (iz site.css) ─────────────────────────────────────────── */
:where(body.auth-host) {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:where(body.auth-host) a,
:where(body.auth-host) .btn-link {
    color: #0366d6;
}

:where(body.auth-host) .top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

:where(body.auth-host) .app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

:where(body.auth-host) .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

:where(body.auth-host) .main .top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 1000;
}

:where(body.auth-host) .main .top-row > a {
    margin-left: 1.5rem;
}

:where(body.auth-host) .main > div {
    padding-left: 3rem !important;
    padding-right: 1.5rem !important;
}

:where(body.auth-host) .content {
    padding-top: 1.1rem;
}

:where(body.auth-host) #main-content {
    flex: 1;
    overflow-x: auto;
}

/* Validacija formi (Registration: ValidationMessage) */
:where(body.auth-host) .valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

:where(body.auth-host) .invalid {
    outline: 1px solid red;
}

:where(body.auth-host) .validation-message {
    color: red;
}

@media (max-width: 950px) {
    :where(body.auth-host) #logoBigScreen .navbar-brand-name {
        display: none;
    }
}

@media (max-width: 767.98px) {
    :where(body.auth-host) .main .top-row {
        display: none;
    }

    :where(body.auth-host) .navbar-brand-name {
        filter: brightness(0) invert(1);
    }

    :where(body.auth-host) #main-content {
        width: 100% !important;
    }

    :where(body.auth-host) .app-container {
        flex-direction: column;
    }
}

/* QR modal za App Store / Google Play (Pages/AppDownloadQRModal.razor) — iz site_V1.css */
:where(body.auth-host) .custom-modal .modal-header {
    border-bottom: 0;
    margin-left: auto;
    margin-right: auto;
}

:where(body.auth-host) .custom-modal .modal-title {
    color: #1C257B;
    max-width: 400px;
    text-align: center;
}

:where(body.auth-host) .custom-modal .modal-body {
    padding-left: 2rem;
    padding-right: 2rem;
}

:where(body.auth-host) .custom-modal .modal-dialog {
    padding-top: 3%;
}

:where(body.auth-host) .custom-modal .modal-footer {
    border-top: 0;
}

/* ── 2. Spinner (umjesto SfSpinner e-spin-overlay) ───────────────────── */
.auth-spinner {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .4);
}

.auth-spinner__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.auth-spinner__ring {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: var(--is-brand-blue, #0494da);
    animation: auth-spin 0.8s linear infinite;
}

.auth-spinner__label {
    color: #fff;
    font-family: var(--is-font-sans, sans-serif);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-spinner__ring {
        animation-duration: 2s;
    }
}

/* ── 3. Poruka u formi (umjesto SfToast) ─────────────────────────────── */
.auth-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--is-radius-md, 10px);
    border: 1px solid transparent;
    font-family: var(--is-font-sans, sans-serif);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.auth-msg > i {
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-msg strong {
    display: block;
    font-weight: 700;
}

.auth-msg--success {
    background: var(--is-success-bg, #e8f6ee);
    border-color: var(--is-success, #1f9d55);
    color: var(--is-fg-1, #1a1a1f);
}

.auth-msg--success > i {
    color: var(--is-success, #1f9d55);
}

/* ── 4. Dugme „Prijava" u toku (Login.razor, data-auth-busy) ──────────
   is-busy dodaje js/auth-host.js odmah na submit (prije odgovora servera), a server ga drži preko
   IsLoggingIn dok prijava traje. Labela je jedan red sa ellipsis-om. */
.login-v2__btn-primary .auth-btn__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.login-v2__btn-primary .auth-btn__spinner,
.login-v2__btn-primary .auth-btn__busy {
    display: none;
}

.login-v2__btn-primary.is-busy .auth-btn__idle {
    display: none;
}

.login-v2__btn-primary.is-busy .auth-btn__busy {
    display: inline;
}

.login-v2__btn-primary.is-busy .auth-btn__spinner {
    display: inline-block;
    flex-shrink: 0;
}

.login-v2__btn-primary.is-busy {
    pointer-events: none;
    cursor: progress;
}
