@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('lib/tailwindcss/dist/preflight.css');

:root {
    --color-bg: #0f1117;
    --color-surface: #1a1d27;
    --color-surface-2: #21253a;
    --color-surface-3: #2a2f47;
    --color-border: rgba(255,255,255,0.08);
    --color-border-focus: rgba(99,102,241,0.7);
    --color-text: #e8eaf6;
    --color-text-muted: #8b90a7;
    --color-text-faint: #555b78;
    --color-accent: #6366f1;
    --color-accent-hover: #818cf8;
    --color-accent-dim: rgba(99,102,241,0.15);
    --color-success: #22c55e;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-user-bubble: #1e3a5f;
    --color-user-bubble-border: rgba(59,130,246,0.3);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--color-bg);
}

h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--color-text); }
h2 { font-size: 1.2rem; font-weight: 600; color: var(--color-text); }
h3 { font-size: 1rem; font-weight: 600; color: var(--color-text); }

a { color: var(--color-accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--color-surface-3);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: #a5b4fc;
}

pre code {
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.page-width {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-default {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-default:hover { background: var(--color-surface-3); border-color: rgba(255,255,255,0.15); }

.btn-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-subtle:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-dim);
    color: var(--color-accent-hover);
}

/* ── Form validation ─────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--color-success); }
.invalid { outline: 1px solid var(--color-error); }
.validation-message { color: var(--color-error); font-size: 0.8rem; }

/* ── Blazor error boundary ───────────────────────────────── */
.blazor-error-boundary {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: #fca5a5;
    font-size: 0.875rem;
}
.blazor-error-boundary::after { content: "Ocorreu um erro inesperado."; }

#blazor-error-ui {
    color-scheme: dark;
    background: rgba(239,68,68,0.15);
    border-top: 1px solid rgba(239,68,68,0.3);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fca5a5;
    font-size: 0.875rem;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Shared badge ────────────────────────────────────────── */
.type-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.type-badge.sqlserver  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.type-badge.postgresql { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.type-badge.jira       { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.type-badge.confluence { background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.type-badge.file       { background: rgba(139,144,167,0.12); color: #8b90a7; border: 1px solid rgba(139,144,167,0.2); }
