:root {
    --bg: #f8f9fc;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #eef2ff;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.1);
    --radius: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
[data-theme="dark"] {
    --bg: #0f1117;
    --bg-card: #1a1d2e;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #2d3148;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: #1e1b4b;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.4);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.2rem; }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { color: var(--text-muted); text-decoration: none; font-size: .9rem; font-weight: 500; transition: color .2s; }
nav a:hover { color: var(--accent); }
#theme-toggle { background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; }
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Hero */
.hero { padding: 4rem 0 2rem; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: 1rem; line-height: 1.2; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto; }

/* Form */
#legal-form { margin-top: 2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-section { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.form-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
.form-section label { display: block; margin-bottom: 1rem; }
.form-section label span { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .3rem; }
.form-section input[type="text"],
.form-section input[type="url"],
.form-section input[type="email"],
.form-section select {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-family: var(--font); font-size: .9rem; transition: border-color .2s;
}
.form-section input:focus, .form-section select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
abbr { text-decoration: none; color: var(--accent); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { display: flex; align-items: center; gap: .4rem; font-size: .88rem; cursor: pointer; padding: .3rem .6rem; border-radius: var(--radius); transition: background .15s; }
.check:hover { background: var(--accent-light); }
.check input { accent-color: var(--accent); }
.form-actions { text-align: center; margin: 2rem 0; }
.btn-primary {
    background: var(--accent); color: #fff; border: none; padding: .75rem 2.5rem; border-radius: var(--radius);
    font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); padding: .5rem 1.2rem;
    border-radius: var(--radius); font-family: var(--font); font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Output */
.output { margin-top: 2rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.output.hidden { display: none; }
.output-tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab { padding: .75rem 1.5rem; background: none; border: none; font-family: var(--font); font-size: .9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.output-actions { display: flex; gap: .5rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--border); }
.tab-content { display: none; padding: 1.5rem; }
.tab-content.active { display: block; }
.tab-content pre { background: var(--bg); padding: 1rem; border-radius: var(--radius); overflow-x: auto; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.tab-content code { font-family: 'SF Mono', 'Fira Code', monospace; }
.preview-content { font-size: .92rem; }
.preview-content h1 { font-size: 1.5rem; margin: 2rem 0 .75rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.preview-content h1:first-child { margin-top: 0; }
.preview-content h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.preview-content h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.preview-content p { margin: .5rem 0; }
.preview-content ul { margin: .5rem 0 .5rem 1.5rem; }
.preview-content li { margin: .25rem 0; }

/* FAQ */
.faq-section { padding: 3rem 0; }
.faq-section h2 { text-align: center; margin-bottom: 2rem; }
details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
summary { padding: 1rem 1.25rem; font-weight: 500; cursor: pointer; transition: color .2s; }
summary:hover { color: var(--accent); }
details[open] summary { border-bottom: 1px solid var(--border); color: var(--accent); }
details p { padding: 1rem 1.25rem; color: var(--text-muted); font-size: .92rem; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 3rem; text-align: center; }
.footer-inner p { font-size: .85rem; color: var(--text-muted); margin: .25rem 0; }
.footer-promo a { color: var(--accent); text-decoration: none; font-weight: 500; }
.footer-promo a:hover { text-decoration: underline; }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--accent); color: #fff; padding: .75rem 1.5rem; border-radius: var(--radius); font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); transform: translateY(100px); opacity: 0; transition: all .3s; z-index: 200; }
.toast.show { transform: translateY(0); opacity: 1; }
