/* ==========================================================================
   CloudWave Support Portal - design system
   Tokens taken from the CloudWave brand stylesheet:
   brand #4E4FEB · navy #0E2954 · tint #ECECFF · page #F5F5F5
   Fonts: Plus Jakarta Sans (headings) + Inter (body)
   All classes are prefixed cw- and scoped so the stylesheet can never leak
   into an embedding host page.
   ========================================================================== */

:root {
    --brand: #4E4FEB;
    --brand-dark: #3b3cd8;
    --brand-soft: #6a6bf5;
    --navy: #0E2954;
    --tint: #ECECFF;
    --bg: #F5F5F5;
    --white: #ffffff;
    --text: #1a1a2e;
    --muted: #5a6478;
    --line: rgba(14, 41, 84, .08);
    --line-strong: rgba(14, 41, 84, .14);
    --shadow: 0 10px 34px rgba(14, 41, 84, .08);
    --shadow-sm: 0 4px 16px rgba(14, 41, 84, .06);
    --radius: 14px;
    --radius-sm: 10px;
    --ok: #1f9d63;
    --warn: #d98324;
    --danger: #d64545;
}

*, *::before, *::after { box-sizing: border-box; }

body.cw-body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.cw-body img { max-width: 100%; height: auto; }
.cw-body a { color: var(--brand); text-decoration: none; }
.cw-body a:hover { text-decoration: underline; }

.cw-body h1, .cw-body h2, .cw-body h3, .cw-body h4, .cw-body h5, .cw-body h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--navy);
    line-height: 1.25;
    margin: 0 0 12px;
}

/* ===== layout ============================================================ */
.cw-wrap { max-width: 1170px; margin: 0 auto; padding: 0 20px; }
.cw-sec { display: block; width: 100%; padding: 80px 0; background: var(--white); }
.cw-sec.tint { background: var(--tint); }
.cw-sec.gray { background: var(--bg); }
.cw-sec.navy { background: var(--navy); }
.cw-sec.tight { padding: 56px 0; }

.cw-eyebrow {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand); margin: 0 0 12px;
}
.cw-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 34px; line-height: 1.2;
    color: var(--navy); margin: 0 0 14px;
}
.cw-title.centered, .cw-sub.centered { text-align: center; }
.cw-sub {
    font-family: 'Inter', sans-serif;
    font-size: 16px; line-height: 1.7; color: var(--muted);
    margin: 0 auto 44px; max-width: 720px;
}
.cw-center { text-align: center; }

/* ===== header ============================================================ */
.cw-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.cw-header .cw-wrap {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; min-height: 68px;
}
.cw-logo { display: flex; align-items: center; gap: 10px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 18px; color: var(--navy); }
.cw-logo:hover { text-decoration: none; }
.cw-logo .cw-logo-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-soft) 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; flex-shrink: 0;
}
/* Brand logo image (assets/img). Height-locked so any logo file fits the bar. */
.cw-logo-img { display: block; height: 34px; width: auto; max-width: 190px; }
.cw-footer-brand img { height: 30px; width: auto; }
.cw-nav { display: flex; align-items: center; gap: 4px; }
.cw-nav a {
    font-size: 14.5px; font-weight: 600; color: var(--navy);
    padding: 9px 14px; border-radius: 8px;
}
.cw-nav a:hover { background: var(--tint); text-decoration: none; }
.cw-nav a.active { color: var(--brand); background: var(--tint); }
.cw-nav .cw-nav-cta { background: var(--brand); color: #fff; }
.cw-nav .cw-nav-cta:hover { background: var(--brand-dark); color: #fff; }

/* ===== hero ============================================================== */
.cw-hero {
    background: linear-gradient(160deg, var(--tint) 0%, #f7f8ff 55%, var(--white) 100%);
    padding: 76px 0 64px;
    border-bottom: 1px solid var(--line);
}
.cw-hero h1 {
    font-size: 44px; font-weight: 800; letter-spacing: -.02em;
    color: var(--navy); margin: 0 0 14px; max-width: 820px;
}
.cw-hero p.cw-hero-sub {
    font-size: 17.5px; color: var(--muted); max-width: 680px; margin: 0 0 28px;
}
.cw-hero-search { max-width: 640px; margin: 0 0 22px; }
.cw-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ===== search & forms ==================================================== */
.cw-search { position: relative; }
.cw-search input[type="search"],
.cw-search input[type="text"] {
    width: 100%; padding: 16px 18px 16px 48px;
    font-family: inherit; font-size: 15.5px; color: var(--text);
    background: var(--white); border: 1.5px solid var(--line-strong);
    border-radius: var(--radius); outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.cw-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(78, 79, 235, .12); }
.cw-search .cw-search-icon {
    position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 16px; pointer-events: none;
}

.cw-field { margin-bottom: 18px; }
.cw-field label {
    display: block; font-size: 13.5px; font-weight: 600;
    color: var(--navy); margin-bottom: 7px;
}
.cw-field input[type="text"], .cw-field input[type="email"], .cw-field input[type="password"],
.cw-field input[type="number"], .cw-field select, .cw-field textarea {
    width: 100%; padding: 12px 14px; font-family: inherit; font-size: 15px;
    color: var(--text); background: var(--white);
    border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
    outline: none; transition: border-color .2s ease;
}
.cw-field textarea { min-height: 320px; line-height: 1.6; resize: vertical; }
.cw-field input:focus, .cw-field select:focus, .cw-field textarea:focus {
    border-color: var(--brand); box-shadow: 0 0 0 4px rgba(78, 79, 235, .1);
}
.cw-field .cw-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ===== buttons =========================================================== */
.cw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 600; line-height: 1;
    padding: 14px 22px; border: 1.5px solid transparent; border-radius: 4px;
    cursor: pointer; text-align: center; white-space: nowrap;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.cw-btn:hover { text-decoration: none; }
.cw-btn.primary { background: var(--brand); color: #fff; }
.cw-btn.primary:hover { background: var(--brand-dark); transform: translateY(-2px); }
.cw-btn.navy { background: var(--navy); color: #fff; }
.cw-btn.navy:hover { background: #0a1e3d; transform: translateY(-2px); }
.cw-btn.white { background: #fff; color: var(--brand); }
.cw-btn.white:hover { background: var(--tint); transform: translateY(-2px); }
.cw-btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.cw-btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.cw-btn.ghost-white { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.cw-btn.ghost-white:hover { background: rgba(255, 255, 255, .12); }
.cw-btn.danger { background: transparent; color: var(--danger); border-color: rgba(214, 69, 69, .35); }
.cw-btn.danger:hover { background: rgba(214, 69, 69, .07); }
.cw-btn.sm { padding: 9px 14px; font-size: 13.5px; }
.cw-btn.block { width: 100%; }
.cw-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ===== cards & grids ===================================================== */
.cw-grid { display: grid; gap: 20px; }
.cw-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cw-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cw-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.cw-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cw-card.hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand); }
.cw-card h3 { font-size: 16.5px; font-weight: 700; margin: 0 0 8px; }
.cw-card p { font-size: 14.5px; line-height: 1.65; color: var(--muted); margin: 0; }
.cw-card .cw-icon {
    width: 52px; height: 52px; border-radius: 12px; background: var(--tint); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 16px;
}

/* channel tiles */
.cw-channel { display: flex; align-items: flex-start; gap: 14px; }
.cw-channel .cw-icon { width: 46px; height: 46px; margin: 0; border-radius: 11px; font-size: 19px; flex-shrink: 0; }
.cw-channel h3 { font-size: 15.5px; margin: 0 0 4px; }
.cw-channel p { font-size: 13.5px; }
.cw-channel .cw-channel-link { display: inline-block; margin-top: 8px; font-size: 13.5px; font-weight: 600; }

/* article cards */
.cw-article-card { display: flex; flex-direction: column; }
.cw-article-card .cw-badge { margin-bottom: 12px; }
.cw-article-card h3 { font-size: 16.5px; line-height: 1.4; margin: 0 0 8px; }
.cw-article-card h3 a { color: var(--navy); }
.cw-article-card h3 a:hover { color: var(--brand); text-decoration: none; }
.cw-article-card .cw-meta {
    margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--muted);
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}

.cw-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 20px;
    background: var(--tint); color: var(--brand);
}
.cw-badge.navy { background: rgba(14, 41, 84, .08); color: var(--navy); }
.cw-badge.ok { background: rgba(31, 157, 99, .12); color: var(--ok); }
.cw-badge.warn { background: rgba(217, 131, 36, .14); color: var(--warn); }
.cw-badge.danger { background: rgba(214, 69, 69, .12); color: var(--danger); }
.cw-badge.muted { background: rgba(90, 100, 120, .1); color: var(--muted); }

/* ===== lists ============================================================= */
.cw-list { list-style: none; margin: 0; padding: 0; }
.cw-list li { border-bottom: 1px dashed var(--line); }
.cw-list li:last-child { border-bottom: none; }
.cw-list a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 2px; font-size: 14.5px; font-weight: 500; color: var(--navy);
}
.cw-list a:hover { color: var(--brand); text-decoration: none; }
.cw-list a i { color: var(--brand); font-size: 13px; flex-shrink: 0; }
.cw-list .cw-list-count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ===== article body ====================================================== */
.cw-article { max-width: 780px; }
.cw-article-header { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 28px; }
.cw-article-header h1 { font-size: 34px; line-height: 1.25; margin: 12px 0 12px; }
.cw-article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); align-items: center; }
.cw-article-body { font-size: 16.5px; line-height: 1.78; color: var(--text); }
.cw-article-body h2 { font-size: 24px; margin: 38px 0 12px; }
.cw-article-body h3 { font-size: 19px; margin: 30px 0 10px; }
.cw-article-body h4, .cw-article-body h5, .cw-article-body h6 { font-size: 16.5px; margin: 24px 0 8px; }
.cw-article-body p { margin: 0 0 18px; }
.cw-article-body ul, .cw-article-body ol { margin: 0 0 20px; padding-left: 24px; }
.cw-article-body li { margin-bottom: 8px; }
.cw-article-body blockquote {
    margin: 22px 0; padding: 14px 20px;
    border-left: 3px solid var(--brand); background: var(--tint);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--navy);
}
.cw-article-body blockquote p:last-child { margin-bottom: 0; }
.cw-article-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13.5px; background: rgba(14, 41, 84, .06);
    padding: 2px 6px; border-radius: 4px; color: #b3306b;
}
.cw-code {
    background: #0E2954; color: #e8ecf7; border-radius: var(--radius-sm);
    padding: 18px 20px; overflow-x: auto; margin: 0 0 22px;
}
.cw-code code { background: none; color: inherit; padding: 0; font-size: 13.5px; line-height: 1.65; }

/* feedback */
.cw-feedback {
    margin-top: 40px; padding: 22px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--bg); text-align: center;
}
.cw-feedback p { margin: 0 0 14px; font-weight: 600; color: var(--navy); font-size: 15px; }
.cw-feedback .cw-feedback-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== FAQ =============================================================== */
.cw-faq { max-width: 820px; margin: 0 auto; }
.cw-faq details {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); margin-bottom: 12px;
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.cw-faq summary {
    list-style: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 20px 22px; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px; font-weight: 700; color: var(--navy);
}
.cw-faq summary::-webkit-details-marker { display: none; }
.cw-faq summary .fa { color: var(--brand); transition: transform .2s ease; flex-shrink: 0; }
.cw-faq details[open] summary .fa { transform: rotate(45deg); }
.cw-faq .ans { padding: 0 22px 20px; font-size: 14.5px; line-height: 1.7; color: var(--muted); }

/* ===== pills / filters =================================================== */
.cw-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.cw-pill {
    padding: 9px 18px; background: var(--white); border: 1.5px solid var(--line-strong);
    border-radius: 25px; font-size: 13.5px; font-weight: 600; color: var(--navy); cursor: pointer;
}
.cw-pill:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.cw-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ===== CTA =============================================================== */
.cw-cta {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-soft) 100%);
    border-radius: 18px; padding: 56px 40px; text-align: center; color: #fff;
}
.cw-cta h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 12px; }
.cw-cta p { font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, .92); margin: 0 auto 28px; max-width: 640px; }
.cw-cta .cw-btn.ghost { margin-left: 10px; }

/* ===== footer ============================================================ */
.cw-footer { background: var(--navy); color: rgba(255, 255, 255, .72); padding: 48px 0 32px; margin-top: 0; }
.cw-footer .cw-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.cw-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.cw-footer a { color: rgba(255, 255, 255, .8); font-size: 14px; display: block; padding: 4px 0; }
.cw-footer a:hover { color: #fff; text-decoration: none; }
.cw-footer .cw-footer-brand { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 19px; color: #fff; margin-bottom: 10px; }
.cw-footer .cw-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 22px;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px;
}

/* ===== empty / notice states ============================================= */
.cw-empty {
    text-align: center; padding: 64px 24px; border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius); background: var(--white);
}
.cw-empty i { font-size: 34px; color: var(--brand); margin-bottom: 16px; display: block; }
.cw-empty h3 { margin: 0 0 8px; }
.cw-empty p { color: var(--muted); margin: 0 auto 20px; max-width: 460px; }

.cw-alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 14.5px; margin-bottom: 20px; border: 1px solid; }
.cw-alert.error { background: rgba(214, 69, 69, .07); border-color: rgba(214, 69, 69, .25); color: #a53030; }
.cw-alert.ok { background: rgba(31, 157, 99, .07); border-color: rgba(31, 157, 99, .25); color: #16744a; }
.cw-alert.info { background: var(--tint); border-color: rgba(78, 79, 235, .2); color: var(--navy); }

/* ===== pagination ======================================================== */
.cw-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.cw-pagination a, .cw-pagination span {
    min-width: 40px; padding: 9px 13px; text-align: center;
    border: 1px solid var(--line-strong); border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--navy);
}
.cw-pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.cw-pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ===== status page ======================================================= */
.cw-status-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 22px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.cw-status-row strong { font-size: 15.5px; color: var(--navy); }
.cw-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cw-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(31, 157, 99, .15); }
.cw-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(214, 69, 69, .15); }

/* ===== responsive ======================================================== */
@media (max-width: 1024px) {
    .cw-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .cw-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .cw-footer .cw-footer-grid { grid-template-columns: 1fr 1fr; }
    .cw-hero h1 { font-size: 36px; }
}
@media (max-width: 768px) {
    .cw-nav { display: none; }
    .cw-header .cw-wrap { min-height: 60px; }
    .cw-title { font-size: 27px; }
    .cw-sec { padding: 56px 0; }
    .cw-article-header h1 { font-size: 27px; }
}
@media (max-width: 640px) {
    .cw-grid.cols-4, .cw-grid.cols-3, .cw-grid.cols-2 { grid-template-columns: 1fr; }
    .cw-footer .cw-footer-grid { grid-template-columns: 1fr; }
    .cw-hero { padding: 52px 0 44px; }
    .cw-hero h1 { font-size: 30px; }
    .cw-cta { padding: 40px 24px; }
    .cw-cta .cw-btn.ghost { margin-left: 0; margin-top: 10px; }
}
