/**
 * Card Style — available on all themes
 * Applied when options_style=card on any dropdown or radio field.
 * Extends capsule pill base styles.
 */

.tf-card-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.tf-card-pill {
    border-radius: 8px;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tf-card-pill:hover:not(.tf-capsule-active) {
    border-color: #f08f00;
    background: #fff8ee;
    box-shadow: 0 2px 6px rgba(240,143,0,0.15);
}

.tf-card-pill.tf-capsule-active {
    border-color: var(--primary-color, #0d6efd);
    background: var(--primary-color, #0d6efd);
    color: #fff;
    box-shadow: none;
}

/* Override hover colour inside modern-capsule theme */
.teraforms-form-wrapper.theme-modern-capsule .tf-card-pill:hover:not(.tf-capsule-active) {
    border-color: #f08f00;
    background: #fff8ee;
}

/* Option subhead — "Label|value|icon|subhead".
   Baseline for every theme; theme-multi-step.css restyles it further.
   .tf-option-text stacks the label over its subhead so the icon remains a
   single flex sibling of the pair rather than of two separate spans. */
.tf-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tf-option-sub {
    display: block;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    opacity: 0.75;
}

.tf-card-pill.tf-has-sub {
    align-items: flex-start;
}

/* Plain (non-card) radio rows put the subhead under the label. */
.teraforms-radio-label.tf-has-sub .tf-option-sub {
    margin-top: 2px;
}

/* "Show checkbox in the card" — a control drawn on the right of each option.
   For radio cards the control is a decorative span (the real input stays
   hidden and holds the value); for checkbox fields the native box is moved
   to the right instead. Only applies when .tf-show-control is present. */
.tf-option-control {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-left: auto;
    border: 2px solid #cbd5e1;
    background: #fff;
    box-sizing: border-box;
}

.tf-option-control-radio {
    border-radius: 50%;
}

/* Selected — filled ring with a white centre dot. */
.tf-capsule-active .tf-option-control-radio {
    border-color: var(--primary-color, #0d6efd);
    background: var(--primary-color, #0d6efd);
    box-shadow: inset 0 0 0 3.5px #fff;
}

/* Checkbox fields: box each option and push the native control to the right. */
.teraforms-checkbox-group.tf-show-control .teraforms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e4e9f0;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
}

.teraforms-checkbox-group.tf-show-control .teraforms-checkbox-label > span {
    flex: 1 1 auto;
}

.teraforms-checkbox-group.tf-show-control input[type="checkbox"] {
    order: 2;
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    width: 20px;
    height: 20px;
}
