/* Synergix SpamShield — portal styles */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e2e5ea;
    --text: #1e242e;
    --muted: #6b7280;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #dc2626;
    --ok-bg: #dcfce7;
    --ok-fg: #166534;
    --block-bg: #fee2e2;
    --block-fg: #991b1b;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
hr.divider { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
h1, h2, h3 { line-height: 1.25; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem .95rem; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .65rem; font-size: .85em; }
.btn-lg { padding: .75rem 1.35rem; font-size: 1.05em; }
.btn-full { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label { display: block; font-weight: 600; margin-bottom: .35rem; }
.form-input {
    width: 100%; padding: .55rem .7rem; border: 1px solid var(--border);
    border-radius: 8px; font: inherit; background: var(--surface); color: var(--text);
}
.form-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
textarea.form-input { resize: vertical; }
.form-input-sm { width: auto; padding: .4rem .55rem; font-size: .9em; }
.form-inline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.form-check { margin: .6rem 0; }
.form-check label { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.form-section-title { margin: .25rem 0 .35rem; font-size: 1rem; }
.input-with-toggle { display: flex; gap: .4rem; }
.input-with-toggle .form-input { flex: 1; }
.pwd-toggle { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 .7rem; cursor: pointer; font: inherit; }

/* ── Alerts / flash ── */
.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: var(--block-bg); color: var(--block-fg); }
.flash-message { padding: .7rem 1rem; border-radius: 8px; margin: 1rem; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }

/* ── Auth ── */
body[data-page="auth"] { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-container { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand-name { margin: .6rem 0 .2rem; font-size: 1.4rem; }
.auth-brand-tagline { color: var(--muted); margin: 0; font-size: .9rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.auth-title { margin: 0 0 1.25rem; font-size: 1.2rem; }
.auth-link { margin-top: 1.1rem; text-align: center; color: var(--muted); }

/* ── Logo mark ── */
.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; background: var(--primary);
    color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .5px;
}
.logo-mark-lg { width: 48px; height: 48px; font-size: 1.1rem; margin: 0 auto; }

/* ── App shell ── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-text { font-size: .95rem; }
.sidebar-toggle, .sidebar-open-btn { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--text); }
.sidebar-nav { padding: .75rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.nav-item { padding: .55rem .7rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav-item:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .7rem; }
.user-info { display: flex; align-items: center; gap: .6rem; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-details { min-width: 0; }
.user-name { font-weight: 600; font-size: .9rem; }
.user-email { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-header { display: none; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.mobile-title { font-weight: 600; }
.page-wrap { padding: 1.75rem; max-width: 1080px; width: 100%; }
.sidebar-overlay { display: none; }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 1.4rem; }
.section-title { margin: 2rem 0 .75rem; font-size: 1.1rem; }

/* ── Stats bar ── */
.stats-bar { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 130px; }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .82rem; }
.stat-block .stat-value { color: var(--block-fg); }

/* ── Cards / tables ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th, .data-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Badges ── */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: capitalize; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-block { background: var(--block-bg); color: var(--block-fg); }
.badge-muted { background: #eceef1; color: var(--muted); }

/* ── Site cards ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.site-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.site-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.site-card-head h3 { margin: 0; font-size: 1.02rem; }
.site-card-domain { font-size: .85rem; margin: .15rem 0 .8rem; }
.site-card-stats { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
.site-card-stats strong { color: var(--text); }
.site-card-actions { display: flex; gap: .5rem; margin-top: .9rem; }

/* ── Embed / code snippet ── */
.embed-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.code-snippet {
    background: #0f172a; color: #e2e8f0; padding: .85rem 1rem; border-radius: 8px;
    overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem; white-space: pre; margin: .6rem 0;
}
.embed-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.embed-actions form { display: inline; }

/* ── Country grid ── */
.country-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .15rem .75rem;
    max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px;
    padding: .6rem .8rem; margin-top: .5rem;
}
.country-item { display: flex; gap: .45rem; align-items: center; font-size: .85rem; padding: .12rem 0; cursor: pointer; }

/* ── Filter bar / pagination ── */
.filter-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-count { color: var(--muted); font-size: .85rem; margin-left: auto; }
.pagination { display: flex; gap: .8rem; align-items: center; justify-content: center; margin-top: 1rem; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .btn { margin-top: 1rem; }

/* ── Landing ── */
body[data-page="landing"] { background: var(--surface); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 2rem; border-bottom: 1px solid var(--border); }
.nav-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.nav-links { display: flex; gap: .6rem; }
.hero { max-width: 820px; margin: 0 auto; padding: 4rem 2rem 3rem; text-align: center; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--primary); margin: 0 0 .6rem; }
.hero-title { font-size: 2.3rem; margin: 0 0 1rem; }
.hero-subtitle { font-size: 1.05rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.75rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-note { color: var(--muted); font-size: .9rem; margin: 0; }
.features { max-width: 960px; margin: 0 auto; padding: 2rem 2rem 3rem; }
.how { max-width: 720px; margin: 0 auto; padding: 1rem 2rem 4rem; }
.how-steps { color: var(--muted); line-height: 1.9; padding-left: 1.2rem; }
.how-steps strong { color: var(--text); }
.features-title { text-align: center; margin-bottom: 1.75rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.feature-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.feature-card h3 { margin: .5rem 0 .35rem; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.feature-icon { font-size: 1.6rem; }
.landing-footer { text-align: center; padding: 2rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ── Responsive ── */
@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .mobile-header { display: flex; }
    .sidebar-open-btn { display: block; }
    .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
    .form-row { grid-template-columns: 1fr; }
    .page-wrap { padding: 1.25rem; }
}
