/*
 * Public-facing styles for the Instant Quote plugin
 */

/* Prevent input overflow */
.instant-quote-form, .instant-quote-form * {
    box-sizing: border-box;
}

.instant-quote-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
}

/* Step Styling */
.form-step {
    transition: all 0.3s ease;
}

.step-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.step-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1em;
}

.instant-quote-form .form-group {
    margin-bottom: 20px;
}

.instant-quote-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 1em;
    color: black;
}

.instant-quote-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1em;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    border: 1px solid #ddd;
    max-width: 100%;
}

.instant-quote-form .form-control:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px #cce6f6;
    background: #fff;
}

/* Field Description */
.instant-quote-form .field-description {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 5px;
    font-style: italic;
}

/* Select Dropdown */
.instant-quote-form select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fafbfc;
    border-radius: 8px;
    padding-right: 40px;
    font-size: 1em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 18px 14px;
}

/* Radio Buttons */
.instant-quote-form .radio-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instant-quote-form .radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.instant-quote-form .radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex: 0 1 calc(33.333% - 12px);
    box-sizing: border-box;
    min-width: 0;
}

.instant-quote-form .radio-option:hover {
    background: #f0f7fa;
    border-color: #0073aa;
}

.instant-quote-form .radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fafbfc;
    border: 2px solid #bbb;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    margin-right: 12px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.instant-quote-form .radio-option input[type="radio"]:checked {
    border-color: #0073aa;
    background-color: #fff;
}

.instant-quote-form .radio-option input[type="radio"]:checked:after {
    content: '';
    display: block;
    position: absolute;
    left: 6px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0073aa;
}

.instant-quote-form .radio-label {
    font-weight: normal;
    cursor: pointer;
}

/* Checkboxes */
.instant-quote-form .checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instant-quote-form .checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.instant-quote-form .checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex: 0 1 calc(33.333% - 12px);
    box-sizing: border-box;
    min-width: 0;
}

.instant-quote-form .checkbox-option:hover {
    background: #f0f7fa;
    border-color: #0073aa;
}

.instant-quote-form .checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fafbfc;
    border: 2px solid #bbb;
    border-radius: 6px;
    width: 22px;
    height: 22px;
    margin-right: 12px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.instant-quote-form .checkbox-option input[type="checkbox"]:checked {
    background-color: #0073aa;
    border-color: #0073aa;
}

.instant-quote-form .checkbox-option input[type="checkbox"]:checked:after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.instant-quote-form .checkbox-option input[type="checkbox"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px #cce6f6;
}

.instant-quote-form .checkbox-label {
    font-weight: normal;
    cursor: pointer;
}

/* Required Field Indicator */
.instant-quote-form .required {
    color: #dc3232;
    font-weight: bold;
}

/* Button Styling */
.instant-quote-form .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 48px;
}

.instant-quote-form .button-primary {
    background: #0073aa;
    color: #fff;
}

.instant-quote-form .button-primary:hover {
    background: #005177;
}

.instant-quote-form .button-secondary {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.instant-quote-form .button-secondary:hover {
    background: #e1e1e1;
}

.instant-quote-form .button-large {
    font-size: 1.125em;
    padding: 16px 32px;
    min-height: 56px;
}

.instant-quote-form .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.instant-quote-form .button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
}

.instant-quote-form .button.disabled:hover {
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
}

/* Loading States */
.instant-quote-form .button-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.instant-quote-form .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Quote Summary Styling */
.quote-summary {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.quote-total {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid #4caf50;
    border-radius: 8px;
    background: #e8f5e8;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.quote-total h4 {
    font-size: 1.125em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.total-amount {
    font-size: 2.25em;
    font-weight: bold;
    color: #4caf50;
}

.quote-breakdown {
    margin-bottom: 30px;
}

.quote-breakdown h4 {
    font-size: 1.125em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.breakdown-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.item-label {
    font-weight: 500;
    color: #333;
}

.item-price {
    font-weight: 600;
    color: #0073aa;
}

.quote-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.quote-actions .button {
    flex: 1;
    min-width: 200px;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.instant-quote-form .error {
    color: #dc3232;
    font-size: 0.8125em;
    margin-top: 5px;
    display: none;
}

.instant-quote-form .has-error .form-control {
    border-color: #dc3232;
}

.instant-quote-form .has-error .error {
    display: block;
}

.instant-quote-form .success-message,
.instant-quote-form .error-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.instant-quote-form .success-message {
    background-color: #ecf7ed;
    color: #2d9a47;
    border: 1px solid #d8c0c0;
}

.instant-quote-form .error-message {
    background-color: #fdf0f0;
    color: #dc3232;
    border: 1px solid #f8d7da;
}

/* Error styling for form not found */
.instant-quote-error {
    background-color: #fdf0f0;
    color: #dc3232;
    border: 1px solid #f8d7da;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .instant-quote-form {
        padding: 15px;
    }
    
    .quote-summary {
        padding: 20px;
    }
    
    .total-amount {
        font-size: 28px;
    }
    
    .quote-actions {
        flex-direction: column;
    }
    
    .quote-actions .button {
        min-width: 100%;
    }
    
    /* Mobile-specific breakdown styling */
    .quote-breakdown-section .breakdown-label {
        font-size: 0.875em;
        line-height: 1.3;
    }
    
    .quote-breakdown-section .breakdown-amount {
        font-size: 0.875em;
        line-height: 1.3;
    }
    
    .quote-breakdown-section .field-breakdown-item {
        font-size: 0.75em;
        padding: 8px 0;
    }
    
    .quote-breakdown-section .field-breakdown-label {
        font-size: 0.75em;
        line-height: 1.2;
    }
    
    .quote-breakdown-section .field-breakdown-value,
    .quote-breakdown-section .field-breakdown-price {
        font-size: 0.75em;
        margin-left: 5px;
    }
    
    .quote-breakdown-section .breakdown-item {
        padding: 10px 0;
    }
    
    .quote-breakdown-section .breakdown-total .breakdown-label {
        font-size: 1.125em;
    }
    
    .quote-breakdown-section .breakdown-total .breakdown-amount {
        font-size: 0.875em;
    }
}

/* Extra small screen styling for screens up to 390px */
@media (max-width: 390px) {
    .quote-breakdown-section .breakdown-amount { 
        font-size: 18px !important; 
    }
    
    .quote-breakdown-section .breakdown-label { 
        font-size: 16px !important; 
    }
    
    .quote-breakdown-section .breakdown-item .breakdown-label, 
    .quote-breakdown-section .breakdown-item .breakdown-amount { 
        flex-shrink: 1 !important; 
    }
    
    .quote-breakdown-section .breakdown-total .breakdown-label { 
        font-size: 15px !important;  
    }
    
    .quote-breakdown-section .breakdown-total .breakdown-amount { 
        font-size: 18px !important; 
    }
}

/* Form Title and Description */
.instant-quote-form .form-title {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 1.75em;
    font-weight: 600;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 15px;
}

.instant-quote-form .form-description {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 5px;
    font-size: 1em;
    line-height: 1.6;
    color: #555;
    text-align: center;
}

/* Form Container */
.instant-quote-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Larger textarea */
.instant-quote-form textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

@media (max-width: 600px) {
    .instant-quote-form .checkbox-option {
        flex: 0 1 calc(50% - 8px);
    }
    
    .instant-quote-form .radio-option {
        flex: 0 1 calc(50% - 8px);
    }
    
    /* Extra small screen breakdown styling */
    .quote-breakdown-section .breakdown-label {
        font-size: 0.8125em;
    }
    
    .quote-breakdown-section .breakdown-amount {
        font-size: 0.8125em;
    }
    
    .quote-breakdown-section .field-breakdown-item {
        font-size: 0.6875em;
    }
    
    .quote-breakdown-section .field-breakdown-label {
        font-size: 0.6875em;
    }
    
    .quote-breakdown-section .field-breakdown-value,
    .quote-breakdown-section .field-breakdown-price {
        font-size: 0.6875em;
    }
}

/* New styling for recurrence title and price description */
.recurrence-title {
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.price-description {
    font-size: 0.875em;
    color: #666;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
    line-height: 1.4;
    padding: 0 20px;
}

/* First-time discount styling */
.first-time-discount {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.first-time-discount p {
    margin: 5px 0;
    font-size: 0.875em;
    color: #2e7d32;
}

.first-time-discount p:first-child {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.first-time-discount p:last-child {
    font-size: 1em;
    font-weight: 600;
    margin-top: 10px;
    color: #1b5e20;
}





/* Divider Styles */
.iq-divider.divider-thin {
    border: none;
    border-top: 1px solid #bbb;
    margin: 16px 0;
}

.iq-divider.divider-dashed {
    border: none;
    border-top: 2px dashed #bbb;
    margin: 16px 0;
}

.iq-divider.divider-thick {
    border: none;
    border-top: 4px solid #333;
    margin: 16px 0;
}

/* Quote Breakdown Section */
.quote-breakdown-section {
    margin-top: 20px;
    margin-bottom: 20px;
}

.quote-breakdown-section .quote-breakdown {
    margin-bottom: 0;
    padding: 20px;
    border: 2px solid #0073aa;
    border-radius: 8px;
    background: #f2f5fb;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.quote-breakdown-section .breakdown-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.125em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.quote-breakdown-section .breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quote-breakdown-section .breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.quote-breakdown-section .breakdown-item:last-child {
    border-bottom: none;
}

.quote-breakdown-section .breakdown-item .breakdown-label,
.quote-breakdown-section .breakdown-item .breakdown-amount {
    flex-shrink: 0;
}

.quote-breakdown-section .breakdown-item .field-breakdown-section {
    width: 100%;
    flex-basis: 100%;
    margin-top: 10px;
}

.quote-breakdown-section .breakdown-label {
    font-weight: 500;
    color: #495057;
    font-size: 1em;
    line-height: 1.4;
}

.quote-breakdown-section .breakdown-amount {
    font-weight: 600;
    color: #333;
    font-size: 1em;
    line-height: 1.4;
}

.quote-breakdown-section .breakdown-description {
    font-size: 0.875em;
    color: #6c757d;
    width: 100%;
    display: block;
}

.quote-breakdown-section .breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1em;
    color: #333;
    padding: 12px 0;
    border-top: 2px solid #e9ecef;
    margin-top: 8px;
}

.quote-breakdown-section .breakdown-total .breakdown-label {
    font-weight: 700;
    font-size: 1.25em;
    color: #333;
    line-height: 1.3;
}

.quote-breakdown-section .breakdown-total .breakdown-amount {
    font-weight: 700;
    font-size: 1.125em;
    color: #0073aa;
    line-height: 1.3;
}

/* Field Breakdown Styling */
.quote-breakdown-section .field-breakdown-section {
    margin-top: 10px;
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 2px solid #e9ecef;
}

.quote-breakdown-section .field-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.quote-breakdown-section .field-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.8125em;
    border-bottom: 1px solid #f8f9fa;
    gap: 8px;
    flex-wrap: wrap;
}

.quote-breakdown-section .field-breakdown-item:last-child {
    border-bottom: none;
}

.quote-breakdown-section .field-breakdown-label {
    font-weight: 500;
    color: #6c757d;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
    font-size: 0.8125em;
}

.quote-breakdown-section .field-breakdown-value {
    font-weight: 600;
    color: #495057;
    text-align: right;
    margin-left: 10px;
    flex-shrink: 0;
    font-size: 0.8125em;
}

.quote-breakdown-section .field-breakdown-price {
    font-weight: 600;
    color: #0073aa;
    text-align: right;
    margin-left: 10px;
    min-width: 60px;
    flex-shrink: 0;
    font-size: 0.8125em;
}
