/* =========================================================
   Creative Brief Form — Frontend Styles
   4621 Creative Solutions
   ========================================================= */

.cbf-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    color: #1a1a2e;
    max-width: 740px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────── */

.cbf-header {
    background: #1a1a2e;
    color: #fff;
    padding: 2rem 2.25rem 1.5rem;
    border-radius: 8px 8px 0 0;
}

.cbf-agency {
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9999bb;
    margin: 0 0 .35rem;
}

.cbf-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    line-height: 1.2;
}

.cbf-subtitle {
    font-size: .875rem;
    color: #bbbbdd;
    margin: 0 0 1.25rem;
    font-style: italic;
}

/* Progress */
.cbf-progress-bar {
    height: 3px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    margin-bottom: .5rem;
}

.cbf-progress-fill {
    height: 100%;
    width: 20%;
    background: #fff;
    border-radius: 3px;
    transition: width .4s ease;
}

.cbf-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: #9999bb;
}

/* ── Section Nav ─────────────────────────────────────────── */

.cbf-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 1rem 2.25rem;
    background: #f5f5f8;
    border-left: 1px solid #e0e0ea;
    border-right: 1px solid #e0e0ea;
}

.cbf-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #d0d0e0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: .75rem;
    color: #666;
    cursor: pointer;
    transition: all .2s;
    line-height: 1;
}

.cbf-nav-btn:hover {
    border-color: #999;
    color: #1a1a2e;
}

.cbf-nav-btn.is-active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
}

.cbf-nav-btn.is-complete {
    border-color: #888;
    color: #1a1a2e;
}

.cbf-nav-num {
    font-weight: 700;
    font-size: .7rem;
    opacity: .7;
}

.cbf-nav-label {
    font-weight: 500;
}

/* ── Form Body ───────────────────────────────────────────── */

.cbf-form,
.cbf-success {
    background: #fff;
    border: 1px solid #e0e0ea;
    border-top: none;
    padding: 2rem 2.25rem;
    border-radius: 0 0 8px 8px;
}

/* ── Sections ────────────────────────────────────────────── */

.cbf-section {
    display: none;
}

.cbf-section.is-active {
    display: block;
}

.cbf-section-header {
    margin-bottom: 1.75rem;
}

.cbf-section-num {
    display: inline-block;
    font-size: .7rem;
    letter-spacing: .1em;
    font-weight: 700;
    color: #aaa;
    margin-bottom: .25rem;
}

.cbf-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .4rem;
    color: #1a1a2e;
}

.cbf-section-desc {
    font-size: .875rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ── Fields ──────────────────────────────────────────────── */

.cbf-field {
    margin-bottom: 1.5rem;
}

.cbf-label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: .35rem;
    border: none;
    padding: 0;
}

/* Override fieldset defaults for radio/checkbox */
fieldset.cbf-field,
.cbf-field fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.cbf-hint {
    font-size: .8rem;
    color: #888;
    margin: 0 0 .4rem;
    line-height: 1.45;
    font-style: italic;
}

.cbf-required {
    color: #c0392b;
    margin-left: 2px;
}

.cbf-input,
.cbf-select,
.cbf-textarea {
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    color: #1a1a2e;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 9px 12px;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}

.cbf-input:focus,
.cbf-select:focus,
.cbf-textarea:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,.08);
}

.cbf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.cbf-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 80px;
}

/* ── Radio / Checkbox Options ────────────────────────────── */

.cbf-radio-group,
.cbf-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-top: .25rem;
}

.cbf-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    padding: 8px 11px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    line-height: 1.4;
}

.cbf-option-item:hover {
    border-color: #999;
    background: #f9f9fc;
}

.cbf-option-item input[type="radio"],
.cbf-option-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: #1a1a2e;
}

/* ── Validation ──────────────────────────────────────────── */

.cbf-error {
    font-size: .8rem;
    color: #c0392b;
    margin: .35rem 0 0;
    min-height: 1.2em;
}

.cbf-field.has-error .cbf-input,
.cbf-field.has-error .cbf-select,
.cbf-field.has-error .cbf-textarea {
    border-color: #c0392b;
}

.cbf-form-error {
    font-size: .875rem;
    color: #c0392b;
    margin-top: 1rem;
    text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────── */

.cbf-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.cbf-btn {
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    padding: 10px 22px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: transparent;
    color: #1a1a2e;
    cursor: pointer;
    transition: all .15s;
}

.cbf-btn:hover {
    background: #f5f5f8;
    border-color: #999;
}

.cbf-btn--next {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

.cbf-btn--next:hover {
    opacity: .85;
}

.cbf-btn:disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* ── Success Screen ──────────────────────────────────────── */

.cbf-success {
    text-align: center;
    padding: 3.5rem 2rem;
}

.cbf-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #ddd;
    font-size: 1.4rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.cbf-success-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 .5rem;
}

.cbf-success-desc {
    font-size: .9375rem;
    color: #666;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Loading State ───────────────────────────────────────── */

.cbf-btn--next.is-loading {
    opacity: .65;
    pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 560px) {
    .cbf-header,
    .cbf-section-nav,
    .cbf-form,
    .cbf-success {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .cbf-radio-group,
    .cbf-checkbox-group {
        grid-template-columns: 1fr;
    }

    .cbf-nav-label {
        display: none;
    }
}
