/* Roofing Calculator Plugin Styles - Optimized for Conversion */
.roofing-calculator {
    max-width: 600px; /* Reduced for better focus */
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px; /* Reduced for modern look */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Softer shadow */
    border: 2px solid #374151; /* Darker border for better definition */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* System fonts for performance */
}

/* Title and description optimized for hierarchy */
.roofing-calculator__title {
    color: #111827 !important; /* Even darker for maximum contrast */
    font-weight: 800; /* Bolder for more impact */
    line-height: 1.1; /* Tighter line height for titles */
    margin-bottom: 12px;
    font-size: 2.2em; /* Larger for more impact */
    letter-spacing: -0.025em; /* Slightly tighter letter spacing */
}

.roofing-calculator__description {
    color: #4b5563 !important; /* Better contrast gray */
    line-height: 1.6;
    margin-bottom: 28px;
    font-size: 1.1em; /* Slightly larger for better readability */
}

.roofing-calculator__title {
    font-size: 2.2em; /* Larger for more impact */
    margin-bottom: 0.8em;
    text-align: center;
    font-weight: 800; /* Bolder for more impact */
    letter-spacing: -0.025em; /* Refined letter spacing */
}

.roofing-calculator__description {
    text-align: center;
    margin-bottom: 2em;
    line-height: 1.6;
    font-size: 1.1em; /* Larger for better readability */
}

.roofing-calculator__step {
    display: none;
    padding: 24px;
    background: #fafbfc; /* Lighter background for better contrast */
    border-radius: 8px; /* Reduced for modern look */
    margin-bottom: 20px;
    border: 1px solid #d1d5db; /* Darker border to match main container */
}

.roofing-calculator__step.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.roofing-calculator__label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a !important; /* Darker for better contrast */
    font-weight: 600;
    font-size: 0.95em; /* Slightly smaller for hierarchy */
    letter-spacing: -0.2px;
    line-height: 1.4;
}

.roofing-calculator__input {
    width: 100%;
    padding: 14px 16px; /* Increased padding for better touch targets */
    border: 2px solid #d1d5db; /* Better contrast border */
    border-radius: 6px; /* Reduced for modern look */
    margin-bottom: 20px;
    background: #ffffff;
    transition: all 0.2s ease; /* Faster transition for responsiveness */
    font-size: 16px; /* Minimum 16px for mobile accessibility */
    color: #1a1a1a;
    box-sizing: border-box;
    line-height: 1.5;
}

.roofing-calculator__input::placeholder {
    color: #aaa;
}

.roofing-calculator__input:focus {
    outline: none;
    border-color: #C8B16B;
    box-shadow: 0 0 0 3px rgba(200, 177, 107, 0.15); /* Increased opacity for better visibility */
    background: #ffffff;
    transform: translateY(-1px); /* Subtle lift effect */
}

.roofing-calculator__radio-group {
    display: flex;
    gap: 12px; /* Increased gap for better separation */
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.roofing-calculator__radio-label {
    flex: 1;
    min-width: 140px;
    position: relative;
    padding: 14px 16px; /* Increased padding for better touch targets */
    background: #ffffff;
    border-radius: 6px; /* Reduced for modern look */
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a1a;
    font-size: 15px; /* Better readability */
    font-weight: 500;
    line-height: 1.4;
}

.roofing-calculator__radio-label span {
    color: #333 !important;
}

.roofing-calculator__radio-input {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; /* Slightly smaller for better proportion */
    height: 18px;
    border: 2px solid #cbd5e1; /* Better contrast */
    border-radius: 50%;
    outline: none;
    margin: 0;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    background-color: white;
    flex-shrink: 0; /* Prevent shrinking */
}

.roofing-calculator__radio-input:checked {
    border-color: #C8B16B;
    background: #C8B16B;
}

.roofing-calculator__radio-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; /* Slightly smaller for better proportion */
    height: 6px;
    background: white;
    border-radius: 50%;
}

.roofing-calculator__radio-label:hover {
    background: #f8fafc; /* Lighter hover state */
    border-color: #C8B16B;
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 2px 8px rgba(200, 177, 107, 0.1); /* Subtle shadow */
}

.roofing-calculator__radio-label:hover span {
    color: #1a1a1a !important;
}

.roofing-calculator__button-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.roofing-calculator__back {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 10px;
    font-size: 0.95em;
}

.roofing-calculator__back:hover {
    background: #f8f9fa;
    color: #333;
}

.roofing-calculator__button {
    flex: 1;
    padding: 16px 20px; /* Increased padding for better touch targets */
    background: #C8B16B;
    color: white !important;
    border: none;
    border-radius: 6px; /* Reduced for modern look */
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 16px; /* Minimum 16px for mobile accessibility */
    line-height: 1.4;
    text-align: center;
    min-height: 48px; /* Minimum touch target size */
}

.roofing-calculator__button:hover {
    background: #B8A15B;
    transform: translateY(-2px); /* More pronounced lift */
    box-shadow: 0 6px 20px rgba(200, 177, 107, 0.25); /* Stronger shadow for better feedback */
}

.roofing-calculator__button:active {
    transform: translateY(0); /* Press effect */
    box-shadow: 0 2px 8px rgba(200, 177, 107, 0.2);
}

.roofing-calculator__error {
    color: #ff6b6b !important;
    margin-top: 8px;
    display: none;
    font-size: 0.95em;
    background: rgba(255, 107, 107, 0.35);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.1);
}

.roofing-calculator__estimate {
    text-align: center;
    font-size: 1.8em; /* Larger for impact */
    color: #C8B16B;
    margin: 24px 0;
    padding: 24px;
    background: #fefefe; /* Subtle background */
    border-radius: 8px;
    display: none;
    font-weight: 700;
    letter-spacing: -0.5px;
    border: 2px solid #C8B16B; /* Border for emphasis */
    box-shadow: 0 4px 16px rgba(200, 177, 107, 0.15);
    line-height: 1.2;
}

.roofing-calculator__estimate.visible {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.roofing-calculator__cta-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-direction: column;
    align-items: center;
}

.roofing-calculator__contact {
    display: none;
    text-align: center;
    text-decoration: none !important;
    background: #C8B16B;
    color: white !important;
    margin-top: 10px;
    font-weight: 600;
    padding: 12px 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
    letter-spacing: -0.3px;
    width: 100%;
    max-width: 350px;
    font-size: 0.95em;
}

.roofing-calculator__contact.visible {
    display: inline-block;
}

.roofing-calculator__contact:hover {
    text-decoration: none !important;
    background: #B8A15B;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(200, 177, 107, 0.15);
}

.roofing-calculator__reset {
    display: none;
    text-decoration: none;
    color: #333;
    padding: 12px 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    font-size: 0.95em;
}

.roofing-calculator__reset.visible {
    display: inline-block;
}

.roofing-calculator__reset:hover {
    background: #f8f9fa;
    color: #333;
    transform: scale(1.05);
    border-color: #C8B16B;
}

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

/* Tooltips */
.roofing-calculator__radio-label[data-tooltip] {
    position: relative;
}

.roofing-calculator__radio-label[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
}

/* Progress Indicator */
.roofing-calculator__progress {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 6px;
}

.progress-step {
    width: 12px; /* Slightly larger for better visibility */
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb; /* Better contrast */
    transition: all 0.2s ease;
    transform: scale(1);
    border: 2px solid transparent; /* Space for active state */
}

.progress-step.active {
    background: #C8B16B;
    transform: scale(1.1); /* Reduced scale for subtlety */
    border-color: #C8B16B;
    box-shadow: 0 0 0 2px rgba(200, 177, 107, 0.2); /* Subtle glow */
}

.progress-step.active::after { 
    content: none; 
}

/* Helper Text */
.roofing-calculator__helper {
    color: #6b7280 !important; /* Better contrast gray */
    font-size: 14px; /* Slightly larger for readability */
    margin-top: -8px;
    margin-bottom: 16px;
    font-style: normal; /* Remove italic for better readability */
    line-height: 1.4;
}

/* Hide elements specific to certain roof types */
.roofing-calculator__pitch-options,
.roofing-calculator__metal-options,
.roofing-calculator__shingle-options,
.roofing-calculator__flat-options {
    display: none;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .roofing-calculator {
        padding: 20px;
        margin: 15px;
    }
    
    .roofing-calculator__title {
        font-size: 1.6em;
    }
    
    .roofing-calculator__description {
        font-size: 0.9em;
        margin-bottom: 1.2em;
    }
    
    .roofing-calculator__step {
        padding: 15px;
    }
    
    .roofing-calculator__radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .roofing-calculator__radio-label {
        min-width: unset;
        width: 100%;
    }
    
    .roofing-calculator__button-container {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .roofing-calculator__button,
    .roofing-calculator__back {
        width: 100%;
        margin: 0;
        padding: 14px 20px;
    }
    
    .roofing-calculator__estimate {
        font-size: 1.4em;
        padding: 15px;
    }
    
    .roofing-calculator__contact,
    .roofing-calculator__reset {
        max-width: none;
        width: 90%;
    }
}