/* Estilo minimo das telas de autenticacao (CSP: style-src 'self', sem inline). */
:root {
    color-scheme: light dark;
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1d2330;
    --muted: #5b6475;
    --accent: #2f5bea;
    --accent-text: #ffffff;
    --border: #d5d9e0;
    --error-bg: #fdecec;
    --error-text: #9b1c1c;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12151c;
        --card: #1c212b;
        --text: #e8ebf1;
        --muted: #a3abba;
        --accent: #7c9bff;
        --accent-text: #0d1220;
        --border: #343b49;
        --error-bg: #3a1d1d;
        --error-text: #ffb4b4;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.brand { margin: 0 0 8px; font-size: 1.25rem; color: var(--accent); }
h2 { margin: 0 0 16px; font-size: 1.5rem; }
p, ol { color: var(--muted); }

label, .label { display: block; margin: 12px 0 4px; font-weight: 600; color: var(--text); }

input, select {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

button {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    font: inherit;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

button.link { background: none; color: var(--muted); text-decoration: underline; }

.error {
    padding: 10px 12px;
    color: var(--error-text);
    background: var(--error-bg);
    border-radius: 8px;
}

.secret {
    font: 600 1.15rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.05em;
    color: var(--text);
    word-break: break-all;
}

.uri { font-family: ui-monospace, monospace; font-size: 0.8rem; word-break: break-all; }

select option { color: var(--text); background: var(--card); }

.error ul { margin: 0; padding-left: 1.1rem; }

/* Honeypot do cadastro: fora da tela (sem display:none, que alguns robos ignoram). */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cf-turnstile { margin-top: 16px; }

/* Link com cara de botao (ex.: "Entrar com Google"): so CSS, sem JS (CSP). */
a.button {
    display: block;
    margin-top: 16px;
    padding: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
}

a.button-secondary { color: var(--text); background: var(--bg); border: 1px solid var(--border); }

.divider { margin: 16px 0 0; text-align: center; color: var(--muted); }

input[readonly] { color: var(--muted); }

/* Avisos de sucesso (flash `status`). */
.notice {
    padding: 10px 12px;
    color: var(--notice-text);
    background: var(--notice-bg);
    border-radius: 8px;
}

:root { --notice-bg: #e7f6ec; --notice-text: #1d6b35; --danger: #b42318; }

@media (prefers-color-scheme: dark) {
    :root { --notice-bg: #17331f; --notice-text: #a6e3b8; --danger: #f97066; }
}

/* Painel do super (Task 8): sem JS, sem estilo inline (CSP). */
body.super { align-items: flex-start; }

.card-wide { max-width: 1100px; }

.super-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }

.super-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.super-nav a { color: var(--accent); font-weight: 600; }

form.inline { display: inline; }

form.inline button.link, .super-nav button.link { width: auto; margin: 0; padding: 0; }

.narrow { max-width: 420px; }

h3 { margin: 0 0 8px; font-size: 1.1rem; }

.request { padding: 16px 0; border-top: 1px solid var(--border); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }

.facts dt { font-weight: 600; color: var(--muted); }

.facts dd { margin: 0; word-break: break-word; }

.actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: end; }

@media (max-width: 640px) {
    .actions { grid-template-columns: 1fr; }
}

textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
}

button.button-danger { background: var(--danger); color: #ffffff; }

button.button-small { width: auto; margin: 0; padding: 6px 10px; font-size: 0.9rem; }

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border-radius: 999px;
    vertical-align: middle;
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td { padding: 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }

th { color: var(--muted); font-weight: 600; }

.pager { display: flex; gap: 16px; margin-top: 16px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Modo suporte (impersonacao somente leitura do super) */
.impersonation-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 16px;
    padding: 10px 12px;
    color: var(--error-text);
    background: var(--error-bg);
    border: 1px solid var(--error-text);
    border-radius: 8px;
}
.impersonation-banner span { flex: 1 1 200px; }
