/* CFB Frontend — conversational form */
.cfb-wrapper {
    --cfb-primary: #a78b6e;
    --cfb-bg: #f7f3ed;
    --cfb-text: #2a2a2a;
    --cfb-muted: #8a8a8a;
    --cfb-border: #e6dfd2;
    background: var(--cfb-bg);
    padding: 60px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--cfb-text);
    min-height: 70vh;
}
.cfb-app {
    max-width: 720px;
    margin: 0 auto;
    background: transparent;
}

.cfb-error { background:#fee; color:#900; padding:12px; border-radius:8px; }

/* Header (back + progress) */
.cfb-header {
    display:flex; align-items:center; justify-content: space-between;
    margin-bottom: 12px;
}
.cfb-back {
    background:none; border:0; cursor:pointer; color: var(--cfb-text);
    font-size: 15px; padding: 6px 0; opacity: .8;
}
.cfb-back:hover { opacity: 1; }
.cfb-step-counter { color: var(--cfb-muted); font-size: 14px; }

.cfb-progress {
    height: 4px; background: var(--cfb-border); border-radius: 2px; overflow: hidden;
    margin-bottom: 36px;
}
.cfb-progress-bar {
    height: 100%; background: var(--cfb-primary); width: 0%;
    transition: width .3s ease;
}

/* Question */
.cfb-question { animation: cfb-fade .25s ease; }
@keyframes cfb-fade { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

.cfb-q-title {
    font-family: Georgia, "Playfair Display", serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.25;
    color: var(--cfb-text);
    margin: 0 0 8px;
}
.cfb-q-subtitle { color: var(--cfb-muted); margin-bottom: 24px; font-size: 15px; }

/* Radio plain */
.cfb-options-list { display: flex; flex-direction: column; gap: 12px; }
.cfb-opt {
    display:flex; align-items:center; gap: 12px;
    background: rgba(255,255,255,.45);
    border: 1px solid var(--cfb-border);
    padding: 14px 18px; border-radius: 10px;
    cursor: pointer; transition: background .15s, border-color .15s;
}
.cfb-opt:hover { background: rgba(255,255,255,.85); }
.cfb-opt input { accent-color: var(--cfb-primary); }
.cfb-opt.is-selected { background:#fff; border-color: var(--cfb-primary); }
.cfb-opt-radio {
    width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c8c0b0;
    display:inline-block; flex: none; position: relative;
}
.cfb-opt.is-selected .cfb-opt-radio { border-color: var(--cfb-primary); }
.cfb-opt.is-selected .cfb-opt-radio:after {
    content:''; position:absolute; inset: 3px; border-radius:50%; background: var(--cfb-primary);
}

/* Radio with images */
.cfb-options-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.cfb-opt-image {
    background: rgba(255,255,255,.5);
    border: 1px solid var(--cfb-border);
    border-radius: 12px; overflow: hidden;
    cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.cfb-opt-image:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.cfb-opt-image.is-selected { border-color: var(--cfb-primary); box-shadow: 0 0 0 2px var(--cfb-primary) inset; }
.cfb-opt-image img { display:block; width: 100%; height: 200px; object-fit: cover; }
.cfb-opt-image-label { padding: 14px 16px; display:flex; align-items:center; gap: 10px; font-size: 15px; }

/* Checkbox grid uses same style; selection square */
.cfb-opt.is-checkbox .cfb-opt-radio { border-radius: 4px; }
.cfb-opt.is-checkbox.is-selected .cfb-opt-radio:after { border-radius: 2px; inset: 3px; }

/* Other field */
.cfb-other-field {
    margin-top: 18px;
    background: rgba(255,255,255,.5);
    border: 1px solid var(--cfb-border);
    border-radius: 10px; padding: 12px 16px;
}
.cfb-other-field label { display:block; font-size: 13px; color: var(--cfb-muted); margin-bottom: 4px; }
.cfb-other-field input { width: 100%; border:0; background: transparent; outline:none; font-size: 15px; padding: 4px 0; color: var(--cfb-text); }

/* Free text inputs */
.cfb-text-input, .cfb-textarea-input {
    width: 100%;
    background: rgba(255,255,255,.6);
    border: 1px solid var(--cfb-border);
    border-radius: 10px;
    padding: 14px 18px; font-size: 16px;
    outline: none; transition: border-color .15s;
}
.cfb-text-input:focus, .cfb-textarea-input:focus { border-color: var(--cfb-primary); }
.cfb-textarea-input { min-height: 120px; resize: vertical; }

/* Errors */
.cfb-field-error { color:#b03030; font-size: 13px; margin-top: 8px; }

/* Buttons */
.cfb-btn {
    display: inline-flex; align-items:center; justify-content:center;
    background: var(--cfb-primary); color:#fff;
    border:0; padding: 14px 26px; border-radius: 10px;
    font-size: 15px; cursor: pointer; gap: 8px;
    transition: opacity .15s, transform .1s;
}
.cfb-btn:hover  { opacity: .92; }
.cfb-btn:active { transform: translateY(1px); }
.cfb-btn[disabled] { opacity: .5; cursor: not-allowed; }
.cfb-btn-secondary {
    background: transparent; color: var(--cfb-text);
    border: 1px solid var(--cfb-border);
}
.cfb-btn-block { width: 100%; padding: 16px; margin-top: 28px; }

/* Contact step */
.cfb-contact-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.cfb-contact-fields label { display:flex; flex-direction:column; gap: 6px; font-size: 13px; color: var(--cfb-muted); }
.cfb-contact-fields input { background: rgba(255,255,255,.6); border:1px solid var(--cfb-border); border-radius:10px; padding: 12px 16px; font-size: 15px; outline:none; }
.cfb-contact-fields input:focus { border-color: var(--cfb-primary); }

/* Thank you */
.cfb-thanks { text-align:center; padding: 30px 20px; animation: cfb-fade .35s ease; }
.cfb-thanks-icon {
    width: 64px; height: 64px; margin: 0 auto 18px; border-radius:50%;
    background: rgba(167,139,110,.15); display:flex; align-items:center; justify-content:center;
}
.cfb-thanks-icon svg { width: 32px; height: 32px; color: var(--cfb-primary); }
.cfb-thanks h2 { font-family: Georgia, serif; font-weight: 400; font-size: 36px; margin: 0 0 14px; }
.cfb-thanks p { color: var(--cfb-muted); max-width: 460px; margin: 0 auto 24px; line-height: 1.55; }
.cfb-pdf-btn { display:inline-flex; align-items:center; gap:8px; }
.cfb-summary {
    text-align: left; background: rgba(255,255,255,.55); border: 1px solid var(--cfb-border);
    border-radius: 10px; padding: 22px 26px; margin: 24px 0 28px;
}
.cfb-summary p { margin: 0 0 10px; color: var(--cfb-text); }
.cfb-summary ol { margin: 0; padding-left: 18px; color: var(--cfb-text); }
.cfb-summary ol li { margin: 6px 0; color: var(--cfb-muted); }
.cfb-summary ol li strong { color: var(--cfb-text); font-weight: 500; }
.cfb-thanks-actions { display:flex; gap: 12px; justify-content:center; flex-wrap: wrap; }

/* Hub view */
.cfb-hub {
    max-width: 720px; margin: 0 auto; background: var(--cfb-bg); padding: 60px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cfb-hub-title { font-family: Georgia, serif; font-weight: 400; font-size: 36px; text-align:center; margin: 0 0 8px; }
.cfb-hub-subtitle { text-align:center; color: var(--cfb-muted); margin: 0 0 36px; font-size: 15px; }
.cfb-hub-list { display:flex; flex-direction:column; gap: 12px; }
.cfb-hub-item {
    display:flex; align-items:center; gap: 14px;
    background: linear-gradient(90deg, #ece2d3, #e8dcc9);
    padding: 18px 22px; border-radius: 14px;
    text-decoration: none; color: inherit;
    transition: transform .12s ease, box-shadow .12s ease;
}
.cfb-hub-item:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.cfb-hub-icon {
    width: 28px; height: 28px; display: inline-block; flex:none;
    background: var(--cfb-primary); -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" fill="black"/></svg>') center/contain no-repeat;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" fill="black"/></svg>') center/contain no-repeat;
}
.cfb-hub-meta { flex: 1; display:flex; flex-direction:column; }
.cfb-hub-meta strong { font-size: 17px; }
.cfb-hub-meta span { color: var(--cfb-muted); font-size: 13px; }
.cfb-hub-arrow { color: var(--cfb-primary); font-size: 22px; }

/* Responsive */
@media (max-width: 640px) {
    .cfb-wrapper { padding: 24px 16px; }
    .cfb-q-title { font-size: 22px; }
    .cfb-options-grid { grid-template-columns: 1fr; }
    .cfb-opt-image img { height: 180px; }
    .cfb-thanks h2 { font-size: 28px; }
}
