/* Prijava / registracija - ucitava se tek na klik "Log in" (authOpen u main.js) i na stranama /login i /signup.
   Popup: .auth-layer > .auth-backdrop + .auth-pop (klizi odozgo ispod headera, poluprovidan sa blur-om). */
.auth-layer {
    position: fixed;
    inset: 0;
    z-index: 2000;
}
.auth-backdrop {
    position: absolute;
    inset: 0;
    background: oklch(0 0 0 / 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.auth-pop {
    position: absolute;
    top: calc(var(--header-h) + 10px);
    right: 16px;
    width: 400px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - var(--header-h) - 20px);
    overflow-y: auto;
    padding: 28px 26px 22px;
    background: oklch(0.17 0.01 260 / 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px oklch(0 0 0 / 0.5);
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.auth-layer.open .auth-backdrop {
    opacity: 1;
}
.auth-layer.open .auth-pop {
    opacity: 1;
    transform: none;
}
.auth-x {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.auth-x:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
@media (max-width: 560px) {
    .auth-pop {
        left: 12px;
        right: 12px;
        width: auto;
        padding: 26px 18px 20px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .auth-pop, .auth-backdrop {
        transition: none;
    }
}

/* --- sadrzaj (popup i strane) --- */
.auth-title {
    margin: 0 0 18px;
    font: 700 21px var(--font-head);
    color: var(--text-primary);
}
.auth-text {
    margin: -6px 0 16px;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.auth-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font: 600 15px var(--font-head);
    text-decoration: none;
    cursor: pointer;
}
.auth-social:hover {
    background: var(--bg-hover);
    border-color: var(--text-faint);
}
.auth-social svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 14px;
    color: var(--text-faint);
    font-size: 13px;
}
.auth-or::before, .auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-label {
    display: block;
    margin: 0 0 6px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
}
.auth-input {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: 500 15.5px var(--font);
}
.auth-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-dim);
}
/* Chrome autofill boji polje svetloplavo - unutrasnja senka vraca nasu pozadinu (background se tu ne moze promeniti) */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
    box-shadow: 0 0 0 1000px var(--bg-input) inset;
    transition: background-color 9999s;
}
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    box-shadow: 0 0 0 1000px var(--bg-input) inset, 0 0 0 3px var(--orange-dim);
}
.auth-code {
    font: 700 22px var(--font-mono);
    letter-spacing: 0.4em;
    text-align: center;
}
.auth-pw {
    position: relative;
}
.auth-pw .auth-input {
    padding-right: 46px;
}
.auth-eye {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 45px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
}
.auth-eye:hover {
    color: var(--text-primary);
}
.auth-eye:focus {
    outline: none;
}
.auth-eye:focus-visible {
    color: var(--text-primary);
    outline: 2px solid var(--orange);
    outline-offset: -6px;
    border-radius: var(--radius-sm);
}
.auth-eye svg {
    width: 19px;
    height: 19px;
}
.auth-forgot {
    display: block;
    width: max-content;
    margin: -6px 0 14px auto;
    color: var(--text-secondary);
    font-size: 13.5px;
    text-decoration: none;
}
.auth-forgot:hover {
    color: var(--orange);
}
.auth-hint {
    margin: -8px 0 14px;
    color: var(--text-faint);
    font-size: 12.5px;
}
.auth-msg {
    margin-bottom: 12px;
    color: oklch(0.74 0.16 25);
    font-size: 14px;
    line-height: 1.45;
}
.auth-msg:empty {
    display: none;
}
.auth-msg.ok {
    color: var(--green);
}
.auth-submit {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: var(--orange);
    border: 0;
    border-radius: var(--radius-md);
    color: #1a1206;
    font: 700 15.5px var(--font-head);
    cursor: pointer;
}
.auth-submit:hover {
    background: var(--orange-bright);
}
.auth-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}
.auth-foot, .auth-terms {
    margin: 16px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.auth-terms {
    font-size: 12.5px;
    color: var(--text-faint);
}
.auth-foot a, .auth-terms a {
    color: var(--orange);
    text-decoration: none;
}
.auth-foot a:hover, .auth-terms a:hover {
    text-decoration: underline;
}

/* --- strane /signup i /login --- */
.auth-page {
    max-width: 420px;
    margin: 0 auto 40px;
    padding: 28px 26px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
@media (max-width: 560px) {
    .auth-page {
        padding: 22px 16px 20px;
    }
}

/* --- dashboard: nacini prijave --- */
.dash-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--orange-dim);
    border: 1px solid var(--orange);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}
.dash-h {
    margin: 0 0 6px;
    font: 700 18px var(--font-head);
    color: var(--text-primary);
}
.dash-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.dash-row:last-of-type {
    border-bottom: 0;
}
.dash-row-top {
    align-items: flex-start;
}
.dash-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.dash-row-main b {
    color: var(--text-primary);
    font-weight: 600;
}
.dash-row-main > span {
    color: var(--text-muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}
.dash-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.dash-badge.on {
    background: oklch(0.75 0.15 150 / 0.15);
    color: var(--green);
}
.dash-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font: 600 14px var(--font-head);
    text-decoration: none;
    white-space: nowrap;
}
.dash-btn:hover {
    border-color: var(--orange);
    color: var(--orange-bright);
}
.dash-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}
.dash-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}
.dash-list li b {
    color: var(--text-primary);
}
.dash-list .dash-empty {
    color: var(--text-faint);
}
.dash-link {
    color: var(--text-muted);
    font-size: 13.5px;
    text-decoration: none;
}
.dash-link:hover {
    color: oklch(0.74 0.16 25);
}
#dash-msg {
    margin: 12px 0 0;
}
@media (max-width: 560px) {
    .dash-row {
        flex-wrap: wrap;
    }
}

/* --- dashboard: praceni sajtovi --- */
.dash-h small {
    margin-left: 6px;
    color: var(--text-faint);
    font: 400 13px var(--font);
}
.follow-list {
    display: flex;
    flex-direction: column;
}
.follow-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 130px 100px 110px auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.follow-row:last-child {
    border-bottom: 0;
}
.follow-row img {
    border-radius: 6px;
}
.follow-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.follow-main a {
    color: var(--text-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.follow-main a:hover {
    color: var(--orange-bright);
}
.follow-main small {
    color: var(--text-muted);
    font-size: 12.5px;
}
.follow-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.follow-stat > span {
    color: var(--text-faint);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.follow-stat b {
    color: var(--text-primary);
    font-weight: 600;
}
.follow-spark .trend-spark-svg {
    width: 100%;
}
.dash-empty-text {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}
/* mobilni: domen + Unfollow u prvom redu, posete levo i promena desno, grafikon preko cele sirine */
@media (max-width: 760px) {
    .follow-row {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 10px 12px;
    }
    .follow-row > img {
        align-self: start;
    }
    .follow-row > .m-del {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }
    .follow-stat {
        grid-row: 2;
        grid-column: 2;
    }
    .follow-stat + .follow-stat {
        grid-column: 3;
        text-align: right;
        align-items: flex-end;
    }
    .follow-spark {
        grid-row: 3;
        grid-column: 2 / 4;
    }
}

/* --- /manage (vlasnici) --- */
.m-row {
    display: flex;
    gap: 10px;
}
.m-row .auth-input {
    margin: 0;
}
.m-row .auth-submit {
    width: auto;
    flex-shrink: 0;
}
.m-method {
    margin: 18px 0;
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14.5px;
}
.m-method h3 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font: 700 16px var(--font-head);
}
.m-method h3 small {
    margin-left: 6px;
    color: var(--text-faint);
    font: 400 12.5px var(--font);
}
.m-method p {
    margin: 0 0 10px;
    line-height: 1.5;
}
.m-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.m-code > span {
    width: 90px;
    color: var(--text-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.m-code code, .m-url {
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: 13px var(--font-mono);
    overflow-wrap: anywhere;
}
.m-method .dash-btn {
    display: inline-block;
    margin: 6px 8px 0 0;
    cursor: pointer;
}
.m-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.m-seg {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.m-seg button {
    padding: 7px 14px;
    background: var(--bg-input);
    border: 0;
    border-right: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font: 600 13.5px var(--font);
    cursor: pointer;
}
.m-seg button:last-child {
    border-right: 0;
}
.m-seg button.on {
    background: var(--orange-dim);
    color: var(--orange-bright);
}
.dash-h .dash-badge {
    margin-left: 8px;
    vertical-align: middle;
}
.dash-badge {
    background: var(--bg-hover);
    color: var(--text-secondary);
}
.m-bad {
    background: oklch(0.62 0.2 25 / 0.18) !important;
    color: oklch(0.74 0.16 25) !important;
}
.m-save {
    width: auto;
}
.follow-row.m-site {
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
}
.m-site-act {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Remove kao ikonica kante (pending sajt) */
.m-del-ic {
    display: inline-flex;
    padding: 5px 7px;
}
.m-del-ic svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* mobilni: domen + Verified/Pending u prvom redu, dugmad ispod domena */
@media (max-width: 760px) {
    .follow-row.m-site {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }
    .m-site-act {
        grid-column: 2 / 4;
    }
}
.dash-empty-text a {
    color: var(--orange);
}
.m-danger {
    border-color: oklch(0.62 0.2 25 / 0.45);
}
.m-danger .auth-text a {
    color: var(--orange);
}
.m-del {
    border-color: oklch(0.62 0.2 25 / 0.6);
    color: oklch(0.74 0.16 25);
    cursor: pointer;
}
.m-del:hover {
    background: oklch(0.62 0.2 25 / 0.15);
    border-color: oklch(0.62 0.2 25);
    color: oklch(0.8 0.14 25);
}
/* robots.txt blok (stil .code-block iz style.css, kao na /crawler) + Copy u zaglavlju */
.m-robots {
    margin: 0 0 14px;
}
.m-robots .code-block-bar {
    display: flex;
    align-items: center;
}
.m-copy {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12.5px;
    text-decoration: none;
}
.m-copy:hover {
    color: var(--orange-bright);
}
.m-ga-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
/* malo dugme (Remove passkey, Unfollow, Remove pending sajt) - crveni okvir kao .m-del */
.dash-btn-sm {
    flex-shrink: 0;
    padding: 3px 9px;
    background: var(--bg-card);
    border-width: 1px;
    border-style: solid;   /* boja ivice i teksta iz .m-del */
    border-radius: var(--radius-sm);
    font: 600 12px var(--font-head);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.dash-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.dash-btn:disabled:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}
/* promena lozinke (dashboard, Sign-in methods) */
.dash-pw {
    max-width: 420px;
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--border);
}
.dash-row .dash-badge + .dash-btn {
    margin-left: 8px;
}
