/* General Styles */
body {
    display: block;
    width: auto;
    padding: 50px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    line-height: 1.7;
    color: #4a5464;
}

/* Container Styles */
.container {
    max-width: 700px;
    width: 100%;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 20px auto;
    color: #333;
}

.order-container {
    max-width: 960px; /* Much wider than standard 700px container */
    width: 100%;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 20px auto;
    color: #333;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    color: #333;
}

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h3 {
    font-size: 1.17em;
    margin: 1em 0;
}

h4 {
    font-size: 1em;
    margin: 1.33em 0;
}

h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
}

h6 {
    font-size: 0.67em;
    margin: 2.33em 0;
}

/* Logo Styling */
.logo-container {
    text-align: center;
    margin: 10px;
}

.logo-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-container a {
    display: inline-block;
    text-decoration: none;
}

.logo-container a:hover {
    opacity: 0.9;
}

/* Form Heading Styles */
.form-container h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.form-subtitle {
    text-align: center;
    color: #57647e;
    font-size: 1.1em;
    line-height: 1.6;
    padding: 0 20px;
    font-weight: 500;
    word-break: break-word;
}

.services-subtitle {
    color: #57647e;
    font-size: 1em;
    margin: 10px 0 20px;
    text-align: center;
    font-style: italic;
}

.form-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e7f2;
}

/* Form Group Styling */
.form-group {
    padding: 10px;
    border-radius: 5px;
    background-color: #fff;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #444;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}

.form-group input::placeholder {
    color: #666;
    opacity: 1; /* Firefox */
}

.form-group input:focus::placeholder {
    opacity: 0.5;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2e69ff;
    outline: none;
}

.name-fields {
    display: flex;
    gap: 10px;
}

.name-fields input {
    flex: 1;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Button Styling - Consolidated */
button,
.btn-next,
.index-btn-next,
.btn-back,
#addProjectButton,
.removeProjectButton {
    display: inline-block;
    padding: 10px 30px;
    background-color: #2e69ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    transition: background-color 0.3s ease;
    height: 3em;
    min-width: 128px;
}

button:hover,
.btn-next:hover,
.index-btn-next:hover,
.btn-back:hover {
    background-color: #0056b3;
}

.btn-back {
    background-color: #ccc;
    color: #333;
}

.btn-back:hover {
    background-color: #999;
}

/* Special Buttons */
#addProjectButton {
    background-color: #4CAF50;
}

#addProjectButton:hover {
    background-color: #367C39;
}

.removeProjectButton {
    background-color: #f44336;
}

.removeProjectButton:hover {
    background-color: #d32f2f;
}

/* Checkout Button Styling - Consolidated */
.btn-checkout {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    display: block;
    width: 100%;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.btn-checkout:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-checkout:not(:disabled) {
    background-color: #28a745;
    cursor: pointer;
}

.btn-checkout:not(:disabled):hover {
    background-color: #218838;
}

/* Error Messages */
.error-message {
    color: #ff0000;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.required {
    color: #ff0000;
}

.required-highlight {
    border: 2px solid red !important;
    background-color: #fff3f3;
}

/* Project Section */
.project-section {
    border: 1px solid #ddd;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    background-color: #fff;
    position: relative;
}

.project-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
    color: #333;
    text-align: center;
    border-bottom: 3px solid #007BFF;
    padding-bottom: 10px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 calc(33% - 10px);
    background-color: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s ease, border 0.3s ease;
    min-width: 150px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.checkbox-group label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #007BFF;
    border-radius: 4px;
    background-color: white;
    position: relative;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"]:checked::before {
    content: "✔";
    font-size: 14px;
    font-weight: bold;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group input[type="checkbox"]:checked {
    background-color: #007BFF;
    border-color: #0056b3;
}

.checkbox-group input[type="checkbox"]:disabled + span {
    color: #999;
}

.checkbox-group label:hover {
    background-color: #f0f0f0;
    border-color: #007BFF;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

/* Total Cost Display */
.total-cost-display {
    font-size: 1.2em;
    font-weight: bold;
    color: #007BFF;
    padding: 12px;
    background-color: #f0f8ff;
    border: 1px solid #007BFF;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
}

/* Form Cover */
.form-cover-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.form-page-cover-image-wrapper {
    width: 100%;
    text-align: center;
}

.form-page-cover-image {
    max-width: 100%;
    height: auto;
}

.form-page-cover-image-align-center {
    align-items: center;
}

/* Form Group Headers */
.checkbox-form-group h4 {
    color: #333;
    margin: 20px 0 10px;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.checkbox-form-group h4:first-of-type {
    margin-top: 10px;
}

.checkbox-form-group h2 {
    color: #333;
    font-size: 1.3em;
    border-bottom: 1px solid #e5e7f2;
}

/* Summary Section Styling */
.summary-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #e1e1e8;
}

.summary-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 10px;
}

.property-details {
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    padding-bottom: 15px;
}

.property-details ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.property-details li {
    margin: 5px 0;
    color: #666;
}

.services-details {
    margin-top: 20px;
}

services-details p {
    margin-bottom: 10px;
    font-weight: 500;
}

#selectedServices {
    color: #666;
    font-style: italic;
}

#selectedServices ul {
    margin: 10px 0;
}

#selectedServices li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

#selectedServices li:last-child {
    border-bottom: none;
}

#totalPrice {
    font-weight: bold;
    color: #007BFF;
    font-size: 1.2em;
}

/* Total Price Section */
.total-price {
    margin-top: 15px;
    padding: 10px;
    border-top: 2px solid #ddd;
    font-size: 1.2em;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.total-price strong {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Accessibility Section */
.accessibility-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #666;
    font-size: 0.9em;
}

.accessibility-info p {
    margin: 5px 0;
}

.badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 5px 20px;
    background: rgba(229, 231, 242, .25);
    margin-top: 20px;
}

.accessibility-badge-wrapper {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.accessibility-badge-wrapper:hover {
    background-color: #e9ecef;
}

.a11y-content {
    margin-left: 10px;
    text-align: left;
}

.a11y-title {
    color: #007bff;
    font-weight: bold;
    font-size: 0.9em;
}

.a11y-subtitle {
    color: #6c757d;
    font-size: 0.8em;
}

/* Order Summary Styling */
#orderSummaryList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#orderSummaryList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #333;
}

#orderSummaryList li:last-child {
    border-bottom: none;
}

.service-name {
    flex: 1;
}

.service-price {
    min-width: 80px;
    text-align: right;
}

/* Status Messages */
.status-message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f4f4f4;
}

#pricingTableBody td[rowspan] {
    border-right: 2px solid #ddd;
    font-weight: 500;
}

#pricingTable td {
    vertical-align: middle;
}

#pricingTable {
    position: relative;
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}

#pricingTable thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#pricingTable th {
    background-color: #f4f4f4;
    padding: 12px 8px;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.pricing-table-container {
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.price-input {
    width: 70px;
}

.save-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.save-btn:hover {
    background-color: #45a049;
}

/* Review Order Styling */
.review-order-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.review-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.review-section h2 {
    color: #333;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 10px;
    margin-top: 0;
}

.review-services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-services-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}

.review-services-list li:last-child {
    border-bottom: none;
}

/* Customer and Property Details Styling */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.detail-item {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    position: relative;
}

.detail-label {
    font-weight: bold;
    color: #495057;
    margin-right: 8px;
}

/* Date and Time Picker Styling */
input[type="date"],
select#appointmentTime {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
}

input[type="date"]:focus,
select#appointmentTime:focus {
    border-color: #2e69ff;
    outline: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 5px;
    filter: invert(0.5);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(0.7);
}

/* Edit Icons and Inline Editing */
.edit-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
}

.detail-item:hover .edit-icon {
    opacity: 1;
}

.inline-edit {
    width: 90%;
    border: 1px solid #007bff;
    padding: 2px 4px;
    font-size: inherit;
    font-family: inherit;
    border-radius: 3px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.appointment-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

.appointment-modal h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-save {
    background-color: #28a745;
}

.btn-cancel {
    background-color: #6c757d;
}

/* Terms Section */
.terms-section input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 8px;
}

.terms-section label {
    cursor: pointer;
}

/* Stripe Payment Element Styles */
#payment-container {
    margin-top: 25px;
    margin-bottom: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e8;
}

.payment-message {
    color: #dc3545;
    font-size: 14px;
    line-height: 20px;
    padding: 12px;
    margin-top: 12px;
    border-radius: 4px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Spinner for loading states */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

.hidden {
    display: none;
}

/* Summary Action Buttons */
.summary-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Responsive Layout */
@media (min-width: 992px) {
    .desktop-flex-container {
        display: flex;
        gap: 30px;
    }
    
    .services-column {
        flex: 1;
        order: 1;
    }
    
    .summary-column {
        width: 300px;
        order: 2;
    }
    
    .summary-column .summary-section {
        position: sticky;
        top: 20px;
        background-color: #fff;
        border: 1px solid #e1e1e8;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .form-navigation {
        margin-top: 30px;
    }
    
    .order-container .desktop-flex-container {
        gap: 40px;
    }
    
    .order-container .services-column {
        flex: 3;
    }
    
    .order-container .summary-column {
        width: 350px;
    }
    
    .order-container h1 {
        margin-bottom: 15px;
    }
}

/* Client preview styles */
.client-preview {
    margin-bottom: 20px;
    font-size: 0.95em;
}

.client-preview h4 {
    margin-bottom: 12px;
    color: #333;
    font-weight: 500;
}

.preview-section {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.preview-item {
    display: flex;
    margin-bottom: 8px;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-label {
    font-weight: 500;
    min-width: 100px;
    color: #555;
}
 /* Enhanced styling for date inputs */
 input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    z-index: 1; /* Ensure input is above other elements */
}

input[type="date"]:hover {
    border-color: #999;
}

input[type="date"]:focus {
    outline: none;
    border-color: #4285F4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.date-picker-wrapper {
    margin-bottom: 15px;
}
 /* Style for disabled dates - may work in some browsers */
 [aria-disabled="true"], .ui-state-disabled, .disabled-date {
    opacity: 0.3 !important;
    pointer-events: none !important;
    text-decoration: line-through !important;
}

/* Set maximum dates programmatically */
input[type="date"] {
    max-date: "2025-12-31"; /* Control the maximum selectable date */
}

/* Mobile-responsive fixes */
@media screen and (max-width: 767px) {
  /* Container adjustments */
  .container, .order-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* Form container */
  .form-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 15px !important;
    margin: 0 auto !important;
  }
  
  /* Desktop flex container for services page */
  .desktop-flex-container {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Services and summary columns */
  .services-column, .summary-column {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
  }
  
  /* Form elements */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix for checkboxes */
  .checkbox-group {
    padding-left: 0 !important;
  }
  
  /* Fix for form rows */
  .form-row {
    flex-direction: column !important;
  }
  
  .form-row .form-group {
    width: 100% !important;
    margin-right: 0 !important;
  }
  
  /* Button adjustments */
  .summary-action-buttons {
    flex-direction: column !important;
  }
  
  .btn-checkout, .btn-back {
    width: 100% !important;
    margin-bottom: 10px !important;
  }
  
  /* Fix for right-shifted content */
  body {
    overflow-x: hidden !important;
    position: relative !important;
    width: 100% !important;
  }
  
  /* Logo adjustments */
  .logo-container {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  .logo {
    max-width: 80% !important;
    height: auto !important;
  }
  
  /* Summary section adjustments */
  .summary-section {
    padding: 15px !important;
  }
  
  /* Payment section */
  #payment-container {
    width: 100% !important;
  }
}

/* Fix horizontal scroll on all devices */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Enhanced mobile responsiveness fixes */
@media screen and (max-width: 767px) {
  /* Reset container padding */
  .order-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Fix form container overflow */
  .form-container,
  .desktop-flex-container,
  .services-column,
  .summary-column,
  .checkbox-group,
  .preview-item,
  .client-preview,
  .property-details,
  .services-details,
  .summary-section {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* Fix checkbox labels wrapping */
  .checkbox-group label {
    display: flex !important;
    align-items: flex-start !important;
    padding-right: 5px !important;
    flex-wrap: wrap !important;
    word-break: break-word !important;
  }
  
  /* Prevent text overflow */
  .preview-item span {
    max-width: 60% !important;
    word-wrap: break-word !important;
  }
  
  /* Ensure elements stay in container */
  ul, li, div, p, h1, h2, h3, h4 {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Reduce heading font sizes */
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  h4 { font-size: 16px !important; }
  
  /* Fix summary display */
  .services-details ul li {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  
  /* Improve preview items layout */
  .preview-item {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-bottom: 5px !important;
  }
  
  .preview-label {
    min-width: 80px !important;
    font-weight: bold !important;
  }
  
  /* Fix text wrapping in preview */
  #previewPropertyAddress,
  #previewPropertyCity,
  #previewAppointment {
    word-break: break-word !important;
  }
  
  /* Improve button layout */
  .summary-action-buttons {
    display: flex;
    flex-direction: column;
  }
  
  .btn-checkout, .btn-back {
    width: 100% !important;
    margin: 5px 0 !important;
  }
  
  /* Fix payment container */
  #payment-container {
    padding: 0 !important;
    width: 100% !important;
  }
  
  /* Fix Stripe payment element */
  .__PrivateStripeElement {
    width: 100% !important;
  }
}

/* Global fixes for all screen sizes */
* {
  box-sizing: border-box !important;
}

body {
  overflow-x: hidden;
}

.services-details ul {
  padding-left: 0 !important;
}

.initially-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fade-in {
    opacity: 1;
    visibility: visible;
}