/**
 * WP Checklist Form - Frontend Styles
 */

/* ===== Wrapper ===== */
.wpcf-checklist-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
}

/* ===== Description ===== */
.wpcf-checklist-description {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--wpcf-primary, #0073aa);
}

/* ===== Progress Bar ===== */
.wpcf-progress-bar {
    background: #e9ecef;
    border-radius: 20px;
    height: 8px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.wpcf-progress-fill {
    background: var(--wpcf-primary, #0073aa);
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s ease;
    min-width: 0;
}

.wpcf-progress-text {
    position: absolute;
    right: 0;
    top: -22px;
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

/* ===== Steps ===== */
.wpcf-step {
    display: none;
}

.wpcf-step-active {
    display: block;
    animation: wpcf-fadeIn 0.3s ease;
}

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

.wpcf-step-title {
    color: #333;
    font-size: 20px;
    margin: 0 0 25px;
    text-align: center;
}

/* ===== Questions ===== */
.wpcf-question {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.wpcf-question:hover {
    border-color: var(--wpcf-primary, #0073aa);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wpcf-question.wpcf-question-hidden {
    display: none;
}

.wpcf-question.wpcf-question-error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.wpcf-question-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.wpcf-required-marker {
    color: #e74c3c;
    font-weight: 700;
}

.wpcf-question-description {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    line-height: 1.4;
}

.wpcf-question-input {
    margin-top: 10px;
}

.wpcf-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* ===== Radio & Checkbox Options ===== */
.wpcf-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    gap: 10px;
}

.wpcf-option:hover {
    border-color: var(--wpcf-primary, #0073aa);
    background: rgba(0, 115, 170, 0.03);
}

.wpcf-option input[type="radio"],
.wpcf-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wpcf-option-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wpcf-option-checkbox .wpcf-option-checkmark {
    border-radius: 4px;
}

.wpcf-option input:checked ~ .wpcf-option-checkmark {
    border-color: var(--wpcf-primary, #0073aa);
    background: var(--wpcf-primary, #0073aa);
}

.wpcf-option input:checked ~ .wpcf-option-checkmark::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.wpcf-option-checkbox input:checked ~ .wpcf-option-checkmark::after {
    content: '\2713';
    width: auto;
    height: auto;
    background: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 0;
}

.wpcf-option input:checked ~ .wpcf-option-label {
    color: var(--wpcf-primary, #0073aa);
    font-weight: 600;
}

.wpcf-option:has(input:checked) {
    border-color: var(--wpcf-primary, #0073aa);
    background: rgba(0, 115, 170, 0.05);
}

.wpcf-option-label {
    font-size: 14px;
    color: #444;
    line-height: 1.3;
}

/* ===== Select ===== */
.wpcf-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.wpcf-select:focus {
    outline: none;
    border-color: var(--wpcf-primary, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* ===== Text Input & Textarea ===== */
.wpcf-text-input,
.wpcf-number-input,
.wpcf-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.wpcf-text-input:focus,
.wpcf-number-input:focus,
.wpcf-textarea:focus {
    outline: none;
    border-color: var(--wpcf-primary, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

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

.wpcf-number-input {
    max-width: 200px;
}

/* ===== Contact Fields ===== */
.wpcf-contact-field {
    margin-bottom: 20px;
}

.wpcf-contact-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.wpcf-contact-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.wpcf-contact-field input:focus {
    outline: none;
    border-color: var(--wpcf-primary, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.wpcf-contact-field input.wpcf-input-error {
    border-color: #e74c3c;
}

/* ===== Contact Request ===== */
.wpcf-contact-request {
    margin: 15px 0;
    padding: 12px 15px;
    background: #eaf7ed;
    border-radius: 8px;
    border-left: 3px solid #27ae60;
}

.wpcf-contact-request label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.wpcf-contact-request input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.wpcf-privacy-notice {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
}

.wpcf-privacy-notice label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wpcf-privacy-notice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== Navigation Buttons ===== */
.wpcf-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.wpcf-btn {
    padding: 12px 30px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    color: #555;
}

.wpcf-btn:hover {
    border-color: #ccc;
    background: #f8f9fa;
}

.wpcf-btn-primary {
    background: var(--wpcf-primary, #0073aa);
    color: #fff;
    border-color: var(--wpcf-primary, #0073aa);
}

.wpcf-btn-primary:hover {
    filter: brightness(1.1);
    background: var(--wpcf-primary, #0073aa);
}

.wpcf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Result Display ===== */
.wpcf-result-display {
    animation: wpcf-fadeIn 0.5s ease;
}

.wpcf-result-card {
    text-align: center;
    padding: 40px 30px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.wpcf-result-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.wpcf-result-icon.wpcf-color-green { background: #d4edda; color: #27ae60; }
.wpcf-result-icon.wpcf-color-orange { background: #fff3cd; color: #f39c12; }
.wpcf-result-icon.wpcf-color-red { background: #f8d7da; color: #e74c3c; }
.wpcf-result-icon.wpcf-color-blue { background: #d1ecf1; color: #3498db; }

.wpcf-result-title {
    font-size: 24px;
    color: #333;
    margin: 0 0 15px;
}

.wpcf-result-text {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.wpcf-result-details {
    margin: 20px 0;
    text-align: left;
}

.wpcf-result-details table {
    width: 100%;
    border-collapse: collapse;
}

.wpcf-result-details th,
.wpcf-result-details td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    text-align: left;
}

.wpcf-result-details th {
    font-weight: 600;
    color: #333;
}

/* ===== Completion Message ===== */
.wpcf-completion-message {
    text-align: center;
    padding: 35px 30px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    line-height: 1.6;
    color: #333;
}

.wpcf-completion-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.wpcf-completion-icon-green { background: #d4edda; color: #27ae60; }
.wpcf-completion-icon-blue { background: #d1ecf1; color: #3498db; }
.wpcf-completion-icon-orange { background: #fff3cd; color: #f39c12; }
.wpcf-completion-icon-primary { background: rgba(0,115,170,0.1); color: var(--wpcf-primary, #0073aa); }

.wpcf-completion-message.wpcf-completion-green { border-left: 4px solid #27ae60; }
.wpcf-completion-message.wpcf-completion-blue { border-left: 4px solid #3498db; }
.wpcf-completion-message.wpcf-completion-orange { border-left: 4px solid #f39c12; }
.wpcf-completion-message.wpcf-completion-primary { border-left: 4px solid var(--wpcf-primary, #0073aa); }

.wpcf-completion-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}

.wpcf-completion-text {
    font-size: 15px;
    color: #555;
    margin: 0;
    line-height: 1.6;
}

.wpcf-result-email-notice {
    font-size: 13px;
    color: #888;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ===== Loading ===== */
.wpcf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.wpcf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e5e9;
    border-top-color: var(--wpcf-primary, #0073aa);
    border-radius: 50%;
    animation: wpcf-spin 0.8s linear infinite;
}

@keyframes wpcf-spin {
    to { transform: rotate(360deg); }
}

.wpcf-loading p {
    margin-top: 15px;
    color: #555;
    font-size: 14px;
}

/* ===== Error State ===== */
.wpcf-error {
    padding: 15px 20px;
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .wpcf-checklist-wrapper {
        padding: 0 10px;
    }

    .wpcf-question {
        padding: 15px;
    }

    .wpcf-option {
        padding: 10px 12px;
    }

    .wpcf-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .wpcf-btn {
        width: 100%;
        text-align: center;
    }

    .wpcf-result-card {
        padding: 25px 20px;
    }
}

/* Question counter for single-question mode */
.wpcf-question-counter {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
    font-weight: 500;
}
