/* bouwen.ai — Design System (mobile-first) */

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

:root {
    --bg: #FAFAF8;
    --text: #1A1A2E;
    --accent: #2563EB;
    --success: #16A34A;
    --success-bg: #F0FDF4;
    --warning: #EA580C;
    --warning-bg: #FFF7ED;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --subtle: #94A3B8;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --muted: #F1F5F9;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-pill: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-focus: 0 0 0 3px rgba(37,99,235,0.15);
    --font: 'Inter', -apple-system, system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --max-w: 680px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ── Logo ──────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: baseline; font-weight: 700; letter-spacing: -0.04em; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-text { color: var(--text); }
.logo-ai { color: var(--subtle); }
.logo:hover .logo-dot-circle { transform: scale(1.3); }
.logo-hero { font-size: 2.6rem; }
.logo-header { font-size: 1.15rem; }

@keyframes logoPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.logo-dot-circle {
    display: inline-block; width: 8px; height: 8px;
    background: var(--accent); border-radius: 50%;
    margin: 0 1px 2px 0; vertical-align: baseline;
    animation: logoPulse 3s ease-in-out infinite;
    transition: transform 0.3s;
}
.logo-hero .logo-dot-circle { width: 10px; height: 10px; margin-bottom: 3px; }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(250,250,248,0.88); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 24px 16px; text-align: center; font-size: 0.7rem; color: var(--subtle); line-height: 1.7; }
.mt-4 { margin-top: 4px; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px; }
.hero-content { width: 100%; max-width: 560px; text-align: center; margin-top: -60px; }
.hero-tagline { margin-top: 12px; font-size: 1.05rem; color: var(--subtle); }

/* ── Search ────────────────────────────────────────────────── */
.search-wrap { position: relative; margin-top: 28px; }
.search-input-wrap {
    position: relative; display: flex; align-items: center;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input-wrap:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.search-icon { width: 18px; height: 18px; margin-left: 16px; color: var(--subtle); flex-shrink: 0; }
.search-input { width: 100%; padding: 14px 12px; font-family: var(--font); font-size: 1rem; border: none; outline: none; background: transparent; color: var(--text); }
.search-input::placeholder { color: var(--subtle); opacity: 0.6; }
.search-enter { width: 30px; height: 30px; margin-right: 10px; display: flex; align-items: center; justify-content: center; background: var(--muted); border-radius: 8px; color: var(--subtle); flex-shrink: 0; opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; cursor: pointer; border: none; font-size: 0.75rem; }
.search-input:not(:placeholder-shown) ~ .search-enter { opacity: 1; }
.search-enter:hover { background: var(--accent); color: white; }

.search-header .search-input-wrap { background: var(--muted); border-color: transparent; box-shadow: none; }
.search-header .search-input-wrap:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.search-header .search-input { padding: 8px 10px; font-size: 0.85rem; }
.search-header .search-icon { width: 14px; height: 14px; margin-left: 12px; }

/* ── Autocomplete ──────────────────────────────────────────── */
.suggestions { position: absolute; z-index: 50; width: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); overflow: hidden; animation: slideDown 0.15s ease; }
.suggestions.hidden { display: none; }
@keyframes slideDown { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
.suggestion-item { padding: 8px 14px; cursor: pointer; font-size: 0.85rem; color: var(--text); transition: background 0.1s; border-bottom: 1px solid rgba(0,0,0,0.04); }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active { background: var(--muted); }

/* ── Examples & Trust ──────────────────────────────────────── */
.examples { margin-top: 16px; font-size: 0.8rem; color: var(--subtle); }
.example-link { background: none; border: none; font-family: var(--font); font-size: 0.8rem; color: var(--accent); cursor: pointer; padding: 0; }
.example-link:hover { text-decoration: underline; }
.trust-signals { margin-top: 40px; display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 0.75rem; color: var(--subtle); }
.trust-item { display: flex; align-items: center; gap: 5px; }
.trust-item svg { width: 14px; height: 14px; opacity: 0.5; }

/* ── Result Page ───────────────────────────────────────────── */
.result-main { flex: 1; max-width: var(--max-w); width: 100%; margin: 0 auto; padding: 20px 16px; }
.address-header { margin-bottom: 16px; }
.address-title { font-size: 1.2rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.3; }
.address-meta { font-size: 0.75rem; color: var(--subtle); margin-top: 2px; }

/* ── Facts Grid ────────────────────────────────────────────── */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 16px; }
.fact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.fact-label { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--subtle); }
.fact-value { font-family: var(--mono); font-size: 1rem; font-weight: 500; color: var(--text); margin-top: 1px; }

/* ── Summary Card ──────────────────────────────────────────── */
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.summary-text { font-size: 0.9rem; color: var(--text); line-height: 1.6; }
.bestemming-badge { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-label { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--subtle); }
.badge-name { font-size: 0.8rem; font-weight: 600; color: var(--accent); background: rgba(37,99,235,0.08); padding: 3px 10px; border-radius: var(--radius-pill); }
.badge-plan { font-size: 0.7rem; color: var(--subtle); }

/* ── Regels Grid ───────────────────────────────────────────── */
.regels-grid { display: grid; gap: 8px; margin-bottom: 16px; }
.regel-card { border-radius: var(--radius-sm); padding: 12px 14px; border-left: 3px solid transparent; }
.regel-allowed { background: var(--success-bg); border-left-color: var(--success); }
.regel-conditional { background: var(--warning-bg); border-left-color: var(--warning); }
.regel-forbidden { background: var(--danger-bg); border-left-color: var(--danger); }
.regel-header { display: flex; align-items: center; gap: 8px; }
.regel-icon { font-size: 0.9rem; flex-shrink: 0; }
.regel-titel { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.regel-toelichting { font-size: 0.78rem; color: var(--subtle); margin-top: 4px; line-height: 1.5; padding-left: 26px; }

.toggle-more {
    grid-column: 1 / -1; width: 100%;
    padding: 8px; background: none; border: 1px dashed var(--border);
    border-radius: var(--radius-sm); font-family: var(--font);
    font-size: 0.78rem; color: var(--accent); cursor: pointer;
    transition: background 0.15s;
}
.toggle-more:hover { background: var(--muted); }

/* ── Specs Grid ────────────────────────────────────────────── */
.specs-grid { margin-bottom: 20px; }
.specs-inner { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-item { background: var(--muted); border-radius: 8px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; }
.spec-label { font-size: 0.7rem; color: var(--subtle); }
.spec-value { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--text); }

/* ── Chat Prominent ────────────────────────────────────────── */
.chat-prominent {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 16px;
    margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.chat-heading { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }

.faq-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.faq-btn {
    background: var(--muted); border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: 7px 14px;
    font-family: var(--font); font-size: 0.78rem; font-weight: 500;
    color: var(--text); cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.faq-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.chat-messages { margin-bottom: 12px; }
.chat-user {
    background: var(--accent); color: white;
    border-radius: 14px 14px 4px 14px;
    padding: 10px 14px; max-width: 85%; margin-left: auto;
    margin-bottom: 8px; font-size: 0.85rem;
    animation: fadeIn 0.2s ease;
}
.chat-ai {
    background: var(--muted); border: 1px solid var(--border);
    border-radius: 14px 14px 14px 4px;
    padding: 10px 14px; max-width: 90%;
    margin-bottom: 8px; font-size: 0.85rem;
    animation: fadeIn 0.2s ease;
}
.chat-ai code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; font-family: var(--mono); font-size: 0.8em; }

.chat-input-wrap { display: flex; gap: 6px; }
.chat-input {
    flex: 1; padding: 12px 14px; font-family: var(--font); font-size: 0.875rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    outline: none; background: var(--bg); color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.chat-input::placeholder { color: var(--subtle); opacity: 0.5; }
.chat-send {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: white; border: none;
    border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
    transition: background 0.15s;
}
.chat-send:hover { background: #1d4ed8; }
.chat-send svg { width: 18px; height: 18px; }
.question-counter { margin-top: 6px; font-size: 0.7rem; color: var(--subtle); }

/* ── Vergunningen ──────────────────────────────────────────── */
.verg-section { margin-bottom: 16px; }
.section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--subtle); margin-bottom: 6px; }
.verg-text { font-size: 0.85rem; color: var(--text); line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }

/* ── Sources ───────────────────────────────────────────────── */
.sources-section { margin-bottom: 16px; }
.sources-label { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--subtle); margin-bottom: 6px; }
.source-tag { display: inline-block; font-size: 0.7rem; color: var(--subtle); background: var(--muted); padding: 3px 10px; border-radius: var(--radius-pill); margin: 2px 4px 2px 0; }
.source-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--subtle); text-decoration: none; margin: 2px 8px 2px 0; }
.source-link:hover { color: var(--accent); text-decoration: none; }
.source-link .favicon { width: 12px; height: 12px; border-radius: 2px; }

/* ── Account Prompt ────────────────────────────────────────── */
.account-prompt { padding: 16px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--radius-sm); margin-bottom: 16px; }
.account-prompt-title { font-size: 0.85rem; font-weight: 600; color: #1E40AF; }
.account-prompt-text { font-size: 0.78rem; color: #3B82F6; margin-top: 2px; }
.account-prompt-btn { display: inline-block; margin-top: 8px; padding: 8px 16px; background: var(--accent); color: white; font-family: var(--font); font-size: 0.78rem; font-weight: 600; border-radius: 8px; text-decoration: none; }
.account-prompt-btn:hover { background: #1d4ed8; text-decoration: none; }

/* ── Error ─────────────────────────────────────────────────── */
.error-card { padding: 16px; background: var(--danger-bg); border: 1px solid #FECACA; border-radius: var(--radius-sm); color: #991B1B; font-size: 0.85rem; }
.error-card strong { font-weight: 600; }
.error-retry { display: inline-block; margin-top: 8px; padding: 8px 14px; background: var(--danger); color: white; font-family: var(--font); font-size: 0.78rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; }

/* ── Loading Skeleton ──────────────────────────────────────── */
.loading-skeleton { margin-top: 20px; }
.skeleton-line { height: 14px; background: var(--border); border-radius: 6px; margin-bottom: 10px; animation: shimmer 1.5s ease-in-out infinite; }
.w80 { width: 80%; } .w60 { width: 60%; } .w90 { width: 90%; } .w70 { width: 70%; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.skeleton-card { height: 60px; background: var(--border); border-radius: var(--radius-sm); animation: shimmer 1.5s ease-in-out infinite; }
@keyframes shimmer { 0%,100%{opacity:0.4} 50%{opacity:0.7} }

/* ── Prose (chat markdown) ─────────────────────────────────── */
.prose h2 { font-size: 0.95rem; font-weight: 700; margin: 16px 0 6px; }
.prose h3 { font-size: 0.88rem; font-weight: 600; margin: 12px 0 4px; }
.prose p { margin: 4px 0; line-height: 1.6; font-size: 0.85rem; }
.prose ul { list-style: none; padding: 0; }
.prose li { padding: 2px 0; font-size: 0.85rem; }
.prose strong { font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── Streaming cursor ──────────────────────────────────────── */
.typing-cursor::after { content: '|'; animation: blink 0.7s step-end infinite; color: var(--accent); font-weight: 300; }
@keyframes blink { 50%{opacity:0} }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.loading { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 0.85rem; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeIn 0.25s ease; }

/* ── Chip (gemeente/article links) ─────────────────────────── */
.chip {
    background: var(--muted); border: none; border-radius: var(--radius-pill);
    padding: 7px 14px; font-family: var(--font); font-size: 0.78rem;
    font-weight: 500; color: var(--text); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.chip:hover { background: var(--accent); color: white; }

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 640px) {
    .hero-content { margin-top: -80px; }
    .logo-hero { font-size: 3rem; }
    .hero-tagline { font-size: 1.15rem; }
    .search-input { padding: 16px 14px; font-size: 1.05rem; }
    .result-main { padding: 28px 20px; }
    .address-title { font-size: 1.35rem; }
    .regels-grid { grid-template-columns: repeat(2, 1fr); }
    .chat-prominent { padding: 24px; }
    .ai-card { padding: 24px; }
}

@media (max-width: 639px) {
    .trust-signals { flex-wrap: wrap; gap: 10px; justify-content: center; }
    .facts-grid { grid-template-columns: repeat(2, 1fr); }
    .faq-buttons { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .faq-btn { white-space: nowrap; flex-shrink: 0; }
    .header-inner { gap: 8px; }
}
