/* ============================================================
   VegaX — Painel + Login (preto puro / branco, estética X)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Geist:wght@300;400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
    --bg:        #000000;
    --surface:   rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.05);
    --border:    rgba(255, 255, 255, 0.10);
    --border-2:  rgba(255, 255, 255, 0.18);
    --text:      #ffffff;
    --muted:     rgba(255, 255, 255, 0.62);
    --faint:     rgba(255, 255, 255, 0.40);
    --display:   'Bricolage Grotesque', sans-serif;
    --body:      'Geist', -apple-system, system-ui, sans-serif;
    --mono:      'Geist Mono', ui-monospace, monospace;
    --radius:    16px;
    --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    letter-spacing: -0.01em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
::selection { background: #fff; color: #000; }
a { color: inherit; text-decoration: none; }

/* atmosfera sutil de fundo */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(70% 50% at 50% -10%, rgba(255,255,255,.06), transparent 60%),
        radial-gradient(50% 40% at 100% 100%, rgba(255,255,255,.04), transparent 60%);
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.brand {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--display); font-weight: 700; font-size: 20px;
    letter-spacing: -0.03em;
}
.logo { color: #fff; font-size: 17px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.badge {
    background: var(--surface-2); border: 1px solid var(--border);
    padding: 6px 13px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
    font-family: var(--mono); letter-spacing: .02em;
}
.user-pill {
    font-size: 13px; color: var(--muted); max-width: 200px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) { .user-pill { display: none; } }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 34px auto; padding: 0 20px; }
.grid {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px;
    align-items: start;
}
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.card {
    background: linear-gradient(180deg, var(--surface), transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
}
.card h2 {
    font-family: var(--display); font-weight: 700; font-size: 19px;
    letter-spacing: -0.02em; margin-bottom: 18px;
}
.card h3 { font-size: 14px; color: var(--muted); font-weight: 500; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-head h2 { margin: 0; }

/* ---------- Compositor ---------- */
textarea {
    width: 100%; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; color: var(--text); padding: 15px; font-size: 16px;
    resize: vertical; font-family: inherit; letter-spacing: -0.01em;
    transition: border-color .2s;
}
textarea::placeholder { color: var(--faint); }
textarea:focus { outline: none; border-color: var(--border-2); }
.char-counter { text-align: right; color: var(--faint); font-size: 12px; font-family: var(--mono); margin: 8px 2px 18px; }

.accounts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.select-all { font-size: 13px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 7px; }

.account-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px; margin-bottom: 20px;
}
.account-chip {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 9px 11px; cursor: pointer;
    transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.account-chip:hover { border-color: var(--border-2); transform: translateY(-1px); }
.account-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.account-chip input { accent-color: #fff; }
.account-chip:has(input:checked) { border-color: #fff; background: rgba(255,255,255,.10); }
.acc-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Lista de contas ---------- */
.account-list { list-style: none; }
.account-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.account-list li:last-child { border-bottom: none; }
.account-list img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.acc-info { flex: 1; display: flex; flex-direction: column; }
.acc-info strong { font-weight: 600; }
.acc-info span { color: var(--muted); font-size: 13px; }

/* ---------- Histórico ---------- */
.history { list-style: none; }
.history li { padding: 13px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: none; }
.hist-text { font-size: 14px; margin-bottom: 7px; }
.hist-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.hist-meta .fail { color: rgba(255,255,255,.85); }
.hist-meta .date { margin-left: auto; color: var(--faint); }
.status { text-transform: uppercase; font-size: 10px; padding: 3px 8px; border-radius: 6px; letter-spacing: .6px; font-family: var(--mono); }
.status-sent { background: #fff; color: #000; }
.status-partial { background: rgba(255,255,255,.22); color: #fff; }
.status-failed { background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid var(--border); }
.status-pending { background: var(--surface-2); color: var(--muted); }

/* ---------- Botões ---------- */
.btn {
    border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 14px;
    padding: 11px 18px; font-weight: 500; font-family: var(--body); letter-spacing: -0.01em;
    transition: background .2s, transform .2s var(--ease), border-color .2s, opacity .2s;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255,255,255,.32); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; }

/* ---------- Alertas ---------- */
.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 22px; font-size: 14px; border: 1px solid var(--border); }
.alert-success { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.35); color: #fff; }
.alert-error { background: rgba(255,255,255,.03); border-color: var(--border-2); color: var(--muted); }

.empty { color: var(--muted); font-size: 14px; font-weight: 300; padding: 8px 0; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
    position: relative;
    background: linear-gradient(180deg, var(--surface), transparent);
    border: 1px solid var(--border);
    border-radius: 22px; padding: 40px; width: 100%; max-width: 390px;
    margin: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.login-card .brand { justify-content: center; gap: 10px; margin-bottom: 6px; }
.login-card .brand .logo { font-size: 22px; animation: spin 12s linear infinite; }
.login-card h1 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.04em; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card .subtitle { text-align: center; color: var(--muted); font-size: 14px; font-weight: 300; margin-bottom: 28px; }
.login-card label { display: block; font-size: 12px; color: var(--faint); font-family: var(--mono); letter-spacing: .05em; text-transform: uppercase; margin: 16px 0 7px; }
.login-card input {
    width: 100%; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 13px 14px; color: var(--text); font-size: 15px;
    font-family: inherit; transition: border-color .2s;
}
.login-card input:focus { outline: none; border-color: var(--border-2); }
.login-card .btn { margin-top: 26px; }
.login-back { display: block; text-align: center; margin-top: 20px; color: var(--faint); font-size: 13px; transition: color .2s; }
.login-back:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
