/**
 * CTC Visual Form Steps - Frontend Styles
 */

:root {
    --ctc-vfs-primary: #0089cf;
    --ctc-vfs-primary-hover: #006da6;
    --ctc-vfs-text: #333;
    --ctc-vfs-text-light: #666;
    --ctc-vfs-border: #ddd;
    --ctc-vfs-bg: #fff;
    --ctc-vfs-bg-light: #f9f9f9;
    --ctc-vfs-success: #28a745;
    --ctc-vfs-error: #dc3545;
    /* Font size defaults */
    --ctc-vfs-font-base: 16px;
    --ctc-vfs-font-title: 24px;
    --ctc-vfs-font-tile: 15px;
    --ctc-vfs-font-description: 14px;
    --ctc-vfs-font-button: 16px;
    --ctc-vfs-font-input: 16px;
}

/* Form Wrapper */
.ctc-vfs-form-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    font-size: var(--ctc-vfs-font-base) !important;
    color: var(--ctc-vfs-text) !important;
    line-height: 1.5 !important;
}

.ctc-vfs-form-wrapper * {
    box-sizing: border-box;
}

/* Force font inheritance to override theme */
.ctc-vfs-form-wrapper,
.ctc-vfs-form-wrapper p,
.ctc-vfs-form-wrapper span,
.ctc-vfs-form-wrapper div,
.ctc-vfs-form-wrapper label {
    font-family: inherit !important;
    line-height: 1.5 !important;
}

/* Optional header above the steps */
.ctc-vfs-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ctc-vfs-form-header-logo img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.ctc-vfs-form-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.ctc-vfs-form-header-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--ctc-vfs-text);
}

.ctc-vfs-form-header-subtitle {
    font-size: 13px;
    color: var(--ctc-vfs-text-light, #6b7280);
    margin-top: 2px;
}

/* Optional USP footer below the navigation */
.ctc-vfs-usp-footer {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
}

.ctc-vfs-usp-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ctc-vfs-text-light, #6b7280);
    line-height: 1.3;
}

.ctc-vfs-usp-item .ctc-vfs-usp-icon {
    font-size: 14px;
    color: var(--ctc-vfs-primary);
    flex-shrink: 0;
}

.ctc-vfs-form-inner {
    width: 100%;
    max-width: 700px;
    min-width: 320px;
    margin: 0 auto;
    padding: 30px;
    background: var(--ctc-vfs-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Fixed width for popup mode to prevent size changes between steps */
.ctc-vfs-mode-popup .ctc-vfs-form-inner {
    width: 700px;
}

/* Popup Mode */
.ctc-vfs-mode-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

.ctc-vfs-mode-popup.ctc-vfs-hidden {
    display: none;
}

.ctc-vfs-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.ctc-vfs-popup-container {
    position: relative;
    width: 700px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    box-sizing: border-box;
}

.ctc-vfs-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--ctc-vfs-bg-light);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--ctc-vfs-text-light);
    z-index: 10;
}

.ctc-vfs-popup-close:hover {
    background: var(--ctc-vfs-border);
    color: var(--ctc-vfs-text);
}

/* The .ctc-vfs-popup-trigger base styles (and CTA preset variants) live in
   public/cta-presets.css so the admin meta-box gallery can load just those
   rules without pulling in the rest of this file. Frontend pages enqueue
   both stylesheets. */

/* Progress Indicators */
.ctc-vfs-progress {
    margin-bottom: 30px;
}

.ctc-vfs-progress-steps {
    text-align: center;
    font-size: 14px;
    color: var(--ctc-vfs-text-light);
    margin-bottom: 10px;
}

.ctc-vfs-current-step {
    font-weight: 700;
    color: var(--ctc-vfs-primary);
    font-size: 18px;
}

.ctc-vfs-progress-bar {
    height: 6px;
    background: var(--ctc-vfs-bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.ctc-vfs-progress-fill {
    height: 100%;
    background: var(--ctc-vfs-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ctc-vfs-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
    font-size: calc(var(--ctc-vfs-font-description) - 1px) !important;
}

.ctc-vfs-breadcrumb-item {
    color: var(--ctc-vfs-text-light);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--ctc-vfs-bg-light);
}

.ctc-vfs-breadcrumb-item.active {
    background: var(--ctc-vfs-primary);
    color: #fff;
}

.ctc-vfs-breadcrumb-item.completed {
    background: var(--ctc-vfs-success);
    color: #fff;
}

.ctc-vfs-breadcrumb-separator {
    color: var(--ctc-vfs-border);
}

/* Steps */
.ctc-vfs-step {
    display: none;
}

.ctc-vfs-step.active {
    display: block;
    animation: ctcVfsFadeIn 0.3s ease;
}

@keyframes ctcVfsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctc-vfs-step-title,
.ctc-vfs-form-wrapper .ctc-vfs-step-title,
.ctc-vfs-form-wrapper h2.ctc-vfs-step-title {
    font-size: var(--ctc-vfs-font-title) !important;
    font-weight: 700 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: var(--ctc-vfs-text) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
}

.ctc-vfs-step-description,
.ctc-vfs-form-wrapper .ctc-vfs-step-description,
.ctc-vfs-form-wrapper p.ctc-vfs-step-description {
    font-size: var(--ctc-vfs-font-description) !important;
    color: var(--ctc-vfs-text-light) !important;
    margin: 0 0 25px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.ctc-vfs-step-content {
    margin-bottom: 20px;
    min-width: 0;
    overflow-x: hidden;
}

/* Visual Tiles */
.ctc-vfs-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    min-width: 0;
}

.ctc-vfs-tile {
    cursor: pointer;
    min-width: 0;
}

.ctc-vfs-tile-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ctc-vfs-tile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: var(--ctc-vfs-bg-light);
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    min-width: 0;
}

.ctc-vfs-tile:hover .ctc-vfs-tile-content {
    border-color: var(--ctc-vfs-primary);
    background: #fff;
}

.ctc-vfs-tile-input:checked + .ctc-vfs-tile-content {
    border-color: var(--ctc-vfs-primary);
    background: rgba(0, 137, 207, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 137, 207, 0.15);
}

.ctc-vfs-tile-image {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.ctc-vfs-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ctc-vfs-tile-title,
.ctc-vfs-form-wrapper .ctc-vfs-tile-title {
    font-weight: 600 !important;
    font-size: var(--ctc-vfs-font-tile) !important;
    color: var(--ctc-vfs-text) !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    min-width: 0;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
}

.ctc-vfs-tile-description {
    font-size: calc(var(--ctc-vfs-font-description) - 1px) !important;
    color: var(--ctc-vfs-text-light);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.ctc-vfs-tile-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--ctc-vfs-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.ctc-vfs-tile-input:checked + .ctc-vfs-tile-content .ctc-vfs-tile-check {
    opacity: 1;
    transform: scale(1);
}

/* Form Fields */
.ctc-vfs-input,
.ctc-vfs-textarea,
.ctc-vfs-select,
.ctc-vfs-date {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 8px;
    font-size: var(--ctc-vfs-font-input) !important;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ctc-vfs-input:focus,
.ctc-vfs-textarea:focus,
.ctc-vfs-select:focus,
.ctc-vfs-date:focus {
    outline: none;
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Radio & Checkbox Groups */
.ctc-vfs-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ctc-vfs-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--ctc-vfs-bg-light);
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--ctc-vfs-font-base) !important;
}

.ctc-vfs-radio-item:hover {
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-radio-item input:checked + .ctc-vfs-radio-label {
    color: var(--ctc-vfs-primary);
    font-weight: 600;
}

.ctc-vfs-radio-item:has(input:checked) {
    border-color: var(--ctc-vfs-primary);
    background: rgba(0, 137, 207, 0.05);
}

/* Navigation Buttons */
.ctc-vfs-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--ctc-vfs-border);
}

.ctc-vfs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: var(--ctc-vfs-font-button) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ctc-vfs-btn-back {
    background: var(--ctc-vfs-bg-light);
    color: var(--ctc-vfs-text-light);
}

.ctc-vfs-btn-back:hover {
    background: var(--ctc-vfs-border);
    color: var(--ctc-vfs-text);
}

.ctc-vfs-btn-primary {
    background: var(--ctc-vfs-primary);
    color: #fff;
    margin-left: auto;
}

.ctc-vfs-btn-primary:hover {
    background: var(--ctc-vfs-primary-hover);
}

.ctc-vfs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ctc-vfs-btn-icon {
    font-size: 18px;
}

/* Field Errors */
.ctc-vfs-field-error {
    color: var(--ctc-vfs-error);
    font-size: 14px;
    margin-top: 8px;
}

.ctc-vfs-step.has-error .ctc-vfs-input,
.ctc-vfs-step.has-error .ctc-vfs-textarea,
.ctc-vfs-step.has-error .ctc-vfs-select {
    border-color: var(--ctc-vfs-error);
}

/* CF7 Form Step */
.ctc-vfs-cf7-container {
    margin-top: 20px;
}

.ctc-vfs-cf7-container .wpcf7-form {
    max-width: 100%;
}

.ctc-vfs-cf7-container .wpcf7-form p {
    margin-bottom: 15px;
}

.ctc-vfs-cf7-container .wpcf7-form input[type="text"],
.ctc-vfs-cf7-container .wpcf7-form input[type="email"],
.ctc-vfs-cf7-container .wpcf7-form input[type="tel"],
.ctc-vfs-cf7-container .wpcf7-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 8px;
    font-size: var(--ctc-vfs-font-input) !important;
    font-family: inherit;
}

.ctc-vfs-cf7-container .wpcf7-form input:focus,
.ctc-vfs-cf7-container .wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-cf7-container .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--ctc-vfs-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--ctc-vfs-font-button) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ctc-vfs-cf7-container .wpcf7-submit:hover {
    background: var(--ctc-vfs-primary-hover);
}

/* Success Message */
.ctc-vfs-success-message {
    text-align: center;
    padding: 32px 20px;
}

.ctc-vfs-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--ctc-vfs-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.ctc-vfs-success-message h3,
.ctc-vfs-success-title {
    font-size: 24px;
    margin: 0 0 8px;
    color: var(--ctc-vfs-text);
}

.ctc-vfs-success-text {
    color: var(--ctc-vfs-text-light);
    margin: 0 auto 20px;
    max-width: 480px;
}

.ctc-vfs-success-text p {
    margin: 0 0 8px;
}

.ctc-vfs-success-text p:last-child {
    margin-bottom: 0;
}

.ctc-vfs-success-summary {
    text-align: left;
    max-width: 480px;
    margin: 0 auto 20px;
    padding: 14px 18px;
    background: var(--ctc-vfs-bg-light);
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 8px;
}

.ctc-vfs-success-summary-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--ctc-vfs-text-light);
    margin: 0 0 8px;
}

.ctc-vfs-success-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ctc-vfs-success-summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.ctc-vfs-success-summary-list li:last-child {
    border-bottom: 0;
}

.ctc-vfs-success-summary-label {
    color: var(--ctc-vfs-text-light);
    flex: 0 0 auto;
}

.ctc-vfs-success-summary-value {
    color: var(--ctc-vfs-text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.ctc-vfs-success-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.ctc-vfs-success-actions .ctc-vfs-success-button {
    min-width: 200px;
}

/* HTML Content */
.ctc-vfs-html-content {
    padding: 20px;
    background: var(--ctc-vfs-bg-light);
    border-radius: 8px;
}

/* Error state */
.ctc-vfs-error {
    color: var(--ctc-vfs-error);
    padding: 15px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
}

/* ==========================================================================
   NEW FEATURES: Decision Tree Enhancements
   ========================================================================== */

/* Step Badge/USP */
.ctc-vfs-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ctc-vfs-bg-light);
    border-radius: 20px;
    font-size: calc(var(--ctc-vfs-font-description) - 1px) !important;
    color: var(--ctc-vfs-text-light);
    margin: 0 0 20px;
}

.ctc-vfs-step-badge::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--ctc-vfs-success);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

/* Tile Icon */
.ctc-vfs-tile-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
}

/* Tile Text Container (for list layout) */
.ctc-vfs-tile-text {
    display: flex;
    flex-direction: column;
}

/* Tile Highlight */
.ctc-vfs-tile {
    position: relative;
}

.ctc-vfs-tile-highlighted .ctc-vfs-tile-content {
    border-color: var(--ctc-vfs-primary);
    background: rgba(0, 137, 207, 0.03);
}

.ctc-vfs-tile-badge {
    background: var(--ctc-vfs-primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Corner badge: absolute, top-right of the tile */
.ctc-vfs-tile-badge-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    transform: none;
    z-index: 2;
    pointer-events: none;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inline badge: small pill rendered next to the title text */
.ctc-vfs-tile-badge-inline {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: inherit;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    background: rgba(212, 101, 43, 0.12);
    color: var(--ctc-vfs-primary);
    vertical-align: baseline;
    border-radius: 12px;
}

/* Tile Layout Variants */
.ctc-vfs-tiles-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.ctc-vfs-tiles-layout-list {
    grid-template-columns: 1fr;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-content {
    flex-direction: row;
    text-align: left;
    padding: 16px 20px;
    gap: 15px;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-icon {
    font-size: 32px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-image {
    width: 50px;
    height: 50px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-text {
    flex: 1;
    align-items: flex-start;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-check {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-badge-corner {
    top: 8px;
    right: 48px; /* leave room for the check circle on the right */
    left: auto;
    transform: none;
}

.ctc-vfs-tiles-layout-2col {
    grid-template-columns: repeat(2, 1fr);
}

/* Per-tile extra-input textarea */
.ctc-vfs-tile-extra {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 10px;
    text-align: left;
    cursor: text;
}

.ctc-vfs-tile-input:checked ~ .ctc-vfs-tile-extra,
.ctc-vfs-tile.is-selected .ctc-vfs-tile-extra {
    display: flex;
}

.ctc-vfs-tiles-layout-list .ctc-vfs-tile-extra,
.ctc-vfs-tile-has-extra .ctc-vfs-tile-extra {
    grid-column: 1 / -1;
    width: 100%;
}

.ctc-vfs-tile-extra-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #5A6474;
}

.ctc-vfs-tile-extra-req {
    color: var(--ctc-vfs-primary);
}

.ctc-vfs-tile-extra-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    color: inherit;
    background: #fafaf8;
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    min-height: 68px;
    transition: border-color 0.2s ease;
}

.ctc-vfs-tile-extra-input:focus {
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-tile.has-error .ctc-vfs-tile-extra-input {
    border-color: #c0392b;
}

/* Chips layout hides description but should still reveal the textarea */
.ctc-vfs-tiles-chips .ctc-vfs-tile-extra {
    flex-basis: 100%;
}

/* Chip-style Multi-select */
.ctc-vfs-tiles-chips,
.ctc-vfs-radio-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ctc-vfs-tiles-chips .ctc-vfs-tile-content {
    flex-direction: row;
    padding: 10px 18px;
    min-width: auto;
    border-radius: 50px;
    gap: 8px;
}

.ctc-vfs-tiles-chips .ctc-vfs-tile-image,
.ctc-vfs-tiles-chips .ctc-vfs-tile-icon,
.ctc-vfs-tiles-chips .ctc-vfs-tile-description,
.ctc-vfs-tiles-chips .ctc-vfs-tile-check {
    display: none;
}

.ctc-vfs-tiles-chips .ctc-vfs-tile-title {
    margin: 0;
    font-size: 14px;
}

.ctc-vfs-tiles-chips .ctc-vfs-tile-badge-corner {
    position: static;
    transform: none;
    padding: 2px 8px;
    font-size: 10px;
}

.ctc-vfs-radio-chips {
    flex-direction: row;
}

.ctc-vfs-radio-chips .ctc-vfs-radio-item {
    padding: 10px 18px;
    border-radius: 50px;
    background: var(--ctc-vfs-bg-light);
}

.ctc-vfs-radio-chips .ctc-vfs-radio-item input {
    display: none;
}

.ctc-vfs-radio-chips .ctc-vfs-radio-item:has(input:checked) {
    background: var(--ctc-vfs-primary);
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-radio-chips .ctc-vfs-radio-item:has(input:checked) .ctc-vfs-radio-label {
    color: #fff;
}

/* Summary Step */
.ctc-vfs-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ctc-vfs-summary-item,
.ctc-vfs-form-wrapper .ctc-vfs-summary-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--ctc-vfs-bg-light);
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--ctc-vfs-font-base) !important;
}

.ctc-vfs-summary-item:hover {
    border-color: var(--ctc-vfs-primary);
    background: #fff;
}

.ctc-vfs-summary-label,
.ctc-vfs-form-wrapper .ctc-vfs-summary-label {
    flex: 1;
    font-weight: 600 !important;
    font-size: var(--ctc-vfs-font-base) !important;
    color: var(--ctc-vfs-text) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
}

.ctc-vfs-summary-value,
.ctc-vfs-form-wrapper .ctc-vfs-summary-value {
    color: var(--ctc-vfs-primary) !important;
    font-weight: 500 !important;
    font-size: var(--ctc-vfs-font-base) !important;
    margin-right: 15px;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
}

.ctc-vfs-summary-edit {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--ctc-vfs-text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.ctc-vfs-summary-edit:hover {
    border-color: var(--ctc-vfs-primary);
    color: var(--ctc-vfs-primary);
}

.ctc-vfs-summary-edit-hint {
    text-align: center;
    font-size: 13px;
    color: var(--ctc-vfs-text-light);
    margin-top: 15px;
}

/* Summary Item Group (for form_group display) */
.ctc-vfs-summary-item-group {
    flex-wrap: wrap;
    align-items: flex-start;
}

.ctc-vfs-summary-item-group .ctc-vfs-summary-value {
    width: 100%;
    margin-top: 8px;
    margin-right: 0;
    order: 3;
    font-weight: normal;
    line-height: 1.8;
}

.ctc-vfs-summary-item-group .ctc-vfs-summary-value strong {
    color: var(--ctc-vfs-text);
}

/* Form Group Step */
.ctc-vfs-form-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.ctc-vfs-form-field {
    display: flex;
    flex-direction: column;
}

.ctc-vfs-form-field-full {
    width: 100%;
    flex: 0 0 100%;
}

.ctc-vfs-form-field-half {
    width: calc(50% - 8px);
    flex: 0 0 calc(50% - 8px);
}

.ctc-vfs-form-field-third {
    width: calc(33.333% - 11px);
    flex: 0 0 calc(33.333% - 11px);
}

.ctc-vfs-form-field-label {
    font-weight: 600;
    font-size: 14px !important;
    margin-bottom: 4px;
    color: var(--ctc-vfs-text);
    line-height: 1.3;
}

.ctc-vfs-required {
    color: var(--ctc-vfs-error);
    margin-left: 2px;
}

.ctc-vfs-form-field .ctc-vfs-input,
.ctc-vfs-form-field .ctc-vfs-textarea,
.ctc-vfs-form-field .ctc-vfs-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.ctc-vfs-form-field .ctc-vfs-textarea {
    min-height: 84px;
}

.ctc-vfs-form-field .ctc-vfs-input:focus,
.ctc-vfs-form-field .ctc-vfs-textarea:focus,
.ctc-vfs-form-field .ctc-vfs-select:focus {
    outline: none;
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-form-field.has-error .ctc-vfs-input,
.ctc-vfs-form-field.has-error .ctc-vfs-textarea,
.ctc-vfs-form-field.has-error .ctc-vfs-select,
.ctc-vfs-form-field.has-error .ctc-vfs-chips-group {
    border-color: var(--ctc-vfs-error);
}

.ctc-vfs-form-field .ctc-vfs-field-error {
    color: var(--ctc-vfs-error);
    font-size: 13px;
    margin-top: 4px;
}

/* Display-only info box (form_group field type "info_box") */
.ctc-vfs-form-field-info {
    /* lay out like any other form field; the box itself carries the visual */
}

.ctc-vfs-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.45;
}

.ctc-vfs-info-box-icon {
    font-size: 16px;
    line-height: 1.2;
    flex-shrink: 0;
}

.ctc-vfs-info-box-body {
    flex: 1;
    min-width: 0;
}

.ctc-vfs-info-box-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.ctc-vfs-info-box-text,
.ctc-vfs-info-box-text p {
    margin: 0;
}

.ctc-vfs-info-box-text p + p {
    margin-top: 6px;
}

.ctc-vfs-info-box-text a {
    color: inherit;
    text-decoration: underline;
}

/* Variants */
.ctc-vfs-info-box-tip {
    background: rgba(212, 101, 43, 0.10);
    border-color: rgba(212, 101, 43, 0.25);
    color: #7a3a17;
}

.ctc-vfs-info-box-info {
    background: rgba(0, 137, 207, 0.10);
    border-color: rgba(0, 137, 207, 0.25);
    color: #0b4d70;
}

.ctc-vfs-info-box-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.30);
    color: #7a4d00;
}

.ctc-vfs-info-box-success {
    background: rgba(34, 165, 92, 0.12);
    border-color: rgba(34, 165, 92, 0.28);
    color: #1f5d36;
}

.ctc-vfs-info-box-neutral {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: var(--ctc-vfs-text);
}

/* Chips Group (in form group) */
.ctc-vfs-chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 8px;
    background: var(--ctc-vfs-bg-light);
}

/* Single-select variant: no container chrome — chips themselves carry the visual weight */
.ctc-vfs-chips-group.ctc-vfs-chips-group-single {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

/* Make single-select chips share the row evenly so they read as a balanced
   set of options (otherwise the longest label dominates and biases the user). */
.ctc-vfs-chips-group.ctc-vfs-chips-group-single .ctc-vfs-chip {
    flex: 1 1 0;
    min-width: 0;
}

.ctc-vfs-chips-group.ctc-vfs-chips-group-single .ctc-vfs-chip-label {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
}

.ctc-vfs-form-field.has-error .ctc-vfs-chips-group.ctc-vfs-chips-group-single {
    border-color: transparent;
}

.ctc-vfs-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ctc-vfs-chip input {
    display: none;
}

.ctc-vfs-chip-label {
    padding: 8px 16px;
    background: var(--ctc-vfs-bg);
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 50px;
    font-size: 14px;
    transition: all 0.2s;
}

.ctc-vfs-chip input:checked + .ctc-vfs-chip-label {
    background: var(--ctc-vfs-primary);
    border-color: var(--ctc-vfs-primary);
    color: #fff;
}

.ctc-vfs-chip:hover .ctc-vfs-chip-label {
    border-color: var(--ctc-vfs-primary);
}

/* Radio Stack (form-group radio buttons rendered as a vertical list with row highlight) */
.ctc-vfs-radio-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctc-vfs-radio-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--ctc-vfs-bg-light);
    border: 2px solid var(--ctc-vfs-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ctc-vfs-radio-row:hover {
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-radio-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ctc-vfs-radio-row-label {
    flex: 1;
    font-size: 15px;
    line-height: 1.3;
    color: inherit;
}

.ctc-vfs-radio-row-dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #D0CCC7;
    background: #fff;
    transition: all 0.15s ease;
    position: relative;
}

.ctc-vfs-radio-row input:checked ~ .ctc-vfs-radio-row-dot {
    border-color: var(--ctc-vfs-primary);
}

.ctc-vfs-radio-row input:checked ~ .ctc-vfs-radio-row-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ctc-vfs-primary);
    transform: translate(-50%, -50%);
}

.ctc-vfs-radio-row:has(input:checked),
.ctc-vfs-radio-row.is-selected {
    border-color: var(--ctc-vfs-primary);
    background: rgba(212, 101, 43, 0.05);
}

.ctc-vfs-form-field.has-error .ctc-vfs-radio-stack .ctc-vfs-radio-row {
    border-color: #c0392b;
}

/* File Upload field */
.ctc-vfs-file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ctc-vfs-file-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 18px;
    border: 2px dashed var(--ctc-vfs-border);
    border-radius: 12px;
    background: var(--ctc-vfs-bg-light);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ctc-vfs-file-dropzone:hover,
.ctc-vfs-file-dropzone:focus,
.ctc-vfs-file-dropzone.is-dragover {
    border-color: var(--ctc-vfs-primary);
    background: rgba(212, 101, 43, 0.05);
    outline: none;
}

.ctc-vfs-file-dropzone-icon {
    font-size: 28px;
    line-height: 1;
}

.ctc-vfs-file-dropzone-text strong {
    color: var(--ctc-vfs-primary);
    margin-right: 4px;
}

.ctc-vfs-file-dropzone-meta {
    font-size: 12px;
    color: #5A6474;
}

.ctc-vfs-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ctc-vfs-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctc-vfs-file-list:empty {
    display: none;
}

.ctc-vfs-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 10px;
}

.ctc-vfs-file-item.has-error {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.04);
}

.ctc-vfs-file-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ctc-vfs-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 18px;
    color: #5A6474;
}

.ctc-vfs-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ctc-vfs-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctc-vfs-file-name {
    font-size: 14px;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctc-vfs-file-meta {
    font-size: 12px;
    color: #5A6474;
}

.ctc-vfs-file-item.has-error .ctc-vfs-file-meta {
    color: #c0392b;
    font-weight: 600;
}

.ctc-vfs-file-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #5A6474;
    font-size: 22px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ctc-vfs-file-remove:hover {
    background: rgba(192, 57, 43, 0.1);
    color: #c0392b;
}

/* Silent CF7 submission — hide the native CF7 form UI and show a status banner */
.ctc-vfs-step-cf7-silent .wpcf7,
.ctc-vfs-step-cf7-silent .ctc-vfs-cf7-container > * {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

.ctc-vfs-submit-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 18px;
    font-size: 15px;
    color: #5A6474;
    background: var(--ctc-vfs-bg-light);
    border: 1px solid var(--ctc-vfs-border);
    border-radius: 12px;
    text-align: center;
}

.ctc-vfs-submit-status.is-error {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
    border-color: rgba(192, 57, 43, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .ctc-vfs-popup-container {
        width: 100%;
        max-width: 95%;
    }

    .ctc-vfs-mode-popup .ctc-vfs-form-inner {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .ctc-vfs-form-inner {
        padding: 20px 15px;
        min-width: 0;
        overflow-x: hidden;
    }

    .ctc-vfs-popup-container {
        max-width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .ctc-vfs-step-title {
        font-size: 20px;
    }

    .ctc-vfs-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ctc-vfs-tiles-layout-list {
        grid-template-columns: 1fr;
    }

    .ctc-vfs-tiles-layout-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ctc-vfs-tile-content {
        padding: 15px 8px;
    }

    .ctc-vfs-tile-title {
        font-size: 13px;
    }

    .ctc-vfs-tile-image {
        width: 60px;
        height: 60px;
    }

    .ctc-vfs-tile-icon {
        font-size: 36px;
    }

    .ctc-vfs-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .ctc-vfs-breadcrumb {
        font-size: 11px;
    }

    /* Chips responsive */
    .ctc-vfs-tiles-chips,
    .ctc-vfs-radio-chips {
        gap: 8px;
    }

    .ctc-vfs-tiles-chips .ctc-vfs-tile-content,
    .ctc-vfs-radio-chips .ctc-vfs-radio-item {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Summary responsive */
    .ctc-vfs-summary-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ctc-vfs-summary-value {
        margin-right: 0;
        width: 100%;
        order: 3;
    }

    .ctc-vfs-summary-edit {
        margin-left: auto;
    }

    /* Form Group responsive */
    .ctc-vfs-form-group {
        gap: 10px;
    }

    .ctc-vfs-form-field-half,
    .ctc-vfs-form-field-third {
        width: 100%;
        flex: 0 0 100%;
    }

    .ctc-vfs-chips-group {
        padding: 10px;
        gap: 8px;
    }

    .ctc-vfs-chips-group.ctc-vfs-chips-group-single {
        padding: 0;
    }

    .ctc-vfs-chip-label {
        padding: 6px 12px;
        font-size: 13px;
    }
}
