/* RintisAI — CSS Vanilla, mobile-first (Plan.md §9) */
:root {
    --c-bg: #f7f8fb;
    --c-surface: #ffffff;
    --c-text: #1a1d29;
    --c-muted: #6b7280;
    --c-border: #e6e8ef;
    --c-primary: #4f46e5;
    --c-primary-dark: #4338ca;
    --c-accent: #06b6d4;
    --c-success: #16a34a;
    --c-danger: #dc2626;
    --grad: linear-gradient(120deg, #4f46e5, #06b6d4);
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.05);
    --max: 1120px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--c-muted); }
.small { font-size: .85rem; }
.mt { margin-top: 2rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font-family: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: .7rem 1.2rem; transition: .18s ease; line-height: 1; text-align: center;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: #eef0f6; }
.btn-light { background: #fff; color: var(--c-primary); }
.btn-light:hover { background: #f0f1f8; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Navbar */
.navbar { background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--c-text); letter-spacing: -.02em; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--c-muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--c-text); }
.nav-user { color: var(--c-text); font-weight: 600; font-size: .9rem; }

/* Flash */
.flash { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; }
.flash-success { background: #ecfdf3; color: #027a48; border: 1px solid #a6f4c5; }
.flash-error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.flash-info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.hero-inner { display: grid; gap: 2.5rem; }
.badge { display: inline-block; background: #eef2ff; color: var(--c-primary); font-weight: 600; font-size: .8rem; padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
.hero h1 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 1rem; font-size: 1.08rem; color: var(--c-muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-flow .flow { list-style: none; display: grid; gap: .6rem; }
.flow li { display: flex; align-items: center; gap: .8rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: .9rem 1.1rem; font-weight: 600; box-shadow: var(--shadow); }
.flow li span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .9rem; }

/* Sections */
.section { padding: 3rem 0; }
.section-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.section-sub { color: var(--c-muted); margin: .4rem 0 1.8rem; }
.narrow { max-width: 760px; }

/* Grid & cards */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.card p { color: var(--c-muted); font-size: .95rem; }
.card-link { transition: .18s ease; display: block; }
.card-link:hover { transform: translateY(-3px); border-color: var(--c-primary); }
.card-num { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: .8rem; }
.tag { display: inline-block; background: #eef2ff; color: var(--c-primary); font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; margin-bottom: .6rem; }
.tag-done { background: #ecfdf3; color: var(--c-success); }

/* CTA band */
.cta-band { background: var(--grad); color: #fff; text-align: center; padding: 3.5rem 0; margin-top: 2rem; }
.cta-band h2 { font-size: 1.6rem; font-weight: 800; }
.cta-band p { margin: .6rem 0 1.4rem; opacity: .92; }

/* Footer */
.footer { background: #0f1222; color: #c7cbe0; padding: 2.4rem 0; margin-top: 2rem; }
.footer-inner { display: grid; gap: 1.2rem; }
.footer strong { color: #fff; font-size: 1.15rem; }
.footer .accent { color: var(--c-accent); }
.footer p { color: #9aa0c0; font-size: .9rem; margin-top: .3rem; }
.footer-meta { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: #8186a8; }

/* Auth */
.auth-wrap { display: grid; place-items: center; padding: 3rem 0; }
.auth-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; }
.form { display: grid; gap: 1rem; margin-top: 1.4rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
.form .opt { color: var(--c-muted); font-weight: 400; }
.form input, .form-inline input, textarea {
    font-family: inherit; font-size: 1rem; padding: .7rem .9rem; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); background: #fff; width: 100%; color: var(--c-text);
}
.form input:focus, textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.auth-alt { margin-top: 1.2rem; text-align: center; color: var(--c-muted); font-size: .9rem; }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.6rem; }
.dash-head h1 { font-size: 1.7rem; }
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.1rem; margin-bottom: .9rem; }
.form-inline { display: flex; gap: .7rem; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 200px; }
.empty { background: var(--c-surface); border: 1px dashed var(--c-border); border-radius: var(--radius); padding: 2.5rem; text-align: center; color: var(--c-muted); }
.sesi-card .sesi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.progress-bar { height: 7px; background: #eef0f6; border-radius: 99px; overflow: hidden; margin: .8rem 0; }
.progress-bar span { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.sesi-actions { display: flex; gap: .5rem; align-items: center; }
.sesi-actions form { display: inline; }

/* Chat */
.chat-layout { display: grid; gap: 1.4rem; padding: 1.6rem 20px 2.4rem; align-items: start; }
.chat-side { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.chat-side h2 { font-size: 1.1rem; margin: .6rem 0 1rem; }
.back { font-size: .85rem; color: var(--c-muted); }
.stepper { list-style: none; display: grid; gap: .2rem; }
.stepper li { display: flex; gap: .7rem; padding: .6rem; border-radius: var(--radius-sm); }
.stepper li small { display: block; color: var(--c-muted); font-size: .78rem; }
.stepper .step-no { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: #eef0f6; color: var(--c-muted); font-size: .8rem; font-weight: 700; }
.stepper li.current { background: #eef2ff; }
.stepper li.current .step-no { background: var(--c-primary); color: #fff; }
.stepper li.done .step-no { background: var(--c-success); color: #fff; }
.side-proposal { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--c-border); }
.side-proposal h3 { font-size: .95rem; margin-bottom: .6rem; }

.chat-main { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 70vh; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 1.4rem; display: flex; flex-direction: column; gap: .9rem; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.bubble { max-width: 78%; padding: .8rem 1rem; border-radius: 14px; font-size: .96rem; line-height: 1.55; white-space: pre-wrap; }
.msg-assistant .bubble { background: #f1f3f9; color: var(--c-text); border-bottom-left-radius: 4px; }
.msg-user .bubble { background: var(--c-primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.typing { color: var(--c-muted); font-style: italic; }

.proposal-box { border-top: 1px solid var(--c-border); padding: 1.2rem 1.4rem; background: #fbfbfe; }
.proposal-box h3 { margin-bottom: .6rem; }
.proposal-pre { white-space: pre-wrap; font-family: inherit; font-size: .92rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 1rem; max-height: 360px; overflow-y: auto; margin-bottom: .9rem; }

.chat-input-bar { border-top: 1px solid var(--c-border); padding: .9rem 1.4rem 1.1rem; background: #fff; }
.chat-tools { margin-bottom: .6rem; }
.chat-form { display: flex; gap: .6rem; align-items: flex-end; }
.chat-form textarea { resize: none; max-height: 140px; }

/* Modul */
.modul-group { margin-bottom: 2.4rem; }
.modul-group h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; margin-bottom: 1rem; }
.modul-group .step-no { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .85rem; }
.prose { margin-top: 1.4rem; font-size: 1.02rem; color: #2a2e3d; }
.cta-inline { margin-top: 2rem; }

/* Responsive */
@media (min-width: 760px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .hero h1 { font-size: 2.8rem; }
    .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 960px) {
    .hero-inner { grid-template-columns: 1.2fr .8fr; align-items: center; }
    .chat-layout { grid-template-columns: 300px 1fr; }
}
