/* ============================================================
   ClearPath AI Coach — premium chat UI
   ============================================================ */

:root {
    --bg:        #f6f8fb;
    --surface:   #ffffff;
    --ink:       #0f2233;
    --ink-soft:  #5b6b7b;
    --line:      #e6ecf2;
    --brand:     #12b3a6;   /* teal */
    --brand-2:   #0e8f9a;
    --accent:    #5b8def;   /* calm blue */
    --danger:    #e2564d;
    --warn-bg:   #fff6e6;
    --warn-line: #f2d492;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 10px 30px rgba(17, 40, 66, .08);
    --shadow-lg: 0 24px 60px rgba(17, 40, 66, .14);
    --maxw:      820px;
    --font:      'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(91,141,239,.10), transparent 60%),
        radial-gradient(1000px 500px at -10% 10%, rgba(18,179,166,.10), transparent 55%),
        var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; margin: 0 0 .3em; letter-spacing: -.02em; }
.muted { color: var(--ink-soft); }
.small { font-size: .86rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: var(--shadow);
}
.brand-name strong { color: var(--brand-2); }
.brand-sub { font-size: .8rem; font-weight: 500; color: var(--ink-soft); margin-left: 2px; }

/* ---------- Main ---------- */
.site-main { flex: 1 0 auto; padding: 30px 0 50px; }
.page-head { margin-bottom: 18px; }
.page-head .muted { max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-weight: 600; font-size: .95rem;
    padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; transition: transform .08s, box-shadow .15s, opacity .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }

/* ---------- Banner ---------- */
.banner { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 18px; font-size: .92rem; }
.banner code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.banner-demo { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #7a5b12; }

/* ---------- Chat ---------- */
.chat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column;
}
.chat-log { display: flex; flex-direction: column; gap: 12px; min-height: 340px; max-height: 60vh; overflow-y: auto; padding: 6px 4px; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg-bubble {
    max-width: 80%; padding: 11px 15px; border-radius: 16px; line-height: 1.5;
    white-space: pre-wrap; word-wrap: break-word;
}
.msg-bot .msg-bubble { background: #eef3f8; color: var(--ink); border-bottom-left-radius: 5px; }
.msg-user .msg-bubble { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-bottom-right-radius: 5px; }
.msg-error .msg-bubble { background: #fdecea; color: #a33228; border: 1px solid #f3c6c1; }

.chat-typing { display: flex; align-items: center; gap: 6px; padding: 8px 6px; color: var(--ink-soft); }
.chat-typing[hidden] { display: none !important; }
.chat-typing .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: bounce 1.2s infinite; }
.chat-typing .dot:nth-child(2) { animation-delay: .15s; }
.chat-typing .dot:nth-child(3) { animation-delay: .3s; }
.typing-label { font-size: .85rem; margin-left: 4px; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat-form { display: flex; gap: 10px; margin-top: 14px; }
.chat-input {
    flex: 1; font-family: inherit; font-size: 1rem; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.chat-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,179,166,.15); }
.chat-input:disabled { background: #f4f7fa; }
.chat-send { flex: 0 0 auto; }
.chat-hint { margin: 10px 4px 2px; }

/* ---------- Footer ---------- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; padding: 22px 0; }
.footer-inner { display: flex; flex-direction: column; gap: 8px; }
.disclaimer { font-size: .85rem; color: var(--ink-soft); margin: 0; max-width: 80ch; }
.disclaimer strong { color: var(--ink); }
.footer-meta { font-size: .8rem; color: var(--ink-soft); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .msg-bubble { max-width: 88%; }
    .chat { padding: 14px; }
    .chat-send { padding: 11px 16px; }
}
