:root {
    --pq-red: var(--brand-primary, #dc2626);
    --pq-red-dark: var(--brand-secondary, #991b1b);
    --pq-ink: #0f172a;
    --pq-muted: #64748b;
    --pq-line: #e2e8f0;
}

* { box-sizing: border-box; }

.public-query-body {
    min-height: 100vh;
    margin: 0;
    padding-top: var(--public-header-height, 64px);
    padding-bottom: var(--public-footer-height, 48px);
    font-family: 'Inter', sans-serif;
    color: var(--pq-ink);
    background-image: linear-gradient(rgba(15, 23, 42, .22), rgba(15, 23, 42, .22)), var(--public-background);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.public-query-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--public-header-height, 64px);
    color: #fff;
    background: linear-gradient(135deg, var(--pq-red), var(--pq-red-dark));
    border-bottom: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}

.public-query-header__inner,
.public-query-footer__inner {
    width: min(1440px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.public-query-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.public-query-brand__logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: var(--pq-red);
    background: #fff;
    box-shadow: 0 8px 20px rgba(15,23,42,.15);
}

.public-query-brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.public-query-brand__logo img:not([style*="display: none"]) + i { display: none; }
.public-query-brand__copy { min-width: 0; display: grid; line-height: 1.05; }
.public-query-brand__copy strong { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.public-query-brand__copy small { margin-top: 4px; opacity: .78; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.public-query-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.public-query-nav__button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.public-query-nav__button:hover { transform: translateY(-1px); }
.public-query-nav__button--light { color: var(--pq-red-dark); background: #fff; box-shadow: 0 8px 18px rgba(15,23,42,.12); }
.public-query-nav__button--ghost { background: rgba(255,255,255,.1); }
.public-query-session { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; }
.public-query-session > i { font-size: 24px; }
.public-query-session > span { display: grid; line-height: 1.05; }
.public-query-session strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.public-query-session small { margin-top: 3px; opacity: .75; font-size: 9px; }

.public-query-main {
    min-height: calc(100vh - var(--public-header-height, 64px) - var(--public-footer-height, 48px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.public-query-container { width: min(1440px, 100%); margin: 0 auto; }

.public-query-footer {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 100;
    height: var(--public-footer-height, 48px);
    color: #e2e8f0;
    background: #0f172a;
    border-top: 3px solid var(--pq-red);
    box-shadow: 0 -8px 24px rgba(15,23,42,.16);
}
.public-query-footer__inner { font-size: 11px; }
.public-query-footer__brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.public-query-footer__brand i { color: #f87171; }
.public-query-footer__copyright { color: #94a3b8; text-align: center; }
.public-query-footer__links { display: inline-flex; align-items: center; gap: 16px; }
.public-query-footer__links a { display: inline-flex; align-items: center; gap: 6px; color: #e2e8f0; text-decoration: none; font-weight: 700; }
.public-query-footer__links a:hover { color: #fff; }

.query-login-shell { width: 100%; display: flex; justify-content: center; }
.query-login-card {
    position: relative;
    width: min(520px, 100%);
    overflow: hidden;
    padding: 30px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 28px 75px rgba(15,23,42,.28);
    backdrop-filter: blur(12px);
}
.query-login-card__accent { position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--pq-red), #fb7185, var(--pq-red-dark)); }
.query-login-card__header { display: flex; align-items: flex-start; gap: 14px; }
.query-login-card__icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 15px; color: var(--pq-red); background: #fee2e2; font-size: 19px; }
.query-login-card__eyebrow { display: block; margin-bottom: 5px; color: var(--pq-red); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.query-login-card h1 { margin: 0; color: var(--pq-ink); font-size: 24px; line-height: 1.15; font-weight: 800; }
.query-login-card__header p { margin: 7px 0 0; color: var(--pq-muted); font-size: 13px; line-height: 1.55; }
.query-login-card__guide { margin: 22px 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.query-login-card__guide div { min-height: 66px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 10px; border: 1px solid var(--pq-line); border-radius: 13px; background: #f8fafc; color: #475569; font-size: 10px; line-height: 1.35; }
.query-login-card__guide i { color: var(--pq-red); font-size: 15px; }
.query-login-card__guide strong { color: var(--pq-ink); }
.query-login-alert { margin-bottom: 16px; display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border: 1px solid #fecaca; border-radius: 12px; color: #991b1b; background: #fef2f2; font-size: 12px; line-height: 1.45; }
.query-login-form { display: grid; gap: 9px; }
.query-login-form > label { color: #1e293b; font-size: 12px; font-weight: 800; }
.query-login-input { position: relative; }
.query-login-input > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.query-login-input input { width: 100%; height: 48px; padding: 0 15px 0 42px; border: 1px solid #cbd5e1; border-radius: 13px; outline: none; color: #0f172a; background: #fff; font-size: 14px; font-weight: 700; text-transform: uppercase; transition: border .18s ease, box-shadow .18s ease; }
.query-login-input input:focus { border-color: var(--pq-red); box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
.query-login-form > small { color: #64748b; font-size: 10px; }
.query-login-submit { height: 46px; margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--pq-red), var(--pq-red-dark)); box-shadow: 0 12px 24px rgba(220,38,38,.2); font-size: 13px; font-weight: 800; cursor: pointer; }
.query-login-submit:disabled { opacity: .72; cursor: wait; }
.query-login-card__security { margin: 18px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: #64748b; font-size: 10px; text-align: center; }
.query-login-card__security i { color: #16a34a; }

.modal { display: none; position: fixed; z-index: 1000; inset: 0; overflow: auto; background: rgba(15,23,42,.58); justify-content: center; align-items: center; }
.prose { color: #1f2937; }

@media (max-width: 760px) {
    .public-query-header__inner, .public-query-footer__inner { width: min(100% - 20px, 1440px); }
    .public-query-brand__copy small, .public-query-session, .public-query-footer__copyright { display: none; }
    .public-query-nav__button span { display: none; }
    .public-query-nav__button { width: 40px; padding: 0; }
    .public-query-main { padding: 14px; align-items: flex-start; }
    .query-login-card { margin-top: 14px; padding: 24px 18px; border-radius: 19px; }
    .query-login-card__guide { grid-template-columns: 1fr; }
    .query-login-card__guide div { min-height: auto; flex-direction: row; align-items: center; justify-content: flex-start; }
    .public-query-footer__links a span { display: none; }
}
