/* ============================================
   ROOF ESTIMATOR PRO - COMPLETE CSS
   Version: 1.2.0
   Author: Your Name
============================================ */

/* ============================================
   1. CSS RESET & BASE STYLES
============================================ */
.roof-estimator-wrapper,
.roof-estimator-wrapper *,
.roof-estimator-wrapper *::before,
.roof-estimator-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================
   2. MAIN CONTAINER STYLES
============================================ */
.roof-estimator-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
}

.roof-estimator-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    border: 1px solid #e9ecef;
}



/* ============================================
   3. HEADER SECTION - BLACK COLOR APPLIED
============================================ */
.roof-estimator-container h1 {
    color: #000000; /* Black color as requested */
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin: 40px 0 15px;
    line-height: 1.2;
    padding: 0 20px;
}

.roof-estimator-container .description {
    color: #64748b;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0 20px;
    font-weight: 400;
}

/* ============================================
   4. SEARCH BOX STYLES
============================================ */
.search-container {
    padding: 0 20px 30px;
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    align-items: center;
}

.search-box:focus-within {
    border-color: #F6CF69;
    box-shadow: 0 6px 25px rgba(246, 207, 105, 0.3);
    transform: translateY(-2px);
}

.location-icon {
    padding: 0 15px;
    font-size: 1.5rem;
    color: #4CAF50;
    display: flex;
    align-items: center;
}

.address-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 5px;
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    background: transparent;
    min-height: 50px;
}

.address-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-btn {
    background: #F6CF69; /* Yellow color as requested */
    color: #000000; /* Black text color */
    border: none;
    border-radius: 50px;
    padding: 15px 35px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-height: 50px;
}

.search-btn:hover:not(:disabled) {
    background: #000000; /* Black background on hover */
    color: #FFFFFF; /* White text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #94a3b8;
}

/* ============================================
   5. MAP CONTAINER STYLES
============================================ */
.map-container {
    margin: 0 20px 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-height: 400px;
}

#map {
    width: 100%;
    height: 400px;
    border: none;
}

.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    padding: 40px;
    text-align: center;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 12px;
}

.map-error h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.retry-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.retry-btn:hover {
    background: #43A047;
}

/* ============================================
   6. ROOF SELECTION STYLES
============================================ */
.roof-selection-container {
    background: #f8fafc;
    border-radius: 12px;
    margin: 0 20px 30px;
    padding: 30px;
    border: 1px solid #e2e8f0;
}

.roof-selection-container h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

.roof-option {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.roof-option h4 {
    color: #334155;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.slope-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.slope-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

.slope-option:hover {
    border-color: #F6CF69;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(246, 207, 105, 0.2);
}

.slope-option.active {
    border-color: #F6CF69;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    box-shadow: 0 5px 15px rgba(246, 207, 105, 0.2);
}

.slope-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.slope-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.slope-option:hover .slope-icon {
    transform: scale(1.1);
}

.slope-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.4;
}

.slope-option.active .slope-label {
    color: #d97706;
    font-weight: 600;
}
/* Active state for slope options */
.slope-option input[type="radio"]:checked + .slope-icon {
    color: #4CAF50;
    transform: scale(1.1);
}

.slope-option input[type="radio"]:checked ~ .slope-label {
    color: #0ea5e9;
    font-weight: 600;
}

.slope-option input[type="radio"]:checked ~ .slope-icon {
    color: #4CAF50;
}

.slope-option.active {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.15);
}

.slope-option.active .slope-label {
    color: #0ea5e9;
    font-weight: 600;
}

.slope-option.active .slope-icon {
    color: #4CAF50;
}
/* ============================================
   7. NAVIGATION BUTTONS
============================================ */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 0 20px 30px;
    padding: 0 10px;
}

.btn-edit, .btn-see-price {
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 180px;
}

.btn-edit {
    background: white;
    color: #64748b;
    border: 2px solid #cbd5e1;
}

.btn-edit:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.btn-see-price {
    background: #F6CF69; /* Yellow color as requested */
    color: #000000; /* Black text color */
    box-shadow: 0 4px 15px rgba(246, 207, 105, 0.25);
}

.btn-see-price:hover:not(:disabled) {
    background: #000000; /* Black background on hover */
    color: #FFFFFF; /* White text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-see-price:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   8. CONTACT FORM STYLES - REMOVED TOP BORDER
============================================ */
.contact-form-container {
    background: white;
    border-radius: 12px;
    margin: 0 20px 40px;
    padding: 40px;
    border: 1px solid #e2e8f0; /* Only this border remains, no top border */
    
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-form-container h3 {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.estimate-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.form-group label::after {
    content: ' *';
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: #F6CF69;
    box-shadow: 0 0 0 3px rgba(246, 207, 105, 0.1);
    background: #f8fafc;
}

.form-group input[readonly] {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

/* Roof Area specific */
#roof_area_form {
    font-weight: 600;
    color: #0f766e;
}

.field-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 6px;
    font-style: italic;
}

/* Span full width for specific elements */
.form-group:nth-child(5),
.form-group:nth-child(6),
.consent-section {
    grid-column: 1 / -1;
}

/* ============================================
   9. CONSENT CHECKBOXES
============================================ */
.consent-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
}

.consent-checkbox {
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 35px;
    min-height: 25px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: white;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #F6CF69;
    background-color: #fef9e7;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #F6CF69;
    border-color: #F6CF69;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid #000000; /* Black checkmark */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.consent-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    font-weight: 500;
}

/* ============================================
   10. SUBMIT BUTTON
============================================ */
.btn-submit {
    grid-column: 1 / -1;
    background: #F6CF69; /* Yellow color as requested */
    color: #000000; /* Black text color */
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(246, 207, 105, 0.25);
}

.btn-submit:hover:not(:disabled) {
    background: #000000; /* Black background on hover */
    color: #FFFFFF; /* White text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-submit:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   11. RESPONSE MESSAGES
============================================ */
.response-message {
    grid-column: 1 / -1;
    margin-top: 25px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.response-message .success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #a7f3d0;
    padding: 18px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}

.response-message .error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fecaca;
    padding: 18px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   12. LOADING STATES
============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1); /* Changed for black theme */
    border-radius: 50%;
    border-top-color: #000000; /* Black spinner */
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-btn.loading,
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.search-btn.loading::after,
.btn-submit.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1); /* Changed for black theme */
    border-radius: 50%;
    border-top-color: #000000; /* Black spinner */
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* ============================================
   13. RESPONSIVE DESIGN
============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .roof-estimator-wrapper {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .roof-estimator-container h1 {
        font-size: 2.2rem;
        margin: 30px 0 12px;
        padding: 0 15px;
    }
    
    .roof-estimator-container .description {
        font-size: 1rem;
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .search-container {
        padding: 0 15px 25px;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 15px;
        padding: 15px;
        gap: 12px;
    }
    
    .location-icon {
        padding: 0;
        justify-content: center;
        width: 100%;
    }
    
    .address-input {
        text-align: center;
        padding: 12px;
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
        padding: 14px;
        border-radius: 10px;
    }
    
    .map-container {
        margin: 0 15px 25px;
    }
    
    #map {
        height: 350px;
    }
    
    .roof-selection-container {
        margin: 0 15px 25px;
        padding: 25px 20px;
    }
    
    .roof-selection-container h3 {
        font-size: 1.3rem;
    }
    
    .slope-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navigation-buttons {
        margin: 0 15px 25px;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-edit, .btn-see-price {
        width: 100%;
        min-width: auto;
    }
    
    .contact-form-container {
        margin: 0 15px 30px;
        padding: 30px 20px;
    }
    
    .contact-form-container h3 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .estimate-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-group:nth-child(5),
    .form-group:nth-child(6),
    .consent-section {
        grid-column: 1;
    }
    
    .consent-section {
        padding: 20px;
    }
    
    .consent-text {
        font-size: 0.9rem;
    }
    
    .btn-submit {
        margin-top: 15px;
        padding: 16px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .roof-estimator-wrapper {
        margin: 10px auto;
        padding: 0 10px;
    }
    
    .roof-estimator-container h1 {
        font-size: 1.8rem;
        margin: 25px 0 10px;
        padding: 0 10px;
    }
    
    .roof-estimator-container .description {
        font-size: 0.95rem;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .search-container,
    .map-container,
    .roof-selection-container,
    .navigation-buttons,
    .contact-form-container {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .search-box {
        padding: 12px;
    }
    
    .search-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    #map {
        height: 300px;
    }
    
    .roof-selection-container {
        padding: 20px 15px;
    }
    
    .roof-selection-container h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .slope-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .slope-option {
        padding: 15px;
    }
    
    .slope-icon {
        font-size: 1.8rem;
    }
    
    .roof-option {
        padding: 20px 15px;
    }
    
    .contact-form-container {
        padding: 25px 15px;
    }
    
    .contact-form-container h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .estimate-form {
        gap: 15px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .consent-section {
        padding: 15px;
    }
    
    .consent-checkbox {
        margin-bottom: 15px;
    }
    
    .checkmark {
        height: 22px;
        width: 22px;
    }
    
    .consent-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .btn-submit {
        padding: 14px;
        font-size: 1rem;
    }
    
    .response-message .success,
    .response-message .error {
        padding: 15px;
        font-size: 0.95rem;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    .roof-estimator-container h1 {
        font-size: 1.6rem;
    }
    
    .roof-estimator-container .description {
        font-size: 0.9rem;
    }
    
    .search-btn,
    .btn-edit,
    .btn-see-price,
    .btn-submit {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    #map {
        height: 250px;
    }
    
    .slope-label {
        font-size: 0.9rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
}

/* ============================================
   14. PRINT STYLES
============================================ */
@media print {
    .roof-estimator-wrapper {
        margin: 0;
        padding: 0;
        max-width: 100%;
        box-shadow: none;
    }
    
    .roof-estimator-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .search-box,
    .navigation-buttons,
    .btn-see-price,
    .btn-edit,
    .search-btn {
        display: none;
    }
    
    .contact-form-container {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .response-message {
        page-break-inside: avoid;
    }
}

/* ============================================
   15. ACCESSIBILITY & UTILITIES
============================================ */

/* Focus styles for accessibility */
.roof-estimator-wrapper :focus {
    outline: 2px solid #F6CF69;
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: 10px;
    background: #F6CF69;
    color: #000000;
    z-index: 10000;
    clip: auto;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .roof-estimator-container {
        border: 2px solid #000;
    }
    
    .search-box {
        border: 2px solid #000;
    }
    
    .form-group input {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .roof-estimator-container,
    .search-box,
    .slope-option,
    .btn-edit,
    .btn-see-price,
    .btn-submit,
    .contact-form-container,
    .response-message {
        animation: none;
        transition: none;
    }
    
    .slope-option:hover {
        transform: none;
    }
}
/* Address input field focus styles remove completely */
.address-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.address-input {
    border: none !important;
}