/* ==========================================================================
   ConvoLead — main.css
   Design system translated from the Claude Design prototype.
   Bootstrap 5 provides layout/grid/utilities; this file owns the brand look.
   ========================================================================== */

:root {
    --cl-font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cl-font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cl-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --cl-bg: #f6f5fa;
    --cl-surface: #ffffff;
    --cl-surface-2: #fbfaff;
    --cl-ink: #12101a;
    --cl-ink-2: #3b3850;
    --cl-muted: #57536b;
    --cl-muted-2: #8b879f;
    --cl-faint: #a8a4bd;

    --cl-border: #ebe9f2;
    --cl-border-strong: #ddd9e8;
    --cl-border-line: #f4f2fa;

    --cl-primary: #7c3aed;
    --cl-primary-strong: #6d28d9;
    --cl-primary-soft: #f4ecff;
    --cl-primary-soft-2: #f0e7ff;

    --cl-grad: linear-gradient(135deg, #5B4BE8 0%, #9333EA 55%, #E425C7 100%);
    --cl-grad-90: linear-gradient(90deg, #5B4BE8, #E425C7);

    --cl-success: #15803d;
    --cl-success-bg: #e7f9ee;
    --cl-danger: #dc2626;
    --cl-danger-bg: #fff1f1;
    --cl-warning-bg: #fff7ed;

    --cl-dark: #12101c;
    --cl-dark-muted: #a09bba;
    --cl-dark-label: #6f6a8c;

    --cl-radius-sm: 10px;
    --cl-radius: 16px;
    --cl-radius-lg: 22px;

    --cl-shadow-sm: 0 1px 2px rgba(18, 16, 26, .04);
    --cl-shadow-md: 0 1px 2px rgba(18, 16, 26, .04), 0 20px 40px -30px rgba(18, 16, 26, .2);
    --cl-shadow-lg: 0 24px 60px -34px rgba(147, 51, 234, .6);

    --cl-sidebar-w: 236px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--cl-font-body);
    color: var(--cl-ink);
    background: var(--cl-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.cl-head { font-family: var(--cl-font-head); letter-spacing: -.02em; }

a { color: var(--cl-primary); text-decoration: none; }
a:hover { color: #5b4be8; text-decoration: underline; }
::selection { background: #e9d5ff; }
code, .cl-mono { font-family: var(--cl-font-mono); }

.cl-muted { color: var(--cl-muted); }
.cl-muted-2 { color: var(--cl-muted-2); }
.cl-faint { color: var(--cl-faint); }
.cl-ink-2 { color: var(--cl-ink-2); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn { font-family: var(--cl-font-head); font-weight: 600; border-radius: var(--cl-radius-sm); }

.btn-cl-gradient {
    border: none;
    color: #fff;
    background: var(--cl-grad);
    box-shadow: 0 10px 24px -10px rgba(147, 51, 234, .7);
}
.btn-cl-gradient:hover,
.btn-cl-gradient:focus { color: #fff; filter: brightness(1.03); }

.btn-cl-dark {
    border: none;
    color: #fff;
    background: var(--cl-ink);
}
.btn-cl-dark:hover { color: #fff; background: var(--cl-primary); }

.btn-cl-outline {
    border: 1px solid var(--cl-border-strong);
    background: #fff;
    color: var(--cl-ink-2);
}
.btn-cl-outline:hover { border-color: #9333ea; color: var(--cl-primary); }

.btn-cl-danger-outline {
    border: 1px solid #fbdada;
    background: #fff;
    color: var(--cl-danger);
}
.btn-cl-danger-outline:hover { background: #fff5f5; color: var(--cl-danger); }

.btn-pill { border-radius: 999px; }

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */

.cl-card {
    background: var(--cl-surface);
    border: 1px solid var(--cl-border);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
}
.cl-card-lg { border-radius: var(--cl-radius-lg); box-shadow: var(--cl-shadow-md); }
.cl-card-pad { padding: 24px; }
.cl-card-pad-lg { padding: 40px; }

.cl-eyebrow {
    font: 600 11.5px var(--cl-font-head);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cl-muted-2);
}

.cl-stat-value { font: 700 26px var(--cl-font-head); letter-spacing: -.02em; }
.cl-stat-value-lg { font-size: 34px; }

/* --------------------------------------------------------------------------
   Badges / pills
   -------------------------------------------------------------------------- */

.cl-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font: 600 11px var(--cl-font-head);
    white-space: nowrap;
}
.cl-badge-active   { background: var(--cl-success-bg); color: var(--cl-success); }
.cl-badge-trialing { background: var(--cl-primary-soft); color: var(--cl-primary); }
.cl-badge-pastdue  { background: var(--cl-danger-bg); color: var(--cl-danger); }
.cl-badge-cancelled,
.cl-badge-draft,
.cl-badge-expired  { background: #f2f0f8; color: var(--cl-muted-2); }
.cl-badge-paid     { background: var(--cl-success-bg); color: var(--cl-success); }
.cl-badge-failed   { background: var(--cl-danger-bg); color: var(--cl-danger); }

.cl-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1.5px solid #c4b5fd;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--cl-primary-strong);
    background: #fff;
}

/* Selectable chip (contact fields, positions, etc.) */
.cl-chip {
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 999px;
    font: 500 13px var(--cl-font-head);
    border: 1.5px solid #e6e3f0;
    background: #fff;
    color: var(--cl-muted-2);
    user-select: none;
}
.cl-chip.is-active { border-color: #9333ea; background: #f7f0ff; color: var(--cl-primary-strong); }

/* --------------------------------------------------------------------------
   Segmented control
   -------------------------------------------------------------------------- */

.cl-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: #eeecf6;
}
.cl-seg--sq { border-radius: var(--cl-radius-sm); padding: 3px; }
.cl-seg button,
.cl-seg .cl-seg-item {
    border: none;
    cursor: pointer;
    padding: 7px 14px;
    border-radius: 999px;
    font: 500 12.5px var(--cl-font-head);
    white-space: nowrap;
    background: transparent;
    color: var(--cl-muted-2);
}
.cl-seg--sq button,
.cl-seg--sq .cl-seg-item { border-radius: 8px; }
.cl-seg button.is-active,
.cl-seg .cl-seg-item.is-active {
    background: #fff;
    color: var(--cl-ink);
    box-shadow: 0 1px 3px rgba(18, 16, 26, .12);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.cl-label {
    display: block;
    font: 500 12.5px var(--cl-font-head);
    color: var(--cl-ink-2);
    margin-bottom: 7px;
}

.cl-input,
.cl-select,
.cl-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--cl-border-strong);
    border-radius: 11px;
    font-size: 14.5px;
    font-family: var(--cl-font-body);
    color: var(--cl-ink);
    background: var(--cl-surface-2);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.cl-textarea { line-height: 1.5; resize: vertical; }
.cl-input:focus,
.cl-select:focus,
.cl-textarea:focus {
    border-color: #9333ea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, .12);
}
.cl-input-sm { padding: 10px 14px; font-size: 13.5px; }

/* --------------------------------------------------------------------------
   Gradient / brand helpers
   -------------------------------------------------------------------------- */

.cl-gradient-bg { background: var(--cl-grad); }
.cl-gradient-text {
    background: var(--cl-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.cl-gradient-hr { height: 4px; border: 0; background: var(--cl-grad-90); opacity: 1; margin: 0; }

.cl-avatar-bot {
    border-radius: 50%;
    background: var(--cl-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.cl-avatar-bot .cl-avatar-face {
    background: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cl-avatar-bot .cl-avatar-face span {
    width: 5px; height: 5px; border-radius: 50%; background: var(--cl-ink);
}

.cl-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 9px;
    color: #fff;
    font: 600 12.5px var(--cl-font-head);
    background: var(--cl-grad);
}

/* Progress bar */
.cl-progress { height: 8px; border-radius: 99px; background: #f0eef7; overflow: hidden; }
.cl-progress > span { display: block; height: 100%; border-radius: 99px; background: var(--cl-grad-90); }
.cl-progress > span.is-cap { background: linear-gradient(90deg, #f0708f, #dc2626); }

/* --------------------------------------------------------------------------
   App shell (sidebar layouts)
   -------------------------------------------------------------------------- */

.cl-shell { display: flex; min-height: 100vh; }
.cl-main { flex: 1; min-width: 0; padding: 32px 36px 60px; }

.cl-sidebar {
    width: var(--cl-sidebar-w);
    flex: none;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
}
.cl-sidebar--light { background: #fff; border-right: 1px solid var(--cl-border); }
.cl-sidebar--dark { background: var(--cl-dark); }

.cl-sidebar__logo {
    height: 19px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    align-self: flex-start;
    flex: none;
    margin: 0 8px 26px;
}
.cl-sidebar--dark .cl-sidebar__logo { filter: brightness(0) invert(1); opacity: .95; height: 18px; margin-bottom: 6px; }

.cl-sidebar__label {
    margin: 0 8px 24px;
    font: 600 9.5px var(--cl-font-head);
    letter-spacing: .14em;
    color: var(--cl-dark-label);
}

.cl-nav { display: flex; flex-direction: column; gap: 3px; }
.cl-nav a {
    padding: 9px 12px;
    border-radius: 9px;
    font: 500 13.5px var(--cl-font-head);
    color: var(--cl-muted);
    text-decoration: none;
}
.cl-nav a:hover { text-decoration: none; }
.cl-nav a.is-active { color: var(--cl-primary-strong); background: var(--cl-primary-soft); }

.cl-sidebar--dark .cl-nav a { color: var(--cl-dark-muted); }
.cl-sidebar--dark .cl-nav a:hover { color: #fff; }
.cl-sidebar--dark .cl-nav a.is-active { color: #fff; background: rgba(255, 255, 255, .1); }

.cl-sidebar__bottom { margin-top: auto; padding-top: 14px; }
.cl-sidebar__foot {
    padding: 15px;
    border-radius: 14px;
    background: #f8f5ff;
    border: 1px solid #eee7fb;
}
.cl-sidebar--dark .cl-sidebar__foot { background: rgba(255, 255, 255, .06); border: none; }
.cl-sidebar--dark .cl-sidebar__foot .cl-sidebar__foot-name { color: #fff; }
.cl-sidebar--dark .cl-sidebar__foot .cl-sidebar__foot-sub { color: #8d88a8; }

.cl-sidebar__logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    font: 500 13.5px var(--cl-font-head);
    color: var(--cl-muted);
    text-align: left;
}
.cl-sidebar__logout:hover { background: var(--cl-primary-soft); color: var(--cl-primary-strong); }
.cl-sidebar--dark .cl-sidebar__logout { color: var(--cl-dark-muted); }
.cl-sidebar--dark .cl-sidebar__logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.cl-page-title { font: 700 27px var(--cl-font-head); letter-spacing: -.02em; margin: 0 0 5px; }
.cl-page-sub { font-size: 13.5px; color: var(--cl-muted-2); margin: 0; }

/* --------------------------------------------------------------------------
   Data tables (grid based, matches prototype)
   -------------------------------------------------------------------------- */

.cl-table { background: #fff; border: 1px solid var(--cl-border); border-radius: var(--cl-radius); overflow: hidden; }
.cl-table__head,
.cl-table__row { display: grid; gap: 16px; align-items: center; padding: 14px 20px; }
.cl-table__head {
    background: var(--cl-surface-2);
    border-bottom: 1px solid var(--cl-border);
    padding: 13px 20px;
    font: 600 11px var(--cl-font-head);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--cl-muted-2);
}
.cl-table__row { border-bottom: 1px solid var(--cl-border-line); }
.cl-table__row:last-child { border-bottom: 0; }
a.cl-table__row, .cl-table__row--link { cursor: pointer; color: inherit; text-decoration: none; }
a.cl-table__row:hover, .cl-table__row--link:hover { background: var(--cl-surface-2); text-decoration: none; color: inherit; }

/* --------------------------------------------------------------------------
   Marketing header / footer
   -------------------------------------------------------------------------- */

/* Keep every logo image at its natural aspect ratio */
.cl-marketing-header img,
.cl-marketing-footer img,
.cl-split img,
.cl-chat img { width: auto; height: auto; object-fit: contain; }

.cl-marketing-header {
    background: #fff;
    border-bottom: 1px solid #ebe9f2;
}
.cl-marketing-header .cl-nav-link { font-size: 14px; color: var(--cl-muted); }
.cl-marketing-header .cl-nav-link:hover { color: var(--cl-ink); text-decoration: none; }

.cl-marketing-footer {
    background: #fff;
    border-top: 1px solid var(--cl-border);
    color: var(--cl-muted-2);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Split-screen auth
   -------------------------------------------------------------------------- */

.cl-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.cl-split__form {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 40px;
}
.cl-split__aside {
    background: linear-gradient(155deg, #3d2f8f 0%, #6d28d9 45%, #c026a8 100%);
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Chat widget preview / booking flow
   -------------------------------------------------------------------------- */

.cl-chat {
    width: 340px;
    max-width: 100%;
    border-radius: var(--cl-radius-lg);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .5);
}
.cl-chat__header {
    background: var(--cl-grad);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
}
.cl-chat__body {
    background: #f7f6fb;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 360px;
}
.cl-chat__bubble {
    background: #fff;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #2b2840;
    box-shadow: 0 1px 2px rgba(18, 16, 26, .06);
    align-self: flex-start;
    max-width: 92%;
}
.cl-chat__bubble--user {
    align-self: flex-end;
    background: var(--cl-grad);
    color: #fff;
}
.cl-chat__service {
    background: #fff;
    border: 1px solid #eceaf4;
    border-radius: 13px;
    padding: 12px 14px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    cursor: pointer;
}
.cl-chat__service:hover { border-color: #d8d0f5; }
.cl-chat__quick {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #9333ea;
    color: var(--cl-primary);
    background: #fff;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}
.cl-chat__quick:hover { background: #f7f0ff; }
.cl-chat__footer {
    background: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #f0eef7;
}
.cl-chat__send {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    background: var(--cl-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer;
}

/* Builder live-preview rail */
.cl-preview-rail {
    border-left: 1px solid var(--cl-border);
    background: linear-gradient(170deg, #1e1b3a, #3f2a6e 55%, #5c2168);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Numbered step marker used in the builder & install pages */
.cl-step-num {
    width: 22px; height: 22px; border-radius: 7px; flex: none;
    background: var(--cl-primary-soft-2); color: var(--cl-primary);
    font: 600 11px var(--cl-font-head);
    display: flex; align-items: center; justify-content: center;
}
.cl-step-num--lg { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }

/* Code block */
.cl-code {
    background: #141122;
    border-radius: 13px;
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.cl-code code {
    font-family: var(--cl-font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: #e6e2f5;
    word-break: break-all;
}
.cl-code button {
    flex: none;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 9px;
    font: 500 12.5px var(--cl-font-head);
}
.cl-code button:hover { background: rgba(255, 255, 255, .2); }

/* Toggle switch */
.cl-switch {
    width: 42px; height: 24px; border-radius: 99px; flex: none;
    cursor: pointer; padding: 3px; border: none;
    background: #e2dfec;
    display: flex; justify-content: flex-start;
    transition: background .15s;
}
.cl-switch > span { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.cl-switch.is-on { background: var(--cl-grad); justify-content: flex-end; }

/* Onboarding step tab */
.cl-wizard-step {
    flex: 1;
    cursor: pointer;
    padding: 13px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--cl-border);
    color: var(--cl-faint);
}
.cl-wizard-step.is-active { background: var(--cl-grad); border: none; color: #fff; }
.cl-wizard-step.is-done { color: var(--cl-primary); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

/* Toast (flash messages) */
.cl-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    max-width: 90vw;
    padding: 12px 18px;
    border-radius: 12px;
    font: 500 13.5px var(--cl-font-head);
    box-shadow: 0 16px 40px -12px rgba(18, 16, 26, .3);
    animation: cl-toast-in .2s ease-out;
}
.cl-toast--ok { background: #ecfdf3; color: var(--cl-success); border: 1px solid #c8f0d6; }
.cl-toast--err { background: var(--cl-danger-bg); color: var(--cl-danger); border: 1px solid #fbdada; }
@keyframes cl-toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }

.cl-divider { border-top: 1px solid #f0eef7; }
.cl-hover-row:hover { background: var(--cl-surface-2); }
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .cl-split { grid-template-columns: 1fr; }
    .cl-split__aside { display: none; }
    .cl-main { padding: 24px 18px 48px; }
}

@media (max-width: 767.98px) {
    .cl-shell { flex-direction: column; }
    .cl-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
        padding: 12px 14px;
    }
    .cl-sidebar__logo,
    .cl-sidebar__label { margin: 0; }
    .cl-sidebar .cl-nav { flex-direction: row; }
    .cl-sidebar__foot { display: none; }
    .cl-table__head { display: none; }
    .cl-table__row { grid-template-columns: 1fr !important; gap: 4px; }
    .cl-preview-rail { display: none; }
}
