/* SEOPublisher - Design System
   Paleta clara, tipografia limpa, foco em produtividade interna */

:root {
    --c-primary: #2563eb;
    --c-primary-hover: #1d4ed8;
    --c-primary-soft: #eff6ff;
    --c-text: #0f172a;
    --c-text-muted: #64748b;
    --c-text-light: #94a3b8;
    --c-bg: #f8fafc;
    --c-surface: #ffffff;
    --c-border: #e2e8f0;
    --c-border-strong: #cbd5e1;
    --c-success: #16a34a;
    --c-success-soft: #f0fdf4;
    --c-danger: #dc2626;
    --c-danger-soft: #fef2f2;
    --c-warning: #d97706;
    --c-warning-soft: #fffbeb;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--c-text);
    background: var(--c-bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px 0; font-weight: 600; color: var(--c-text); letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px 0; }
.muted { color: var(--c-text-muted); }
hr.sep { border: none; border-top: 1px solid var(--c-border); margin: 24px 0; }

/* === SHELL === */
.app-body { min-height: 100vh; }
.app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}
.app-sidebar {
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.app-main {
    padding: 24px 32px 48px;
    max-width: 1280px;
    width: 100%;
}
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 600; margin: 0; }

/* === CLIENT CONTEXT BAR === */
.client-context-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #fef3c7 100%);
    border: 1px solid #dbeafe;
    border-radius: 10px;
    margin-bottom: 18px;
}
.client-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.client-logo-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-primary, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: 6px;
}
.client-logo-fallback {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px;
}
.client-logo-fallback .brand-mark {
    width: 32px;
    height: 32px;
    margin: 0;
}
.client-context-meta {
    flex: 1;
    line-height: 1.3;
}
.client-context-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.client-context-name {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}
.client-context-link {
    font-size: 13px;
    color: var(--c-primary, #2563eb);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.client-context-link:hover { text-decoration: underline; }

/* === BRAND === */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 16px;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.brand:hover { opacity: 0.85; }
.brand-logo {
    max-width: 100%;
    height: auto;
    max-height: 44px;
    display: block;
}
.brand-mark {
    background: var(--c-primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
}
.brand-mark-lg { width: 56px; height: 56px; font-size: 20px; border-radius: var(--radius); }
.brand-title { font-weight: 600; font-size: 14px; }
.brand-sub { font-size: 11px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* === NAV === */
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-light);
    padding: 16px 12px 6px;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--c-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.12s;
    cursor: pointer;
}
.nav-item:hover { background: var(--c-bg); text-decoration: none; }
.nav-item.is-active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.nav-item.is-disabled { color: var(--c-text-light); cursor: not-allowed; pointer-events: none; }
.nav-icon { width: 18px; text-align: center; opacity: 0.7; font-size: 14px; }
.nav-item.is-active .nav-icon { opacity: 1; }

/* === SIDEBAR FOOTER === */
.sidebar-footer {
    border-top: 1px solid var(--c-border);
    padding-top: 12px;
    margin-top: 12px;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--c-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.logout-form { margin-top: 6px; padding: 0 8px; }
.btn-link {
    background: none; border: none; padding: 6px 0;
    color: var(--c-text-muted); font-size: 12px; cursor: pointer; font-family: inherit;
}
.btn-link:hover { color: var(--c-danger); }

/* === CARDS === */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.card-head h2 { margin: 0; }
.card-head .muted { margin-top: 4px; }

.welcome-card {
    background: linear-gradient(135deg, var(--c-primary) 0%, #4f46e5 100%);
    color: #fff;
    padding: 28px 32px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.welcome-card h2 { color: #fff; margin: 0 0 6px 0; }
.welcome-card p { color: rgba(255,255,255,0.85); margin: 0; max-width: 720px; }

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--c-text);
    transition: all 0.15s;
    display: block;
}
.stat-card:hover {
    border-color: var(--c-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.stat-label { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-value { font-size: 32px; font-weight: 700; margin: 4px 0; letter-spacing: -0.02em; }
.stat-foot { font-size: 12px; color: var(--c-primary); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.info-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.info-card h3 { margin-top: 0; }
.info-card ol { padding-left: 20px; margin: 8px 0; }
.info-card ol li { margin: 6px 0; color: var(--c-text-muted); }

/* === FORMS === */
.form { display: block; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--c-text); }
.field .req { color: var(--c-danger); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field .hint { color: var(--c-text-muted); font-size: 12px; }
.field-error { color: var(--c-danger); font-size: 12px; margin-top: 2px; }

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}
.form-actions-spacer { flex: 1; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-strong);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
}
.btn:hover { background: var(--c-bg); text-decoration: none; }
.btn-primary {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
.btn-danger {
    background: var(--c-danger);
    border-color: var(--c-danger);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-danger-soft {
    background: transparent;
    border-color: #fecaca;
    color: #dc2626;
}
.btn-danger-soft:hover { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* === TABLES === */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    border-bottom: 1px solid var(--c-border);
    font-weight: 600;
}
.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--c-bg); }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--c-bg);
    color: var(--c-text-muted);
}
.badge-active, .badge-connected { background: var(--c-success-soft); color: var(--c-success); }
.badge-pending { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-disconnected, .badge-error { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-priority-high { background: #fef3c7; color: #92400e; }
.badge-priority-medium { background: var(--c-bg); color: var(--c-text-muted); }
.badge-priority-low { background: var(--c-bg); color: var(--c-text-light); }

/* === ANCHOR CHIPS === */
.anchor-chip {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 2px 2px 0;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}
.link-preview {
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
}
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }
.actions-cell form { display: inline-block; }

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--c-bg);
    border-radius: var(--radius-sm);
    margin: 16px 0;
    flex-wrap: wrap;
}
.filter-bar label {
    font-size: 13px;
    color: var(--c-text-muted);
    margin: 0;
    font-weight: 500;
}
.filter-bar select {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    background: white;
    font-size: 13px;
    min-width: 240px;
}

/* === INSTALL CHECKS === */
.install-checks {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
}
.install-checks li {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: var(--c-bg);
    font-size: 13px;
}
.install-checks li.ok { background: var(--c-success-soft); color: #14532d; }
.install-checks li.fail { background: var(--c-danger-soft); color: #7f1d1d; }
.install-checks li.pending { background: var(--c-warning-soft); color: #78350f; }
.install-checks li::before { content: '○ '; font-weight: 700; }
.install-checks li.ok::before { content: '✓ '; }
.install-checks li.fail::before { content: '✗ '; }
.install-checks li.pending::before { content: '… '; }

/* === ALERTS === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 13.5px;
}
.alert-success { background: var(--c-success-soft); border-color: #bbf7d0; color: #14532d; }
.alert-error { background: var(--c-danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: var(--c-warning-soft); border-color: #fde68a; color: #78350f; }

/* === CODE === */
.code-pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-text);
    word-break: break-all;
}

/* === INFO LIST === */
.info-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 24px;
    margin: 16px 0 0;
}
.info-list dt { color: var(--c-text-muted); font-size: 13px; }
.info-list dd { margin: 0; font-size: 13.5px; word-break: break-word; }

/* === EMPTY === */
.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--c-text-muted);
}
.empty p { margin: 6px 0; }

/* === DANGER ZONE === */
.danger-zone {
    border: 1px dashed var(--c-danger);
    background: var(--c-danger-soft);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}
.danger-zone h3 { color: var(--c-danger); margin-top: 0; }

/* === AUTH === */
.auth-body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-shell { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgb(0 0 0 / 0.08), 0 1px 4px rgb(0 0 0 / 0.04);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-mark-lg { margin: 0 auto 12px; display: inline-flex; }
.auth-brand-logo {
    max-width: 240px;
    height: auto;
    margin: 0 auto 14px;
    display: block;
}
.auth-brand h1 { margin: 0 0 4px; font-size: 24px; }
.auth-brand p { margin: 0; }
.auth-foot { text-align: center; color: var(--c-text-muted); font-size: 12px; margin-top: 24px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--c-border); }
    .app-main { padding: 20px 16px 32px; }
    .form-grid { grid-template-columns: 1fr; }
    .info-list { grid-template-columns: 1fr; }
    .info-list dt { font-weight: 600; }
}

/* ========== Campanhas: form com secoes colapsaveis ========== */
.campaign-form .section {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 14px;
    background: var(--card-bg, #fff);
}
.campaign-form .section > summary {
    cursor: pointer;
    padding: 14px 18px;
    font-size: 14px;
    list-style: none;
    user-select: none;
    border-radius: 8px;
    transition: background .15s;
}
.campaign-form .section > summary:hover {
    background: rgba(37, 99, 235, 0.04);
}
.campaign-form .section > summary::-webkit-details-marker { display: none; }
.campaign-form .section > summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 10px;
    color: #94a3b8;
    font-size: 11px;
    transition: transform .15s;
}
.campaign-form .section[open] > summary::before {
    transform: rotate(90deg);
    color: #2563eb;
}
.campaign-form .section[open] > summary {
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
}
.campaign-form .section .section-body {
    padding: 18px;
}

.form-grid.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.form-grid.three-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.checkbox-group {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 10px 0 14px;
}
.checkbox-group legend {
    padding: 0 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.checkbox-group .cb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    margin-bottom: 6px;
    font-size: 14px;
    cursor: pointer;
}
.checkbox-group .cb input[type="checkbox"] { margin: 0; }

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.code-block {
    background: #f4f5f7;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .form-grid.two-cols,
    .form-grid.three-cols { grid-template-columns: 1fr; }
}

/* ========== Preview de artigo gerado ========== */
.article-preview {
    max-width: 720px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 28px;
    margin: 12px 0 24px;
    line-height: 1.7;
    font-size: 15px;
    color: #1f2937;
}
.article-preview h2 {
    font-size: 22px;
    margin: 28px 0 12px;
    color: #0f172a;
}
.article-preview h3 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: #1f2937;
}
.article-preview p { margin: 0 0 14px; }
.article-preview ul,
.article-preview ol { margin: 0 0 14px 20px; padding-left: 20px; }
.article-preview li { margin: 6px 0; }
.article-preview a { color: #2563eb; text-decoration: underline; }
.article-preview blockquote {
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    margin: 14px 0;
    padding: 12px 16px;
    color: #1e3a8a;
    border-radius: 0 6px 6px 0;
}
.article-preview blockquote.callout {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #78350f;
}
.article-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}
.article-preview th,
.article-preview td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.article-preview th { background: #f9fafb; font-weight: 600; }
.article-preview strong { color: #0f172a; }

/* ========== Preloader full-screen para gerar artigo ========== */
.sp-preloader {
    position: fixed;
    inset: 0;
    background: #2563eb;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 24px;
    animation: sp-fade-in 0.25s ease-out;
}
.sp-preloader.is-visible { display: flex; }

.sp-preloader-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 28px;
    opacity: 0.95;
}

.sp-preloader-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 32px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 1s linear infinite;
}

.sp-preloader-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    line-height: 1.2;
    max-width: 600px;
}

.sp-preloader-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 28px;
    max-width: 520px;
    line-height: 1.5;
}

.sp-preloader-dots {
    display: inline-flex;
    gap: 10px;
}
.sp-preloader-dots span {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: sp-bounce 1.4s ease-in-out infinite both;
}
.sp-preloader-dots span:nth-child(1) { animation-delay: -0.32s; }
.sp-preloader-dots span:nth-child(2) { animation-delay: -0.16s; }
.sp-preloader-dots span:nth-child(3) { animation-delay: 0s; }

.sp-preloader-hint {
    margin-top: 36px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 480px;
    line-height: 1.5;
}

@keyframes sp-spin {
    to { transform: rotate(360deg); }
}
@keyframes sp-bounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}
@keyframes sp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 600px) {
    .sp-preloader-title { font-size: 24px; }
    .sp-preloader-subtitle { font-size: 14px; }
}

/* ========== Celebracao de sucesso (?just_created=1) ========== */
.sp-celebration {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sp-celebration.is-visible { opacity: 1; }
.sp-confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.sp-celebration-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    transform: scale(0.6);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    transition-delay: 0.1s;
}
.sp-celebration.is-visible .sp-celebration-content {
    transform: scale(1);
    opacity: 1;
}
.sp-celebration-checkmark {
    background: #fff;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.4);
}
.sp-celebration-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.sp-celebration-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 380px;
}
.sp-check-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: sp-stroke 0.5s ease-out 0.2s forwards;
}
.sp-check-mark {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: sp-stroke 0.3s ease-out 0.6s forwards;
}
@keyframes sp-stroke {
    to { stroke-dashoffset: 0; }
}
@media (max-width: 600px) {
    .sp-celebration-title { font-size: 28px; }
    .sp-celebration-checkmark { width: 90px; height: 90px; }
    .sp-celebration-checkmark svg { width: 60px; height: 60px; }
}

/* ========== Grid de imagens do site ========== */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.img-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.img-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}
.img-card-info {
    padding: 10px;
}
.img-card-meta {
    margin-bottom: 6px;
}
.code-pill {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: #1f2937;
}
