:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2ecc71;
  --secondary-dark: #27ae60;
  --text-color: #2c3e50;
  --light-bg: #f8f9fa;
  --border-color: #ddd;
}

.devis-form-container {
  margin: 2rem auto;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  width: 90%;
}

.devis-container h1 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1.5rem;
}

.devis-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  padding: 0 2rem;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.form-group:first-child {
  margin-top: 2rem;
}

.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  height: 250px;
  resize: vertical;
}

.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group select:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.form-group input,
.form-group textarea,
.dropdown input {
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.dropdown input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  outline: none;
}

.form-group input:required,
.dropdown input:required {
  background-image: linear-gradient(
    45deg,
    transparent,
    transparent 50%,
    #f8f9fa 50%,
    #f8f9fa 100%
  );
  background-position: top right;
  background-size: 15px 15px;
  background-repeat: no-repeat;
}

/* Responsive grid for options */
.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
  }
  
  @media (min-width: 700px) and (max-width: 1200px) {
    .options-container {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (min-width: 1201px) {
    .options-container {
      grid-template-columns: repeat(3, 1fr);
    }
  }

.option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.option-item:focus-within {
  outline: 2px solid var(--primary-color);
}

.option-item:hover {
  background-color: #e9f7fe;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.option-item input[type="checkbox"]:checked + label {
  font-weight: 600;
  color: var(--primary-color);
}

.option-item label {
  flex: 1;
  font-weight: normal;
  cursor: pointer;
  color: var(--text-color);
}

.option-description {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

#other {
  grid-column: 1 / -1;
}

#other_checkbox {
  margin-top: 5px;
}

#other_input {
  width: 100%;
  height: 50px;
  padding: 0.5rem;
  border-radius: 10px;
}

#customOptions {
  height: 250px;
  resize: vertical;
}

#email {
  width: 100%;
  height: 50px;
  padding: 0.5rem;
  border-radius: 10px;
}

.option-price {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 80px;
  text-align: right;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

.btn-primary:focus {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn-primary:hover::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.btn-remove {
  background-color: #e74c3c;
  color: white;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-remove:hover {
  background-color: #c0392b;
}

/* Style pour le total */
.devis-info-p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  font-style: italic;
  padding: 0 2rem;
}

.total-container {
  padding: 1rem;
  background-color: var(--light-bg);
  border-radius: 4px;
  border: 1px solid #ddd;
  position: sticky;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.total-container-div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.total-title {
  display: flex;
  flex-direction: column;
}

.total-container h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.total-amount {
  font-size: 1.5rem;
  color: var(--primary-dark);
  font-weight: 700;
}

/* Style pour le scrollbar des options */
.options-container::-webkit-scrollbar {
  width: 8px;
}

.options-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.btn-create {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  vertical-align: middle;
}

.btn-create:hover {
  background-color: var(--secondary-dark);
}

.form-group input[list] {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  width: 100%;
  background-color: white;
}

.form-group input[list]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group input[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

.form-group select {
  display: none;
}

/* Style pour la liste déroulante */
datalist {
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

datalist option {
  padding: 8px 12px;
  cursor: pointer;
}

datalist option:hover {
  background-color: #f5f5f5;
}

.dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}

.dropdown input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background-color: white;
}

.dropdown input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f6f6f6;
  min-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1;
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

/* Style pour le modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-content {
  background: linear-gradient(145deg, #ffff, #f8f9fa);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  width: 100%;
  max-height: 90%;
  overflow-y: auto;
}

.modal-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 2rem;
  position: relative;
  text-align: center;
}

.modal-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  border-radius: 20px 20px 0 0;
  opacity: 0.3;
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  color: white;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 5;
}

.modal-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
  position: relative;
  z-index: 5;
}

.modal-body {
  padding: 2.5rem;
}

.info-section {
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(52, 152, 219, 0.1);
}

.info-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.info-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: white;
  font-size: 1.2rem;
}

.info-content {
  flex: 1;
}

.info-label {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

.info-value {
  font-size: 1.1rem;
  color: #34495e;
  font-weight: 500;
}

.options-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 24px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border-radius: 2px;
}

.options-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.option-item {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.option-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.option-item:hover {
  border-color: var(--primary-color);
  transform: translateX(5px);
}

.option-item:hover::before {
  transform: scaleY(1);
}

.option-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
}

.option-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1rem;
}

.price-section {
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--secondary-dark)
  );
  color: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.price-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.price-label {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.price-amount {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
}

.price-note {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
  position: relative;
  z-index: 2;
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
  box-shadow: 0 8px 25px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(149, 165, 166, 0.4);
}

.btn span {
  position: relative;
  z-index: 2;
}

@media (min-width: 700px) and (max-width: 1200px) {
  .options-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-group {
    padding: 0 1rem;
  }

  .options-container {
    grid-template-columns: 1fr;
  }

  #other {
    grid-column-start: auto;
    grid-column-end: auto;
    display: flex;
    flex-direction: column;
  }

  .total-container-div {
    flex-direction: column;
    align-items: stretch;
  }

  .total-title {
    align-items: center;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  #submit-btn {
    width: 100%;
    margin-top: 1rem;
  }

  .modal-content {
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .devis-form-container {
    margin: 1rem auto;
    width: 95%;
  }

  .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .price-amount {
    font-size: 2rem;
  }
}

/* error */

#formMessage {
    text-align: center;
    margin-top: 1rem;
}

.error-message {
  color: red;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.error-input {
  border-color: red;
}
