/* ============================================================================
   GLOBAL MODAL STYLES - PADRÃO ÚNICO PARA TODOS OS MODAIS
   ============================================================================ */

/* Asteriscos de campos obrigatórios */
label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
  content: " *";
  color: #00BCD4;
}

.form-label:has(+ input[required])::after,
.form-label:has(+ select[required])::after,
.form-label:has(+ textarea[required])::after {
  content: " *";
  color: #00BCD4;
}

.form-group-detail label:has(+ input[required])::after,
.form-group-detail label:has(+ select[required])::after {
  content: " *";
  color: #00BCD4;
}

/* Modal Wrapper - Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.ativo,
.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Modal Content Container */
.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 550px;
  max-height: 85vh;
  height: auto;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.95);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal.closing .modal-content {
  opacity: 0;
  transform: scale(0.95);
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(135deg, #1FD084 0%, #16b86f 100%);
  flex-shrink: 0;
  border-radius: 12px 12px 0 0;
  gap: 0.6rem;
}

.modal-header h2,
.modal-header h3 {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

/* Modal Close Button */
.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
}

.modal-close:hover {
  color: white;
  transform: rotate(90deg);
  background: rgba(255, 255, 255, 0.2);
}

.modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

.modal-close:focus {
  outline: 2px solid #1FD084;
  outline-offset: 2px;
}

/* Modal Body */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.8rem 1.8rem 2.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #fafafa;
}

/* Form Styles */
.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1.2rem;
}

.form-row:last-of-type {
  grid-template-columns: 1fr !important;
}

.form-row.full-width {
  grid-template-columns: 1fr !important;
}

#service-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 1rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1FD084;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 208, 132, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #00BCD4;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

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

/* Modal Footer */
.modal-footer {
  display: flex;
  gap: 0.8rem;
  padding: 1.2rem 1.8rem;
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
  justify-content: flex-end;
  background: white;
}

/* Modal Buttons */
.modal-btn,
.btn-primary,
.btn-secondary {
  padding: 1rem 1.8rem;
  border: none;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-btn-cancel,
.btn-primary {
  background-color: transparent;
  color: #1FD084;
  border: 2px solid #1FD084;
}

.modal-btn-cancel:hover,
.btn-primary:hover {
  background-color: #1FD084;
  color: white;
}

.modal-btn-submit,
.btn-submit {
  background-color: #00D9FF;
  color: white;
  border: none;
}

.modal-btn-submit:hover,
.btn-submit:hover {
  background-color: #0097a7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.modal-btn:focus,
.btn-primary:focus,
.btn-submit:focus {
  outline: 2px solid #1FD084;
  outline-offset: 2px;
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-content {
    transition: none;
  }
  
  .modal-content {
    opacity: 1;
    transform: scale(1);
  }
  
  .modal.closing .modal-content {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

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

  .modal-header h2,
  .modal-header h3 {
    font-size: 1.2rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-footer {
    padding: 1.5rem;
    flex-direction: column;
  }

  .modal-btn,
  .btn-primary,
  .btn-submit {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    max-height: 98vh;
  }

  .modal-header {
    padding: 1rem 1.2rem;
  }

  .modal-header h2,
  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 1rem;
    gap: 1rem;
  }

  .modal-footer {
    padding: 1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.9rem;
    padding: 0.75rem 0.9rem;
  }
}


/* Toggle Switch Styles */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  background: transparent;
  border-radius: 0;
  margin-bottom: 0.6rem;
  justify-content: flex-start;
}

.toggle-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  min-width: 30px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ddd;
  transition: 0.3s;
  border-radius: 26px;
  border: none;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #1FD084;
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1FD084;
  min-width: 30px;
  text-align: left;
}

