/**
 * =====================================================
 * UNIFIED MODAL SYSTEM CSS - CLEANED VERSION
 * =====================================================
 * Table of Contents:
 * 1. Base Modal Styles (shared by all modals)
 * 2. Standard Modal Components
 * 3. Service Modal Specific Styles
 * 4. Financing Modal Specific Styles
 * 5. Animations
 * 6. Responsive Styles
 * =====================================================
 */

/* =====================================================
 * 1. BASE MODAL STYLES (SHARED BY ALL MODALS)
 * ===================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* =====================================================
 * 2. STANDARD MODAL COMPONENTS
 * ===================================================== */

/* Modal Content Container */
.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: scale(1);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 30px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header h3 i {
  color: var(--primary-color);
  font-size: 28px;
}

/* Close Button */
.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--text-dark);
}

/* Modal Body */
.modal-body {
  padding: 30px;
}

/* CTA Buttons Row */
.modal-cta-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
}

/* =====================================================
 * 3. SERVICE MODAL SPECIFIC STYLES
 * ===================================================== */
.service-modal-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.service-modal-content {
  text-align: center;
}

.service-modal-content h2 {
  font-size: 28px;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.service-modal-content > p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 25px;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Service Modal Image */
.service-modal-image {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

.service-modal-image img {
  width: 100%;
  height: auto;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 20px;
  text-align: center;
}

.image-overlay h4 {
  font-size: 20px;
  margin-bottom: 5px;
}

.image-overlay p {
  font-size: 14px;
  opacity: 0.9;
}

/* Benefits and Warranty Section */
.benefits-warranty-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  align-items: start;
  margin: 30px auto;
  max-width: 900px;
}

.benefits-list {
  margin: 0;
  text-align: left;
}

.benefits-list h3 {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.benefits-list ul {
  list-style: none;
  padding: 0;
}

.benefits-list li {
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-light);
}

.benefits-list li i {
  color: var(--primary-color);
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.warranty-badge {
  background: #f8f7f4;
  border-left: 4px solid var(--primary-color);
  padding: 20px;
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--border-radius);
}

.warranty-badge i {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.warranty-badge strong {
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 5px;
  display: block;
}

.warranty-badge p {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
}

/* =====================================================
 * 4. FINANCING MODAL SPECIFIC STYLES
 * ===================================================== */
.financing-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

.financing-modal.financing-active {
  display: block;
}

.financing-modal-content {
  background-color: #ffffff;
  margin: 2% auto;
  padding: 0;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.financing-modal-header {
  background: linear-gradient(135deg, var(--orange-accent), #d14d00);
  color: white;
  padding: 2rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.financing-modal-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.financing-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: opacity 0.2s;
}

.financing-modal-close:hover {
  opacity: 0.8;
}

.financing-modal-body {
  padding: 2rem;
}

/* Financing Modal Button */
.open-financing-application-modal {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
 * 5. ANIMATIONS
 * ===================================================== */
@keyframes financingFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.financing-modal {
  animation: financingFadeIn 0.3s ease;
}

.financing-modal-content {
  animation: financingSlideUp 0.3s ease;
}

/* =====================================================
 * 6. RESPONSIVE STYLES
 * ===================================================== */
@media (max-width: 768px) {
  /* General Modal Responsive */
  .modal-content {
    width: 95%;
    max-width: none;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-header h3 i {
    font-size: 24px;
  }

  /* Service Modal Responsive */
  .service-modal-content h2 {
    font-size: 24px;
  }

  .benefits-warranty-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .benefits-list {
    margin-bottom: 0;
  }

  .warranty-badge {
    margin: 0 auto;
    max-width: 500px;
  }

  /* CTA Buttons Responsive */
  .modal-cta-buttons {
    flex-direction: column;
  }

  /* Financing Modal Responsive */
  .financing-modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .financing-modal-header {
    padding: 1.5rem;
  }

  .financing-modal-header h2 {
    font-size: 1.5rem;
  }

  .financing-modal-body {
    padding: 1.5rem;
  }
}

/**
 * =====================================================
 * ESTIMATE MODAL STYLES
 * =====================================================
 */

/* Hide elements - IMPORTANT for honeypot field */
.hidden {
  position: absolute !important;
  left: -9999px !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Estimate Form Styles */
.estimate-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form Rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

/* Form Inputs */
.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(179, 168, 133, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
  font-size: 14px;
}

/* Select styling */
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
  appearance: none;
}

/* Textarea specific */
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 5px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  color: var(--text-dark);
}

.radio-label input[type='radio'] {
  margin-right: 8px;
  cursor: pointer;
}

.radio-label span {
  font-size: 15px;
}

/* Submit Button */
.submit-button {
  width: 100%;
  padding: 16px 30px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  position: relative;
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.button-text,
.button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Form Guarantee */
.form-guarantee {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 15px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.form-guarantee i {
  color: var(--primary-color);
  font-size: 16px;
}

/* Success Message */
.estimate-success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  margin-bottom: 20px;
}

.success-icon i {
  font-size: 64px;
  color: #28a745;
}

.estimate-success-message h3 {
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.estimate-success-message p {
  font-size: 16px;
  color: #666;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .radio-group {
    flex-direction: column;
    gap: 12px;
  }

  .submit-button {
    font-size: 16px;
    padding: 14px 25px;
  }

  .estimate-success-message h3 {
    font-size: 24px;
  }

  .success-icon i {
    font-size: 48px;
  }
}

/* Error states */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #dc3545;
}

.form-group .error-message {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
}
