/* ============================================================================
   Styles for the public AI content and news generation pages.

   Loaded only by those two pages, so nothing here can reach the rest of the
   site. Direction-specific rules are keyed off [dir], which the layout sets,
   rather than shipping a separate RTL and LTR build of this file.
   ========================================================================= */

:root {
    --cg-ink: #1d2430;
    --cg-muted: #6f7480;
    --cg-line: #e8eaee;
    --cg-surface: #ffffff;
    --cg-surface-soft: #f6f7f9;
    --cg-radius: 16px;
    --cg-shadow: 0 24px 60px -32px rgba(19, 26, 41, 0.35);
    --cg-measure: 1340px;
    --cg-green: #39b54a;
    --cg-green-dark: #2d9c3c;
}

/* The site's .container-fluid is only a 3% inset, so on a wide monitor every
   section stretches to the edges. These ones hold a readable measure instead. */
.cg-hero > .container-fluid,
.cg-feature > .container-fluid,
.cg-agents > .container-fluid,
.cg-pricing > .container-fluid {
    max-width: var(--cg-measure);
    margin-inline: auto;
}

/* ---------------------------------------------------------------- hero --- */

.cg-hero {
    padding: 50px 0 40px;
}

/* The hero carries two panels side by side, so it runs a little wider than the
   single-column sections below it. */
.cg-hero > .container-fluid {
    max-width: 1620px;
}

.cg-hero-heading {
    margin-bottom: 45px;
}

/* Explicit split rather than bootstrap twelfths: the form gets the extra room
   and the packs keep the width they have at the narrower measure. */
@media (min-width: 992px) {
    .cg-hero .row > .cg-hero-form {
        flex: 0 0 53%;
        max-width: 53%;
    }

    .cg-hero .row > .cg-hero-packs {
        flex: 0 0 47%;
        max-width: 47%;
    }
}

/* ------------------------------------------------------------- pack cards -- */

/* auto-fit means one, two or four packs all fill the row instead of leaving
   the empty third column that fixed grid columns produced. */
.cg-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.cg-pack {
    display: flex;
    flex-direction: column;
    padding: 26px 24px;
    border: 1px solid var(--cg-line);
    border-radius: 18px;
    background: var(--cg-surface);
    box-shadow: 0 18px 40px -34px rgba(19, 26, 41, 0.5);
}

.cg-pack:hover {
    border-color: rgba(57, 181, 74, 0.45);
    box-shadow: 0 22px 44px -30px rgba(19, 26, 41, 0.45);
}

.cg-pack-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--cg-ink);
    margin-bottom: 6px;
}

.cg-pack-caption {
    display: block;
    font-size: 13px;
    color: var(--cg-muted);
    margin-bottom: 18px;
}

.cg-pack-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--cg-line);
}

.cg-pack-amount {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: var(--cg-ink);
}

.cg-pack-currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--cg-muted);
}

.cg-pack-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1 1 auto;
}

.cg-pack-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14.5px;
    line-height: 26px;
    color: var(--cg-ink);
    margin-bottom: 12px;
}

.cg-pack-features li:last-child {
    margin-bottom: 0;
}

.cg-pack-features li:before {
    content: "";
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    border-radius: 50%;
    background: rgba(57, 181, 74, 0.14) url("../img/icons/check-icon.svg") no-repeat center;
    background-size: 11px;
}

.cg-pack-cta {
    display: block;
    padding: 13px 20px;
    border-radius: 11px;
    background: var(--cg-green);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.cg-pack-cta:hover {
    background: var(--cg-green-dark);
    color: #fff !important;
}

/* Beside the form the column is narrower, so the minimum track shrinks enough
   to keep three packs on one row while two still stretch to fill it. */
.cg-hero-packs .cg-packs {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.cg-hero-packs .cg-pack {
    padding: 22px 20px;
}

.cg-hero-packs .cg-pack-amount {
    font-size: 32px;
}

.cg-hero-packs .cg-pack-features li {
    font-size: 14px;
    margin-bottom: 10px;
}

/* --------------------------------------------------------- the form card -- */

.cg-form-card {
    background: var(--cg-surface);
    border: 1px solid var(--cg-line);
    border-radius: var(--cg-radius);
    box-shadow: var(--cg-shadow);
    padding: 26px;
}

.cg-form-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(201, 29, 19, 0.06);
    border: 1px solid rgba(201, 29, 19, 0.16);
    color: var(--cg-ink);
    font-size: 14px;
    line-height: 24px;
}

.cg-form-notice .btn-primary {
    flex: 0 0 auto;
    padding: 8px 22px;
    border-radius: 10px;
    font-size: 14px;
}

/* Content type picker: a segmented control rather than a bare select. */
.cg-type-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 22px;
    border-radius: 12px;
    background: var(--cg-surface-soft);
}

.cg-type-tab {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    border-radius: 9px;
    padding: 11px 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--cg-muted);
    cursor: pointer;
    white-space: nowrap;
}

.cg-type-tab:hover {
    color: var(--cg-ink);
}

.cg-type-tab.is-active {
    background: var(--cg-surface);
    color: var(--primary-color);
    box-shadow: 0 6px 16px -10px rgba(19, 26, 41, 0.5);
}

.cg-field {
    margin-bottom: 18px;
}

.cg-field > label,
.cg-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cg-ink);
    margin-bottom: 8px;
}

.cg-field-label .cg-optional {
    font-weight: 400;
    font-size: 12px;
    color: var(--cg-muted);
    margin-inline-start: 6px;
}

/* The shared form partials reach these through their own class names, so the
   selectors below cover both the panel widget markup and the page markup. */
.cg-form-card .ai-content-title,
.cg-form-card .ai-content-brand,
.cg-form-card .ai-content-description,
.cg-form-card .ai-content-words-input {
    width: 100%;
    margin: 0;
    padding: 13px 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--cg-ink);
    background: var(--cg-surface);
    border: 1px solid var(--cg-line);
    border-radius: 11px;
    box-shadow: none;
}

.cg-form-card .ai-content-description {
    min-height: 104px;
    line-height: 28px;
    resize: vertical;
}

.cg-form-card .ai-content-title:focus,
.cg-form-card .ai-content-brand:focus,
.cg-form-card .ai-content-description:focus,
.cg-form-card .ai-content-words-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(201, 29, 19, 0.10);
    color: var(--cg-ink);
}

.cg-form-card ::placeholder {
    color: #a6abb5;
}

/* --- keywords ------------------------------------------------------------ */

.cg-keywords {
    position: relative;
}

/* The widget positions this button with a fixed 385px offset tuned to the
   floating panel; inside a fluid card it is pinned to the field instead. */
.cg-form-card .ai-generator-add-word {
    position: absolute;
    top: 50%;
    /* The physical resets come first: a later `right`/`left` would otherwise
       cancel the logical offset below in whichever direction is active. */
    right: auto;
    left: auto;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    margin: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cg-form-card .ai-generator-add-word i {
    background: transparent;
    color: #fff;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    font-size: 12px;
}

.cg-form-card .ai-generator-add-word.disable {
    background: #d7dae0;
}

.cg-form-card .ai-generator-add-word.disable i {
    background: transparent;
    color: #fff;
}

.cg-form-card .ai-content-words-input {
    padding-inline-end: 52px;
}

.cg-form-card .ai-content-words-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 12px 0 0;
}

.cg-form-card .ai-content-words-tags:empty {
    margin: 0;
}

.cg-form-card .ai-content-words-tags li {
    position: static;
    top: auto;
    float: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 14px;
    background: rgba(201, 29, 19, 0.07);
    color: var(--primary-color);
    border-radius: 999px;
    font-size: 13px;
    cursor: default;
}

.cg-form-card .ai-content-words-tags li:hover {
    background: rgba(201, 29, 19, 0.12);
    color: var(--primary-color);
}

.cg-form-card .ai-content-words-tags li i {
    background: transparent;
    color: var(--primary-color);
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    font-size: 11px;
    opacity: 0.7;
    cursor: pointer;
}

.cg-form-card .ai-content-words-tags li i:hover {
    opacity: 1;
}

/* --- language and image toggles ------------------------------------------ */

.cg-choice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.cg-segment {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: var(--cg-surface-soft);
}

.cg-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cg-segment label {
    margin: 0;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cg-muted);
    cursor: pointer;
}

.cg-segment input:checked + label {
    background: var(--cg-surface);
    color: var(--primary-color);
    box-shadow: 0 6px 16px -10px rgba(19, 26, 41, 0.5);
}

.cg-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    border: 1px dashed var(--cg-line);
    border-radius: 12px;
    background: var(--cg-surface-soft);
}

.cg-switch input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.cg-switch label {
    margin: 0;
    font-size: 14px;
    color: var(--cg-ink);
    cursor: pointer;
}

.cg-switch .cg-switch-badge {
    margin-inline-start: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(51, 168, 83, 0.12);
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: 600;
}

/* --- submit -------------------------------------------------------------- */

.cg-form-card .ai-content-submit {
    width: 100%;
    min-width: 0;
    float: none;
    display: block;
    padding: 15px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-color);
    background-image: none;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.cg-form-card .ai-content-submit:hover {
    background: var(--primary-color-hover);
    background-image: none;
    color: #fff;
}

.cg-form-card .ai-content-submit.disabled {
    background: #d7dae0;
    background-image: none;
    color: #fff;
    border-color: transparent;
}

.cg-form-card .field-validation-error {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    color: var(--primary-color);
}

.cg-form-card .input-validation-error {
    border-color: var(--primary-color) !important;
}

/* ------------------------------------------------ intro copy with artwork -- */

.cg-feature {
    padding: 50px 0;
}

.cg-feature-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.cg-feature-figure {
    flex: 0 1 320px;
    text-align: center;
}

/* The artwork sits on a square canvas with generous margins of its own, so it
   is held well under the column width to stop it dwarfing the copy. */
.cg-feature-figure img,
.cg-feature-figure svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.cg-feature-body {
    flex: 1 1 440px;
}

.cg-feature-body h2 {
    font-size: 34px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--cg-ink);
    margin: 0 0 20px;
}

.cg-feature-body h2 .colored-text {
    color: var(--primary-color);
}

.cg-feature-body p {
    font-size: 16px;
    line-height: 36px;
    text-align: justify;
    color: var(--cg-muted);
    margin: 0;
}

/* ------------------------------------------------------------ agent cards -- */

.cg-agents {
    padding: 40px 0 10px;
}

.cg-agents-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    padding: 30px 36px;
    border: 1px solid var(--cg-line);
    border-radius: var(--cg-radius);
    background: var(--cg-surface);
    box-shadow: var(--cg-shadow);
}

.cg-agents-intro-figure {
    flex: 0 0 190px;
    max-width: 190px;
}

.cg-agents-intro-figure img {
    width: 100%;
    height: auto;
}

.cg-agents-intro-body {
    flex: 1 1 320px;
}

.cg-agents-intro-body h2 {
    font-size: 28px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--cg-ink);
    margin: 0 0 14px;
}

.cg-agents-intro-body p {
    font-size: 16px;
    line-height: 32px;
    text-align: justify;
    color: var(--cg-muted);
    margin: 0;
}

/* ----------------------------------------------------------------- pricing -- */

/* The reference page sets the pricing block on a soft grey panel; the card
   classes themselves already live in the site stylesheet. */
.cg-pricing {
    padding: 50px 0;
}

.cg-pricing-panel {
    padding: 44px 36px;
    border-radius: 24px;
    background: #f4f4f4;
}

.cg-pricing-panel .head-section-title {
    font-size: 34px;
    margin-bottom: 22px;
}

.cg-pricing-intro {
    max-width: 820px;
    margin: 0 auto 36px;
    font-size: 16px;
    line-height: 34px;
    text-align: center;
    color: var(--cg-muted);
}

/* In the full-width panel the cards are capped and centred so that two packs
   do not stretch into a pair of very wide slabs. */
.cg-pricing-panel .cg-packs {
    max-width: 1160px;
    margin-inline: auto;
    grid-template-columns: repeat(auto-fit, minmax(250px, 350px));
    justify-content: center;
}

/* The agent chain is a sequence, so it reads as a timeline rather than a grid.
   One markup serves both layouts: wide screens alternate cards around a centre
   rail, narrow ones drop to a single column with the rail on the side. */

.cg-timeline {
    position: relative;
    list-style: none;
    margin: 48px 0 0;
    padding: 0;
}

.cg-timeline:before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    inset-inline-start: 50%;
    width: 2px;
    margin-inline-start: -1px;
    background: linear-gradient(to bottom, transparent, var(--cg-line) 8%, var(--cg-line) 92%, transparent);
}

.cg-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 64px 1fr;
    align-items: center;
    margin-bottom: 26px;
}

.cg-timeline-item:last-child {
    margin-bottom: 0;
}

.cg-timeline-node {
    grid-column: 2;
    justify-self: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--cg-step-color, var(--primary-color));
    box-shadow: 0 0 0 6px var(--cg-step-tint, rgba(201, 29, 19, 0.12));
    z-index: 1;
}

.cg-timeline-card {
    grid-column: 1;
    position: relative;
    padding: 24px;
    border: 1px solid var(--cg-line);
    border-radius: var(--cg-radius);
    background: var(--cg-surface);
    box-shadow: 0 18px 40px -34px rgba(19, 26, 41, 0.55);
}

.cg-timeline-item:nth-child(2n) .cg-timeline-card {
    grid-column: 3;
}

.cg-timeline-card:before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--cg-step-color, var(--primary-color));
}

.cg-timeline-label {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--cg-step-tint, rgba(201, 29, 19, 0.08));
    color: var(--cg-step-color, var(--primary-color));
    font-size: 12px;
    font-weight: 600;
}

.cg-timeline-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cg-ink);
    margin: 0 0 10px;
}

.cg-timeline-card p {
    font-size: 14px;
    line-height: 28px;
    color: var(--cg-muted);
    margin: 0;
}

.cg-timeline-item:nth-child(6n+1) {
    --cg-step-color: #c91d13;
    --cg-step-tint: rgba(201, 29, 19, 0.12);
}

.cg-timeline-item:nth-child(6n+2) {
    --cg-step-color: #faa61b;
    --cg-step-tint: rgba(250, 166, 27, 0.16);
}

.cg-timeline-item:nth-child(6n+3) {
    --cg-step-color: #00a64f;
    --cg-step-tint: rgba(0, 166, 79, 0.14);
}

.cg-timeline-item:nth-child(6n+4) {
    --cg-step-color: #5c78bb;
    --cg-step-tint: rgba(92, 120, 187, 0.16);
}

.cg-timeline-item:nth-child(6n+5) {
    --cg-step-color: #8e5cbb;
    --cg-step-tint: rgba(142, 92, 187, 0.16);
}

.cg-timeline-item:nth-child(6n+6) {
    --cg-step-color: #1d2430;
    --cg-step-tint: rgba(29, 36, 48, 0.12);
}

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 991px) {
    .cg-hero {
        padding-top: 34px;
    }

    .cg-hero-heading {
        font-size: 32px;
        margin-bottom: 32px;
    }

    /* Below the grid breakpoint the packs stack under the form. */
    .cg-hero-packs {
        margin-top: 34px;
    }
}

@media (max-width: 767px) {
    .cg-timeline:before {
        inset-inline-start: 23px;
        margin-inline-start: 0;
    }

    .cg-timeline-item {
        grid-template-columns: 46px 1fr;
        column-gap: 18px;
        align-items: start;
    }

    .cg-timeline-node {
        grid-column: 1;
        justify-self: start;
    }

    .cg-timeline-card,
    .cg-timeline-item:nth-child(2n) .cg-timeline-card {
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .cg-hero-heading {
        font-size: 27px;
    }

    .cg-form-card {
        padding: 20px;
    }

    .cg-type-tabs {
        flex-wrap: wrap;
    }

    .cg-type-tab {
        flex: 1 1 calc(50% - 6px);
    }

    .cg-agents-intro {
        padding: 24px;
        gap: 20px;
    }

    .cg-agents-intro-figure {
        flex-basis: 180px;
        max-width: 180px;
        margin: 0 auto;
    }

    .cg-agents-intro-body h2,
    .cg-feature-body h2 {
        font-size: 24px;
    }

    .cg-timeline-card {
        padding: 20px;
    }

    .cg-pricing-panel {
        padding: 30px 18px;
        border-radius: 18px;
    }
}
