/* ============================================================
   The content request form and the article packs (Views/Home/_CgBlogFormPartial, _CgProductFormPartial,
   _FreeTrialNoticePartial, _ArticlePackCardsPartial): fields, type tabs, language segment, image switch, submit,
   the free-trial notice and the pack card. A page adds only its layout around them.
   ============================================================ */

.cg-free-offer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: var(--ds-r-md);
    background: var(--ds-red-soft);
    border: 1px dashed var(--ds-tint-line);
}

.cg-free-offer-body strong {
    display: block;
    color: var(--ds-red);
    font-size: 15px;
}

.cg-free-offer-body span {
    font-size: 13px;
    color: var(--ds-text);
}

.cg-free-offer-login {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--ds-muted);
}

    .cg-free-offer-login a {
        color: var(--ds-red);
        font-weight: 700;
    }

.cg-type-tabs {
    display: flex;
    gap: 2px;
    padding: 4px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: var(--ds-soft);
    border: 1px solid var(--ds-line);
}

.cg-type-tab {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    border-radius: 10px;
    padding: 9px 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ds-muted);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

    /* phones: a long type name wraps inside its tab instead of being cut */
    @media (max-width: 575px) {
        .cg-type-tab {
            padding: 8px 4px;
            font-size: 13px;
            overflow-wrap: anywhere;
        }
    }

    .cg-type-tab.is-active {
        background: var(--ds-red);
        color: #FFF;
        font-weight: 700;
        box-shadow: 0 6px 14px rgba(201, 29, 19, 0.22);
    }

.cg-field {
    margin-bottom: 14px;
}

.cg-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-ink);
    margin-bottom: 6px;
}

.cg-optional {
    margin-inline-start: 6px;
    font-weight: 400;
    font-size: 12px;
    color: var(--ds-muted);
}

.cg-field input[type="text"],
.cg-field textarea {
    width: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--ds-input-line);
    background: var(--ds-soft);
    font-family: inherit;
    font-size: 14px;
    color: var(--ds-ink);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.cg-field textarea {
    min-height: 100px;
    resize: vertical;
}

    .cg-field input[type="text"]::placeholder,
    .cg-field textarea::placeholder {
        color: var(--ds-placeholder);
    }

    .cg-field input[type="text"]:focus,
    .cg-field textarea:focus {
        outline: none;
        border-color: var(--ds-red);
        background: var(--ds-surface);
        box-shadow: var(--ds-ring);
    }

.cg-keywords {
    position: relative;
}

    .cg-keywords input[type="text"] {
        padding-inline-end: 54px;
    }

.ai-generator-add-word {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-red);
    color: #FFF;
    font-size: 13px;
    cursor: pointer;
}

    .ai-generator-add-word.disable {
        background: var(--ds-line);
        color: var(--ds-muted);
        cursor: default;
    }

.cg-choice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 14px;
}

.cg-segment {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    background: var(--ds-soft);
    border: 1px solid var(--ds-line);
}

    .cg-segment input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .cg-segment label {
        padding: 6px 16px;
        border-radius: 9px;
        font-size: 13px;
        color: var(--ds-muted);
        cursor: pointer;
    }

    .cg-segment input:checked + label {
        background: var(--ds-red);
        color: #FFF;
        font-weight: 700;
    }

    .cg-segment input:focus-visible + label {
        outline: 2px solid var(--ds-red);
    }

.cg-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--ds-ink);
}

    .cg-switch input {
        appearance: none;
        -webkit-appearance: none;
        flex: none;
        width: 42px;
        height: 24px;
        border-radius: 24px;
        background: var(--ds-line);
        position: relative;
        cursor: pointer;
        transition: background .2s ease;
    }

        .cg-switch input::after {
            content: "";
            position: absolute;
            top: 3px;
            inset-inline-start: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #FFF;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
            transition: inset-inline-start .2s ease;
        }

        .cg-switch input:checked {
            background: var(--ds-red);
        }

            .cg-switch input:checked::after {
                inset-inline-start: 21px;
            }

    .cg-switch label {
        cursor: pointer;
    }

.cg-switch-badge {
    padding: 1px 9px;
    border-radius: 7px;
    background: var(--ds-ok-soft);
    color: var(--ds-ok);
    font-size: 12px;
    font-weight: 700;
}

.ai-content-submit {
    width: 100%;
    height: 52px;
}

.cg-pack-name {
    grid-area: name;
    font-size: 18px;
    font-weight: 700;
    color: var(--ds-ink);
}

.cg-pack-caption {
    grid-area: caption;
    font-size: 13px;
    color: var(--ds-muted);
}

.cg-pack-price {
    grid-area: price;
    display: flex;
    align-items: baseline;
    gap: 6px;
    justify-self: end;
}

.cg-pack-amount {
    font-family: var(--ds-mono);
    font-size: 30px;
    font-weight: 700;
    color: var(--ds-red);
}

.cg-pack-currency {
    font-size: 13px;
    color: var(--ds-muted);
}

.cg-pack .price-old {
    font-family: var(--ds-mono);
    font-size: 13px;
    color: var(--ds-muted);
}

.cg-pack-features {
    grid-area: features;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--ds-text);
}

    .cg-pack-features li::before {
        content: "\f00c";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 9px;
        margin-inline-end: 5px;
        color: var(--ds-ok);
    }

.cg-pack-cta {
    grid-area: cta;
    justify-self: end;
}


/* the keywords added so far, as removable chips (ai-content-forms.js fills the list) */
.ai-content-words-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

    .ai-content-words-tags:empty {
        margin: 0;
    }

    .ai-content-words-tags li {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        border-radius: var(--ds-r-pill);
        background: var(--ds-red-soft);
        font-size: 13px;
        font-weight: 600;
        color: var(--ds-red);
    }

        .ai-content-words-tags li i {
            font-size: 11px;
            opacity: .7;
            cursor: pointer;
        }

            .ai-content-words-tags li i:hover {
                opacity: 1;
            }

/* jQuery Validate's messages and fields */
.cg-form-card .field-validation-error {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    color: var(--ds-red);
}

.cg-form-card .input-validation-error {
    border-color: var(--ds-red) !important;
}

/* the submit until the required fields are filled (ai-content-forms.js toggles .disabled) */
.ai-content-submit.disabled {
    background: var(--ds-line);
    border-color: transparent;
    box-shadow: none;
    color: var(--ds-muted);
}
