/* Base Styles */

/* CSS Variables */
:root {
  --jm-color-primary: #0B3C5D;
  --jm-color-primary-dark: #072540;
  --jm-color-secondary: #2F3A40;
  --jm-color-accent: #F59E0B;
  --jm-color-bg-light: #F5F7FA;
  --jm-color-text: #1F2933;
  --jm-color-text-light: #64748B;
  --jm-color-border: #E2E8F0;
  --jm-color-primary-rgb: 11, 60, 93;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Remove mobile tap highlight */
  -webkit-tap-highlight-color: transparent;
}

/* Remove focus outline for all elements on mobile */
@media (max-width: 900px) {
  button:focus,
  a:focus,
  input:focus,
  select:focus,
  textarea:focus {
    outline: none;
    box-shadow: none;
  }
}

/* Base Typography */
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--jm-color-text);
  line-height: 1.65;
  background: #fff;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--jm-color-primary);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 36px;
  margin-bottom: 20px;
}

h2 {
  font-size: 28px;
  margin-bottom: 16px;
}

h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--jm-color-accent);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 2px solid var(--jm-color-primary);
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 15px;
}

.btn-primary {
  background-color: var(--jm-color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--jm-color-accent);
  border-color: var(--jm-color-accent);
  color: #fff;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.modal-content {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--jm-color-text);
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: var(--jm-color-bg-light);
  color: var(--jm-color-primary);
}

.modal-header {
  padding: 30px 30px 20px;
  text-align: center;
  background-color: var(--jm-color-bg-light);
  border-bottom: 2px solid var(--jm-color-primary);
  border-radius: 8px 8px 0 0;
}

.modal-header h2 {
  margin-bottom: 12px;
  color: var(--jm-color-primary);
  font-size: 26px;
}

.modal-header p {
  color: var(--jm-color-secondary);
  margin-bottom: 0;
  font-size: 15px;
}

.quote-form {
  padding: 30px;
  background-color: #fff;
  max-width: 100% !important;
}

/* Ensure modal form elements take full width */
.modal-content .quote-form {
  text-align: center;
  padding: 30px !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Reset form-row styles */
.modal-content .quote-form .form-row {
  margin: 0 0 24px 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  text-align: left !important;
}

/* Reset label styles */
.modal-content .quote-form .form-row label {
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

/* Ensure all input fields take full width */
.modal-content .quote-form .form-row input[type="text"],
.modal-content .quote-form .form-row input[type="email"],
.modal-content .quote-form .form-row input[type="tel"],
.modal-content .quote-form .form-row textarea {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  border: 2px solid var(--jm-color-bg-light) !important;
  border-radius: 4px !important;
  font-size: 15px !important;
  font-family: inherit !important;
  background-color: #fff !important;
  color: var(--jm-color-text) !important;
  box-sizing: border-box !important;
  display: block !important;
  clear: both !important;
  float: none !important;
}

/* Ensure file input takes full width */
.modal-content .quote-form .form-row input[type="file"] {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 16px !important;
  border: 2px dashed var(--jm-color-bg-light) !important;
  border-radius: 4px !important;
  background-color: var(--jm-color-bg-light) !important;
  box-sizing: border-box !important;
  display: block !important;
  clear: both !important;
  float: none !important;
}

/* Ensure checkbox label is properly aligned */
.modal-content .quote-form .form-row .checkbox-label {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: flex-start !important;
}

/* Ensure submit button takes full width */
.modal-content .quote-form .submit-btn {
  width: 100% !important;
  max-width: 100% !important;
  margin: 16px 0 0 0 !important;
  padding: 16px 24px !important;
  box-sizing: border-box !important;
  display: block !important;
  clear: both !important;
  float: none !important;
}

/* Ensure textarea takes full width and has proper height */
.modal-content .quote-form .form-row textarea {
  resize: vertical !important;
  min-height: 140px !important;
  line-height: 1.6 !important;
}

/* Ensure box-sizing is correct for all elements */
.modal-content .quote-form * {
  box-sizing: border-box !important;
}

/* Fix checkbox label alignment in modal */
.modal-content .quote-form .form-row .checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: left !important;
}

/* Fix checkbox alignment */
.modal-content .quote-form .form-row .checkbox-label input[type="checkbox"] {
  margin-top: 3px !important;
  flex-shrink: 0 !important;
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--jm-color-primary) !important;
  border: 2px solid var(--jm-color-bg-light) !important;
  border-radius: 3px !important;
  transition: all 0.2s ease !important;
}

/* Ensure checkbox text doesn't get truncated */
.modal-content .quote-form .form-row .checkbox-label span {
  flex-grow: 1 !important;
  overflow: visible !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--jm-color-text) !important;
}

.form-row {
  margin-bottom: 24px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--jm-color-text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--jm-color-bg-light);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #fff;
  color: var(--jm-color-text);
}

.form-row input[type="text"]::placeholder,
.form-row input[type="email"]::placeholder,
.form-row input[type="tel"]::placeholder,
.form-row textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.form-row input[type="text"]:hover,
.form-row input[type="email"]:hover,
.form-row input[type="tel"]:hover,
.form-row textarea:hover {
  border-color: #cbd5e1;
  background-color: var(--jm-color-bg-light);
}

.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.form-row input[type="tel"]:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--jm-color-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(var(--jm-color-primary-rgb), 0.1);
}

.form-row textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-row input[type="file"] {
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--jm-color-bg-light);
  border-radius: 4px;
  background-color: var(--jm-color-bg-light);
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
  color: var(--jm-color-text);
}

.form-row input[type="file"]:hover {
  border-color: var(--jm-color-primary);
  background-color: rgba(var(--jm-color-primary-rgb), 0.05);
}

.form-row input[type="file"]::file-selector-button {
  background-color: var(--jm-color-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  margin-right: 12px;
  transition: all 0.2s ease;
}

.form-row input[type="file"]::file-selector-button:hover {
  background-color: var(--jm-color-accent);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: normal;
  cursor: pointer;
  color: var(--jm-color-text);
  font-size: 14px;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--jm-color-primary);
  border: 2px solid var(--jm-color-bg-light);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:hover {
  border-color: var(--jm-color-primary);
}

.checkbox-label a {
  color: var(--jm-color-primary);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.checkbox-label a:hover {
  color: var(--jm-color-accent);
}

.submit-btn {
  width: 100%;
  padding: 16px 24px;
  background-color: var(--jm-color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(var(--jm-color-primary-rgb), 0.15);
}

.submit-btn:hover {
  background-color: var(--jm-color-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.form-message {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
  background-color: var(--jm-color-bg-light);
  color: var(--jm-color-secondary);
  border: 1px solid #e2e8f0;
}

.form-message.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-message.error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px;
    border-radius: 6px;
  }
  
  .modal-header,
  .quote-form {
    padding: 24px;
  }
  
  .modal-close {
    top: 12px;
    right: 16px;
    font-size: 28px;
    width: 26px;
    height: 26px;
  }
  
  .modal-header h2 {
    font-size: 22px;
    margin-bottom: 10px;
  }
  
  .modal-header p {
    font-size: 14px;
  }
  
  .form-row {
    margin-bottom: 20px;
  }
  
  .form-row input[type="text"],
  .form-row input[type="email"],
  .form-row input[type="tel"],
  .form-row textarea {
    padding: 12px 14px;
    font-size: 14px;
  }
  
  .submit-btn {
    padding: 14px 20px;
    font-size: 15px;
    margin-top: 12px;
  }
}

.btn-secondary {
  background-color: transparent;
  color: var(--jm-color-primary);
}

.btn-secondary:hover {
  background-color: var(--jm-color-bg-light);
}

/* Image Placeholders */
.img-box {
  background: #e5e7eb;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.img-box::after {
  content: "IMAGE";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #64748b;
  letter-spacing: 2px;
}

.img-hero {
  height: 360px;
}

.img-small {
  height: 160px;
}

.img-medium {
  height: 240px;
}
